PluginProbe
Comments Extra Fields For Post,Pages and CPT / 2.3
Comments Extra Fields For Post,Pages and CPT v2.3
trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 2.2 2.3 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 5.0 5.1 5.2
wp-comment-fields / classes / inputs / input.text.php

input.text.php in Comments Extra Fields For Post,Pages and CPT 2.3, at classes/inputs/input.text.php

99 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Followig class handling text input control and their
4 * dependencies. Do not make changes in code
5 * Create on: 9 November, 2013
6 */
7
8 class NM_Text extends NM_Inputs_wpcomment{
9
10 /*
11 * input control settings
12 */
13 var $title, $desc, $settings;
14
15 /*
16 * this var is pouplated with current plugin meta
17 */
18 var $plugin_meta;
19
20 function __construct(){
21
22 $this -> plugin_meta = get_plugin_meta_wpcomment();
23
24 $this -> title = __ ( 'Text Input', 'nm-wpcomments' );
25 $this -> desc = __ ( 'regular text input', 'nm-wpcomments' );
26 $this -> settings = self::get_settings();
27
28 }
29
30
31
32
33 private function get_settings(){
34
35 return array (
36 'title' => array (
37 'type' => 'text',
38 'title' => __ ( 'Title', 'nm-wpcomments' ),
39 'desc' => __ ( 'It will be shown as field label', 'nm-wpcomments' )
40 ),
41 'data_name' => array (
42 'type' => 'text',
43 'title' => __ ( 'Data name', 'nm-wpcomments' ),
44 'desc' => __ ( 'REQUIRED: The identification name of this field, that you can insert into body email configuration. Note:Use only lowercase characters and underscores.', 'nm-wpcomments' )
45 ),
46 'description' => array (
47 'type' => 'text',
48 'title' => __ ( 'Description', 'nm-wpcomments' ),
49 'desc' => __ ( 'Small description, it will be diplay near name title.', 'nm-wpcomments' )
50 ),
51 'error_message' => array (
52 'type' => 'text',
53 'title' => __ ( 'Error message', 'nm-wpcomments' ),
54 'desc' => __ ( 'Insert the error message for validation.', 'nm-wpcomments' )
55 ),
56
57 'required' => array (
58 'type' => 'checkbox',
59 'title' => __ ( 'Required', 'nm-wpcomments' ),
60 'desc' => __ ( 'Select this if it must be required.', 'nm-wpcomments' )
61 ),
62 'class' => array (
63 'type' => 'text',
64 'title' => __ ( 'Class', 'nm-wpcomments' ),
65 'desc' => __ ( 'Insert an additional class(es) (separateb by comma) for more personalization.', 'nm-wpcomments' )
66 ),
67
68 'width' => array (
69 'type' => 'select',
70 'default' => '6',
71 'options' => array('12'=>'12 Columns','6'=>'6 Columns', '4'=>'4 Columns', '3'=>'3 Columns',),
72 'title' => __ ( 'Width', 'nm-wpcomments' ),
73 'desc' => __ ( 'Select column for this field (12 Columns Grid)', 'nm-wpcomments' )
74 ),
75
76 );
77 }
78
79
80 /*
81 * @params: args
82 */
83 function render_input($args, $content=""){
84
85 $_html = '<input type="text" ';
86
87 foreach ($args as $attr => $value){
88
89 $_html .= $attr.'="'.stripslashes( $value ).'"';
90 }
91
92 if($content)
93 $_html .= 'value="' . stripslashes($content ) . '"';
94
95 $_html .= ' />';
96
97 echo $_html;
98 }
99 }