PluginProbe
Comments Extra Fields For Post,Pages and CPT / 4.3
Comments Extra Fields For Post,Pages and CPT v4.3
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.image.php

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

168 lines 6.4 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 pre-uploaded image control and their
4 * dependencies. Do not make changes in code
5 * Create on: 9 November, 2013
6 */
7
8 class NM_Image_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 = __ ( 'Images', 'wp-comment-fields' );
25 $this -> desc = __ ( 'Images selection', 'wp-comment-fields' );
26 $this -> icon = __ ( '<i class="fa fa-picture-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', '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
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 'selected_img_bordercolor' => array (
70 'type' => 'color',
71 'title' => __ ( 'Selected Image Border Color', 'wp-comment-fields' ),
72 'desc' => __ ( 'Change selected images border color, e.g: #fff', 'wp-comment-fields' ),
73 'col_classes' => array('col-md-3','col-sm-12')
74 ),
75 'images' => array (
76 'type' => 'pre-images',
77 'title' => __ ( 'Select images', 'wp-comment-fields' ),
78 'desc' => __ ( 'Select images from media library', 'wp-comment-fields' )
79 ),
80 'selected' => array (
81 'type' => 'text',
82 'title' => __ ( 'Selected image', 'wp-comment-fields' ),
83 'desc' => __ ( 'Type option title given in (Add Images) tab if you want it already selected.', 'wp-comment-fields' ),
84 'col_classes' => array('col-md-3','col-sm-12')
85 ),
86 'image_width' => array (
87 'type' => 'text',
88 'title' => __ ( 'Image Width', 'wp-comment-fields' ),
89 'desc' => __ ( 'Change image width e,g: 50px or 50%.', 'wp-comment-fields' ),
90 'col_classes' => array('col-md-3','col-sm-12')
91 ),
92 'image_height' => array (
93 'type' => 'text',
94 'title' => __ ( 'Image Height', 'wp-comment-fields' ),
95 'desc' => __ ( 'Change image height e,g: 50px or 50%. ', 'wp-comment-fields' ),
96 'col_classes' => array('col-md-3','col-sm-12')
97 ),
98 'min_checked' => array (
99 'type' => 'text',
100 'title' => __ ( 'Min. Image Select', "wpcomment" ),
101 'desc' => __ ( 'How many Images can be checked by user e.g: 2. Leave blank for default.', "wpcomment" ),
102 'col_classes' => array('col-md-3','col-sm-12')
103 ),
104 'max_checked' => array (
105 'type' => 'text',
106 'title' => __ ( 'Max. Image Select', "wpcomment" ),
107 'desc' => __ ( 'How many Images can be checked by user e.g: 3. Leave blank for default.', "wpcomment" ),
108 'col_classes' => array('col-md-3','col-sm-12')
109 ),
110 'visibility' => array (
111 'type' => 'select',
112 'title' => __ ( 'Visibility', 'wp-comment-fields' ),
113 'desc' => __ ( 'Set field visibility based on user.', "wpcomment"),
114 'options' => wpcomment_field_visibility_options(),
115 'default' => 'everyone',
116 ),
117 'visibility_role' => array (
118 'type' => 'text',
119 'title' => __ ( 'User Roles', 'wp-comment-fields' ),
120 'desc' => __ ( 'Role separated by comma.', "wpcomment"),
121 'hidden' => true,
122 ),
123 'legacy_view' => array (
124 'type' => 'checkbox',
125 'title' => __ ( 'Enable legacy view', 'wp-comment-fields' ),
126 'desc' => __ ( 'Tick it to turn on old boxes view for images', 'wp-comment-fields' ),
127 'col_classes' => array('col-md-3','col-sm-12')
128 ),
129 'multiple_allowed' => array (
130 'type' => 'checkbox',
131 'title' => __ ( 'Multiple selections?', 'wp-comment-fields' ),
132 'desc' => __ ( 'Allow users to select more then one images?.', 'wp-comment-fields' ),
133 'col_classes' => array('col-md-3','col-sm-12')
134 ),
135 'show_popup' => array (
136 'type' => 'checkbox',
137 'title' => __ ( 'Popup', 'wp-comment-fields' ),
138 'desc' => __ ( 'Show big image on hover', 'wp-comment-fields' ),
139 'col_classes' => array('col-md-3','col-sm-12')
140 ),
141 'desc_tooltip' => array (
142 'type' => 'checkbox',
143 'title' => __ ( 'Show tooltip (PRO)', 'wp-comment-fields' ),
144 'desc' => __ ( 'Show Description in Tooltip with Help Icon', 'wp-comment-fields' ),
145 'col_classes' => array('col-md-3','col-sm-12')
146 ),
147 'required' => array (
148 'type' => 'checkbox',
149 'title' => __ ( 'Required', 'wp-comment-fields' ),
150 'desc' => __ ( 'Select this if it must be required.', 'wp-comment-fields' ),
151 'col_classes' => array('col-md-3','col-sm-12')
152 ),
153 'logic' => array (
154 'type' => 'checkbox',
155 'title' => __ ( 'Enable Conditions', 'wp-comment-fields' ),
156 'desc' => __ ( 'Tick it to turn conditional logic to work below', 'wp-comment-fields' )
157 ),
158 'conditions' => array (
159 'type' => 'html-conditions',
160 'title' => __ ( 'Conditions', 'wp-comment-fields' ),
161 'desc' => __ ( 'Tick it to turn conditional logic to work below', 'wp-comment-fields' )
162 ),
163 );
164
165 $type = 'image';
166 return apply_filters("poom_{$type}_input_setting", $input_meta, $this);
167 }
168 }