PluginProbe
Comments Extra Fields For Post,Pages and CPT / 5.2
Comments Extra Fields For Post,Pages and CPT v5.2
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.checkbox.php

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

130 lines 4.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 checkbox input control and their
4 * dependencies. Do not make changes in code
5 * Create on: 9 November, 2013
6 */
7
8 class NM_Checkbox_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 = __ ( 'Checkbox Input', "wpcomment" );
25 $this -> desc = __ ( 'regular checkbox input', "wpcomment" );
26 $this -> icon = __ ( '<i class="fa fa-check-square-o" 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 'error_message' => array (
50 'type' => 'text',
51 'title' => __ ( 'Error message', "wpcomment" ),
52 'desc' => __ ( 'Insert the error message for validation.', "wpcomment" )
53 ),
54 'options' => array (
55 'type' => 'paired',
56 'title' => __ ( 'Add options', "wpcomment" ),
57 'desc' => __ ( 'Type option with price (optionally)', "wpcomment" )
58 ),
59 'class' => array (
60 'type' => 'text',
61 'title' => __ ( 'Class', "wpcomment" ),
62 'desc' => __ ( 'Insert an additional class(es) (separateb by comma) for more personalization.', "wpcomment" ),
63 'col_classes' => array('col-md-3','col-sm-12')
64 ),
65 'width' => array (
66 'type' => 'select',
67 'title' => __ ( 'Width', 'wp-comment-fields' ),
68 'desc' => __ ( 'Select width column.', "wpcomment"),
69 'options' => wpcomment_get_input_cols(),
70 'default' => 12,
71 'col_classes' => array('col-md-3','col-sm-12')
72 ),
73 'checked' => array (
74 'type' => 'textarea',
75 'title' => __ ( 'Checked option(s)', "wpcomment" ),
76 'desc' => __ ( 'Type option(s) name given in (Add Options) tab if you want already checked.', "wpcomment" )
77 ),
78 'min_checked' => array (
79 'type' => 'text',
80 'title' => __ ( 'Min. Checked option(s)', "wpcomment" ),
81 'desc' => __ ( 'How many options can be checked by user e.g: 2. Leave blank for default.', "wpcomment" ),
82 'col_classes' => array('col-md-3','col-sm-12')
83 ),
84 'max_checked' => array (
85 'type' => 'text',
86 'title' => __ ( 'Max. Checked option(s)', "wpcomment" ),
87 'desc' => __ ( 'How many options can be checked by user e.g: 3. Leave blank for default.', "wpcomment" ),
88 'col_classes' => array('col-md-3','col-sm-12')
89 ),
90 'visibility' => array (
91 'type' => 'select',
92 'title' => __ ( 'Visibility', 'wp-comment-fields' ),
93 'desc' => __ ( 'Set field visibility based on user.', "wpcomment"),
94 'options' => wpcomment_field_visibility_options(),
95 'default' => 'everyone',
96 ),
97 'visibility_role' => array (
98 'type' => 'text',
99 'title' => __ ( 'User Roles', 'wp-comment-fields' ),
100 'desc' => __ ( 'Role separated by comma.', "wpcomment"),
101 'hidden' => true,
102 ),
103 'desc_tooltip' => array (
104 'type' => 'checkbox',
105 'title' => __ ( 'Show tooltip (PRO)', 'wp-comment-fields' ),
106 'desc' => __ ( 'Show Description in Tooltip with Help Icon', 'wp-comment-fields' ),
107 'col_classes' => array('col-md-3','col-sm-12')
108 ),
109 'required' => array (
110 'type' => 'checkbox',
111 'title' => __ ( 'Required', "wpcomment" ),
112 'desc' => __ ( 'Select this if it must be required.', "wpcomment" ),
113 'col_classes' => array('col-md-3','col-sm-12')
114 ),
115 'logic' => array (
116 'type' => 'checkbox',
117 'title' => __ ( 'Enable Conditions', "wpcomment" ),
118 'desc' => __ ( 'Tick it to turn conditional logic to work below', "wpcomment" )
119 ),
120 'conditions' => array (
121 'type' => 'html-conditions',
122 'title' => __ ( 'Conditions', "wpcomment" ),
123 'desc' => __ ( 'Tick it to turn conditional logic to work below', "wpcomment" )
124 ),
125 );
126
127 $type = 'checkbox';
128 return apply_filters("poom_{$type}_input_setting", $input_meta, $this);
129 }
130 }