PluginProbe
Comments Extra Fields For Post,Pages and CPT / 4.6
Comments Extra Fields For Post,Pages and CPT v4.6
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.number.php

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

138 lines 4.7 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 number input control and their
4 * dependencies. Do not make changes in code
5 * Create on: 21 May, 2014
6 */
7
8 class NM_Number_WPC extends WPComment_Inputs{
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 [];
23
24 $this -> title = __ ( 'Number Input', "wpcomment" );
25 $this -> desc = __ ( 'regular number input', "wpcomment" );
26 $this -> icon = __ ( '<i class="fa fa-hashtag" aria-hidden="true"></i>', 'wp-comment-fields' );
27 $this -> settings = self::get_settings();
28
29 }
30
31 private function get_settings(){
32
33 $input_meta = array (
34 'title' => array (
35 'type' => 'text',
36 'title' => __ ( 'Title', "wpcomment" ),
37 'desc' => __ ( 'It will be shown as field label', "wpcomment" )
38 ),
39 'data_name' => array (
40 'type' => 'text',
41 'title' => __ ( 'Data name', "wpcomment" ),
42 'desc' => __ ( 'REQUIRED: The identification name of this field, that you can insert into body email configuration. Note:Use only lowercase characters and underscores.', "wpcomment" )
43 ),
44 'description' => array (
45 'type' => 'textarea',
46 'title' => __ ( 'Description', "wpcomment" ),
47 'desc' => __ ( 'Small description, it will be display near name title.', "wpcomment" )
48 ),
49 'placeholder' => array (
50 'type' => 'text',
51 'title' => __ ( 'Placeholder', 'wp-comment-fields' ),
52 'desc' => __ ( 'Optionally placeholder.', 'wp-comment-fields' )
53 ),
54 'error_message' => array (
55 'type' => 'text',
56 'title' => __ ( 'Error message', "wpcomment" ),
57 'desc' => __ ( 'Insert the error message for validation.', "wpcomment" )
58 ),
59 'max' => array (
60 'type' => 'text',
61 'title' => __ ( 'Max. values', "wpcomment" ),
62 'desc' => __ ( 'Max. values allowed, leave blank for default', "wpcomment" ),
63 'col_classes' => array('col-md-3','col-sm-12')
64 ),
65 'min' => array (
66 'type' => 'text',
67 'title' => __ ( 'Min. values', "wpcomment" ),
68 'desc' => __ ( 'Min. values allowed, leave blank for default', "wpcomment" ),
69 'col_classes' => array('col-md-3','col-sm-12')
70 ),
71 'step' => array (
72 'type' => 'text',
73 'title' => __ ( 'Steps', "wpcomment" ),
74 'desc' => __ ( 'specified legal number intervals', "wpcomment" ),
75 'col_classes' => array('col-md-3','col-sm-12')
76 ),
77 'default_value' => array (
78 'type' => 'text',
79 'title' => __ ( 'Set default value', "wpcomment" ),
80 'desc' => __ ( 'Pre-defined value for text input', "wpcomment" ),
81 'col_classes' => array('col-md-3','col-sm-12')
82 ),
83 'class' => array (
84 'type' => 'text',
85 'title' => __ ( 'Class', "wpcomment" ),
86 'desc' => __ ( 'Insert an additional class(es) (separateb by comma) for more personalization.', "wpcomment" ),
87 'col_classes' => array('col-md-3','col-sm-12')
88 ),
89 'width' => array (
90 'type' => 'select',
91 'title' => __ ( 'Width', 'wp-comment-fields' ),
92 'desc' => __ ( 'Select width column.', "wpcomment"),
93 'options' => wpcomment_get_input_cols(),
94 'default' => 12,
95 'col_classes' => array('col-md-3','col-sm-12')
96 ),
97 'visibility' => array (
98 'type' => 'select',
99 'title' => __ ( 'Visibility', 'wp-comment-fields' ),
100 'desc' => __ ( 'Set field visibility based on user.', "wpcomment"),
101 'options' => wpcomment_field_visibility_options(),
102 'default' => 'everyone',
103 ),
104 'visibility_role' => array (
105 'type' => 'text',
106 'title' => __ ( 'User Roles', 'wp-comment-fields' ),
107 'desc' => __ ( 'Role separated by comma.', "wpcomment"),
108 'hidden' => true,
109 ),
110 'desc_tooltip' => array (
111 'type' => 'checkbox',
112 'title' => __ ( 'Show tooltip (PRO)', 'wp-comment-fields' ),
113 'desc' => __ ( 'Show Description in Tooltip with Help Icon', 'wp-comment-fields' ),
114 'col_classes' => array('col-md-3','col-sm-12')
115 ),
116 'required' => array (
117 'type' => 'checkbox',
118 'title' => __ ( 'Required', "wpcomment" ),
119 'desc' => __ ( 'Select this if it must be required.', "wpcomment" ),
120 'col_classes' => array('col-md-3','col-sm-12')
121 ),
122 'logic' => array (
123 'type' => 'checkbox',
124 'title' => __ ( 'Enable Conditions', "wpcomment" ),
125 'desc' => __ ( 'Tick it to turn conditional logic to work below', "wpcomment" )
126 ),
127 'conditions' => array (
128 'type' => 'html-conditions',
129 'title' => __ ( 'Conditions', "wpcomment" ),
130 'desc' => __ ( 'Tick it to turn conditional logic to work below', "wpcomment" )
131 ),
132
133 );
134
135 $type = 'number';
136 return apply_filters("poom_{$type}_input_setting", $input_meta, $this);
137 }
138 }