PluginProbe
Comments Extra Fields For Post,Pages and CPT / trunk
Comments Extra Fields For Post,Pages and CPT vtrunk
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.select.php

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

125 lines 4.5 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 select input control and their
4 * dependencies. Do not make changes in code
5 * Create on: 9 November, 2013
6 */
7
8 class NM_Select_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 = __ ( 'Select Input', 'wp-comment-fields' );
25 $this -> desc = __ ( 'regular select input', 'wp-comment-fields' );
26 $this -> icon = __ ( '<i class="fa fa-check" 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' => __ ( 'It will be shown as field label', 'wp-comment-fields' )
38 ),
39 'data_name' => array (
40 'type' => 'text',
41 'title' => __ ( 'Data name', 'wp-comment-fields' ),
42 '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' )
43 ),
44 'description' => array (
45 'type' => 'textarea',
46 'title' => __ ( 'Description', 'wp-comment-fields' ),
47 'desc' => __ ( 'Small description, it will be display near name title.', 'wp-comment-fields' )
48 ),
49 'error_message' => array (
50 'type' => 'text',
51 'title' => __ ( 'Error message', 'wp-comment-fields' ),
52 'desc' => __ ( 'Insert the error message for validation.', 'wp-comment-fields' )
53 ),
54 'options' => array (
55 'type' => 'paired',
56 'title' => __ ( 'Add options', 'wp-comment-fields' ),
57 'desc' => __ ( 'Type option with price (optionally), Option ID should be unique and without spaces.', 'wp-comment-fields' )
58 ),
59 'selected' => array (
60 'type' => 'text',
61 'title' => __ ( 'Selected option', 'wp-comment-fields' ),
62 'desc' => __ ( 'Type option name given in (Add Options) tab if you want already selected.', 'wp-comment-fields' )
63 ),
64 'first_option' => array (
65 'type' => 'text',
66 'title' => __ ( 'First option', 'wp-comment-fields' ),
67 'desc' => __ ( 'Just for info e.g: Select your option.', 'wp-comment-fields' ),
68 'col_classes' => array('col-md-3','col-sm-12')
69 ),
70 'class' => array (
71 'type' => 'text',
72 'title' => __ ( 'Class', 'wp-comment-fields' ),
73 'desc' => __ ( 'Insert an additional class(es) (separateb by comma) for more personalization.', 'wp-comment-fields' ),
74 'col_classes' => array('col-md-3','col-sm-12')
75 ),
76 'width' => array (
77 'type' => 'select',
78 'title' => __ ( 'Width', 'wp-comment-fields' ),
79 'desc' => __ ( 'Select width column', "wpcomment"),
80 'options' => wpcomment_get_input_cols(),
81 'default' => 12,
82 'col_classes' => array('col-md-3','col-sm-12')
83 ),
84 'visibility' => array (
85 'type' => 'select',
86 'title' => __ ( 'Visibility', 'wp-comment-fields' ),
87 'desc' => __ ( 'Set field visibility based on user.', "wpcomment"),
88 'options' => wpcomment_field_visibility_options(),
89 'default' => 'everyone',
90 'col_classes' => array('col-md-3','col-sm-12')
91 ),
92 'visibility_role' => array (
93 'type' => 'text',
94 'title' => __ ( 'User Roles', 'wp-comment-fields' ),
95 'desc' => __ ( 'Role separated by comma.', "wpcomment"),
96 'hidden' => true,
97 ),
98 'desc_tooltip' => array (
99 'type' => 'checkbox',
100 'title' => __ ( 'Show tooltip (PRO)', 'wp-comment-fields' ),
101 'desc' => __ ( 'Show Description in Tooltip with Help Icon', 'wp-comment-fields' ),
102 'col_classes' => array('col-md-3','col-sm-12')
103 ),
104 'required' => array (
105 'type' => 'checkbox',
106 'title' => __ ( 'Required', 'wp-comment-fields' ),
107 'desc' => __ ( 'Select this if it must be required.', 'wp-comment-fields' ),
108 'col_classes' => array('col-md-3','col-sm-12')
109 ),
110 'logic' => array (
111 'type' => 'checkbox',
112 'title' => __ ( 'Enable Conditions', 'wp-comment-fields' ),
113 'desc' => __ ( 'Tick it to turn conditional logic to work below', 'wp-comment-fields' )
114 ),
115 'conditions' => array (
116 'type' => 'html-conditions',
117 'title' => __ ( 'Conditions', 'wp-comment-fields' ),
118 'desc' => __ ( 'Tick it to turn conditional logic to work below', 'wp-comment-fields' )
119 ),
120 );
121
122 $type = 'select';
123 return apply_filters("poom_{$type}_input_setting", $input_meta, $this);
124 }
125 }