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.color.php

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

140 lines 5.2 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_Color_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 = __ ( 'Color picker', 'wp-comment-fields' );
25 $this -> desc = __ ( 'Color pallete input', 'wp-comment-fields' );
26 $this -> icon = __ ( '<i class="fa fa-modx" 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 'default_color' => array (
55 'type' => 'text',
56 'title' => __ ( 'Default color', 'wp-comment-fields' ),
57 'desc' => __ ( 'Define default color e.g: #effeff', 'wp-comment-fields' ),
58 'col_classes' => array('col-md-3','col-sm-12')
59 ),
60 'palettes_colors' => array (
61 'type' => 'text',
62 'title' => __ ( 'Palettes colors', 'wp-comment-fields' ),
63 'desc' => __ ( "Color codes seperated by comma e.g: #125, #459, #78b", 'wp-comment-fields' ),
64 'col_classes' => array('col-md-3','col-sm-12')
65 ),
66 'palettes_width' => array (
67 'type' => 'text',
68 'title' => __ ( 'Palettes width', 'wp-comment-fields' ),
69 'desc' => __ ( "e.g: 500", 'wp-comment-fields' ),
70 'col_classes' => array('col-md-3','col-sm-12')
71 ),
72 'palettes_mode' => array (
73 'type' => 'select',
74 'title' => __ ( 'Palettes mode', 'wp-comment-fields' ),
75 'desc' => __ ( "Select Mode", 'wp-comment-fields' ),
76 'options'=> array('hsl'=>'Hue, Saturation, Lightness','hsv'=>'Hue, Saturation, Value'),
77 'col_classes' => array('col-md-3','col-sm-12')
78 ),
79 'width' => array (
80 'type' => 'select',
81 'title' => __ ( 'Width', 'wp-comment-fields' ),
82 'desc' => __ ( 'Select width column.', "wpcomment"),
83 'options' => wpcomment_get_input_cols(),
84 'default' => 12,
85 'col_classes' => array('col-md-3','col-sm-12')
86 ),
87 'visibility' => array (
88 'type' => 'select',
89 'title' => __ ( 'Visibility', 'wp-comment-fields' ),
90 'desc' => __ ( 'Set field visibility based on user.', "wpcomment"),
91 'options' => wpcomment_field_visibility_options(),
92 'default' => 'everyone',
93 'col_classes' => array('col-md-3','col-sm-12')
94 ),
95 'visibility_role' => array (
96 'type' => 'text',
97 'title' => __ ( 'User Roles', 'wp-comment-fields' ),
98 'desc' => __ ( 'Role separated by comma.', "wpcomment"),
99 'hidden' => true,
100 ),
101 'show_palettes' => array (
102 'type' => 'checkbox',
103 'title' => __ ( 'Show palettes', 'wp-comment-fields' ),
104 'desc' => __ ( 'Tick if need to show a group of common colors beneath the square', 'wp-comment-fields' ),
105 'col_classes' => array('col-md-3','col-sm-12')
106 ),
107 'show_onload' => array (
108 'type' => 'checkbox',
109 'title' => __ ( 'Show on load', 'wp-comment-fields' ),
110 'desc' => __ ( 'Display color picker by default, otherwise show on click', 'wp-comment-fields' ),
111 'col_classes' => array('col-md-3','col-sm-12')
112 ),
113 'desc_tooltip' => array (
114 'type' => 'checkbox',
115 'title' => __ ( 'Show tooltip (PRO)', 'wp-comment-fields' ),
116 'desc' => __ ( 'Show Description in Tooltip with Help Icon', 'wp-comment-fields' ),
117 'col_classes' => array('col-md-3','col-sm-12')
118 ),
119 'required' => array (
120 'type' => 'checkbox',
121 'title' => __ ( 'Required', 'wp-comment-fields' ),
122 'desc' => __ ( 'Select this if it must be required.', 'wp-comment-fields' ),
123 'col_classes' => array('col-md-3','col-sm-12')
124 ),
125 'logic' => array (
126 'type' => 'checkbox',
127 'title' => __ ( 'Enable Conditions', 'wp-comment-fields' ),
128 'desc' => __ ( 'Tick it to turn conditional logic to work below', 'wp-comment-fields' )
129 ),
130 'conditions' => array (
131 'type' => 'html-conditions',
132 'title' => __ ( 'Conditions', 'wp-comment-fields' ),
133 'desc' => __ ( 'Tick it to turn conditional logic to work below', 'wp-comment-fields' )
134 ),
135 );
136
137 $type = 'color';
138 return apply_filters("poom_{$type}_input_setting", $input_meta, $this);
139 }
140 }