PluginProbe
Comments Extra Fields For Post,Pages and CPT / 5.1
Comments Extra Fields For Post,Pages and CPT v5.1
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.daterange.php

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

190 lines 7.1 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 date input control and their
4 * dependencies. Do not make changes in code
5 * Create on: 9 November, 2013
6 */
7
8 class NM_Daterange_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 = __ ( 'DateRange Input', 'wp-comment-fields' );
25 $this -> desc = __ ( '<a href="http://www.daterangepicker.com/" target="_blank">More detail</a>', 'wp-comment-fields' );
26 $this -> icon = __ ( '<i class="fa fa-table" 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', 'wp-comment-fields' ),
37 'desc' => __ ( 'All about Daterangepicker, see daterangepicker', 'wp-comment-fields' ),
38 'link' => __ ( '<a href="http://www.daterangepicker.com/" target="_blank">Daterangepicker</a>', 'wp-comment-fields' )
39 ),
40 'data_name' => array (
41 'type' => 'text',
42 'title' => __ ( 'Data name', 'wp-comment-fields' ),
43 'desc' => __ ( 'REQUIRED: The identification name of this field, that you can insert into body email configuration. Note:Use only lowercase characters and underscores.', 'wp-comment-fields' )
44 ),
45 'description' => array (
46 'type' => 'textarea',
47 'title' => __ ( 'Description', 'wp-comment-fields' ),
48 'desc' => __ ( 'Small description, it will be display near name title.', 'wp-comment-fields' )
49 ),
50 'error_message' => array (
51 'type' => 'text',
52 'title' => __ ( 'Error message', 'wp-comment-fields' ),
53 'desc' => __ ( 'Insert the error message for validation.', 'wp-comment-fields' )
54 ),
55 'class' => array (
56 'type' => 'text',
57 'title' => __ ( 'Class', 'wp-comment-fields' ),
58 'desc' => __ ( 'Insert an additional class(es) (separateb by comma) for more personalization.', 'wp-comment-fields' ),
59 'col_classes' => array('col-md-3','col-sm-12')
60 ),
61 'width' => array (
62 'type' => 'select',
63 'title' => __ ( 'Width', 'wp-comment-fields' ),
64 'desc' => __ ( 'Select width column.', "wpcomment"),
65 'options' => wpcomment_get_input_cols(),
66 'default' => 12,
67 'col_classes' => array('col-md-3','col-sm-12')
68 ),
69 'open_style' => array (
70 'type' => 'select',
71 'title' => __ ( 'Open Style', 'wp-comment-fields' ),
72 'desc' => __ ( 'Default is down.', 'wp-comment-fields' ),
73 'options' => array('down'=>'Down', 'up'=>'Up'),
74 'col_classes' => array('col-md-3','col-sm-12')
75 ),
76 'date_formats' => array (
77 'type' => 'text',
78 'title' => __ ( 'Format', 'wp-comment-fields' ),
79 'desc' => __ ( 'e.g MM-DD-YYYY, DD-MMM-YYYY', 'wp-comment-fields' ),
80 'col_classes' => array('col-md-3','col-sm-12')
81 ),
82 'tp_increment' => array (
83 'type' => 'text',
84 'title' => __ ( 'Timepicker increment', 'wp-comment-fields' ),
85 'desc' => __ ( 'e.g: 30', 'wp-comment-fields' ),
86 'col_classes' => array('col-md-3','col-sm-12')
87 ),
88 'start_date' => array (
89 'type' => 'text',
90 'title' => __ ( 'Start Date', 'wp-comment-fields' ),
91 'desc' => __ ( 'Must be same format as defined in above (Format) field.', 'wp-comment-fields' ),
92 'col_classes' => array('col-md-3','col-sm-12')
93 ),
94 'end_date' => array (
95 'type' => 'text',
96 'title' => __ ( 'End Date', 'wp-comment-fields' ),
97 'desc' => __ ( 'Must be same format as defined in above (Format) field.', 'wp-comment-fields' ),
98 'col_classes' => array('col-md-3','col-sm-12')
99 ),
100 'min_date' => array (
101 'type' => 'text',
102 'title' => __ ( 'Min Date', 'wp-comment-fields' ),
103 'desc' => __ ( 'e.g: 2017-02-25', 'wp-comment-fields' ),
104 'col_classes' => array('col-md-3','col-sm-12')
105 ),
106 'max_date' => array (
107 'type' => 'text',
108 'title' => __ ( 'Max Date', 'wp-comment-fields' ),
109 'desc' => __ ( 'e.g: 2017-09-15', 'wp-comment-fields' ),
110 'col_classes' => array('col-md-3','col-sm-12')
111 ),
112 'visibility' => array (
113 'type' => 'select',
114 'title' => __ ( 'Visibility', 'wp-comment-fields' ),
115 'desc' => __ ( 'Set field visibility based on user.', "wpcomment"),
116 'options' => wpcomment_field_visibility_options(),
117 'default' => 'everyone',
118 'col_classes' => array('col-md-3','col-sm-12')
119
120 ),
121 'visibility_role' => array (
122 'type' => 'text',
123 'title' => __ ( 'User Roles', 'wp-comment-fields' ),
124 'desc' => __ ( 'Role separated by comma.', "wpcomment"),
125 'hidden' => true,
126 ),
127 'time_picker' => array (
128 'type' => 'checkbox',
129 'title' => __ ( 'Show Timepicker', 'wp-comment-fields' ),
130 'desc' => __ ( 'Show Timepicker.', 'wp-comment-fields' ),
131 'col_classes' => array('col-md-3','col-sm-12')
132 ),
133 'tp_24hours' => array (
134 'type' => 'checkbox',
135 'title' => __ ( 'Show Timepicker 24 Hours', 'wp-comment-fields' ),
136 'desc' => __ ( 'Left blank for default', 'wp-comment-fields' ),
137 'col_classes' => array('col-md-3','col-sm-12')
138 ),
139 'tp_seconds' => array (
140 'type' => 'checkbox',
141 'title' => __ ( 'Show Timepicker Seconds', 'wp-comment-fields' ),
142 'desc' => __ ( 'Left blank for default', 'wp-comment-fields' ),
143 'col_classes' => array('col-md-3','col-sm-12')
144 ),
145 'drop_down' => array (
146 'type' => 'checkbox',
147 'title' => __ ( 'Show Dropdown', 'wp-comment-fields' ),
148 'desc' => __ ( 'Left blank for default', 'wp-comment-fields' ),
149 'col_classes' => array('col-md-3','col-sm-12')
150 ),
151 'show_weeks' => array (
152 'type' => 'checkbox',
153 'title' => __ ( 'Show Week Numbers', 'wp-comment-fields' ),
154 'desc' => __ ( 'Left blank for default.', 'wp-comment-fields' ),
155 'col_classes' => array('col-md-3','col-sm-12')
156 ),
157 'auto_apply' => array (
158 'type' => 'checkbox',
159 'title' => __ ( 'Auto Apply Changes', 'wp-comment-fields' ),
160 'desc' => __ ( 'Hide the Apply/Cancel button.', 'wp-comment-fields' ),
161 'col_classes' => array('col-md-3','col-sm-12')
162 ),
163 'desc_tooltip' => array (
164 'type' => 'checkbox',
165 'title' => __ ( 'Show tooltip (PRO)', 'wp-comment-fields' ),
166 'desc' => __ ( 'Show Description in Tooltip with Help Icon', 'wp-comment-fields' ),
167 'col_classes' => array('col-md-3','col-sm-12')
168 ),
169 'required' => array (
170 'type' => 'checkbox',
171 'title' => __ ( 'Required', 'wp-comment-fields' ),
172 'desc' => __ ( 'Select this if it must be required.', 'wp-comment-fields' ),
173 'col_classes' => array('col-md-3','col-sm-12')
174 ),
175 'logic' => array (
176 'type' => 'checkbox',
177 'title' => __ ( 'Enable Conditions', 'wp-comment-fields' ),
178 'desc' => __ ( 'Tick it to turn conditional logic to work below', 'wp-comment-fields' )
179 ),
180 'conditions' => array (
181 'type' => 'html-conditions',
182 'title' => __ ( 'Conditions', 'wp-comment-fields' ),
183 'desc' => __ ( 'Tick it to turn conditional logic to work below', 'wp-comment-fields' )
184 ),
185 );
186
187 $type = 'daterange';
188 return apply_filters("poom_{$type}_input_setting", $input_meta, $this);
189 }
190 }