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

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

118 lines 4.0 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 radio input control and their
4 * dependencies. Do not make changes in code
5 * Create on: 9 November, 2013
6 */
7
8 class NM_Radio_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 = __ ( 'Radio Input', "wpcomment" );
25 $this -> desc = __ ( 'regular radio input', "wpcomment" );
26 $this -> icon = __ ( '<i class="fa fa-dot-circle-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 diplay 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 'selected' => array (
60 'type' => 'text',
61 'title' => __ ( 'Selected option', "wpcomment" ),
62 'desc' => __ ( 'Type option name given in (Add Options) tab if you want already selected.', "wpcomment" )
63 ),
64 'class' => array (
65 'type' => 'text',
66 'title' => __ ( 'Class', "wpcomment" ),
67 'desc' => __ ( 'Insert an additional class(es) (separateb by comma) for more personalization.', "wpcomment" ),
68 'col_classes' => array('col-md-3','col-sm-12')
69 ),
70 'width' => array (
71 'type' => 'select',
72 'title' => __ ( 'Width', 'wp-comment-fields' ),
73 'desc' => __ ( 'Select width column', "wpcomment"),
74 'options' => wpcomment_get_input_cols(),
75 'default' => 12,
76 'col_classes' => array('col-md-3','col-sm-12')
77 ),
78 'visibility' => array (
79 'type' => 'select',
80 'title' => __ ( 'Visibility', 'wp-comment-fields' ),
81 'desc' => __ ( 'Set field visibility based on user.', "wpcomment"),
82 'options' => wpcomment_field_visibility_options(),
83 'default' => 'everyone',
84 ),
85 'visibility_role' => array (
86 'type' => 'text',
87 'title' => __ ( 'User Roles', 'wp-comment-fields' ),
88 'desc' => __ ( 'Role separated by comma.', "wpcomment"),
89 'hidden' => true,
90 ),
91 'desc_tooltip' => array (
92 'type' => 'checkbox',
93 'title' => __ ( 'Show tooltip (PRO)', 'wp-comment-fields' ),
94 'desc' => __ ( 'Show Description in Tooltip with Help Icon', 'wp-comment-fields' ),
95 'col_classes' => array('col-md-3','col-sm-12')
96 ),
97 'required' => array (
98 'type' => 'checkbox',
99 'title' => __ ( 'Required', "wpcomment" ),
100 'desc' => __ ( 'Select this if it must be required.', "wpcomment" ),
101 'col_classes' => array('col-md-3','col-sm-12')
102 ),
103 'logic' => array (
104 'type' => 'checkbox',
105 'title' => __ ( 'Enable Conditions', "wpcomment" ),
106 'desc' => __ ( 'Tick it to turn conditional logic to work below', "wpcomment" )
107 ),
108 'conditions' => array (
109 'type' => 'html-conditions',
110 'title' => __ ( 'Conditions', "wpcomment" ),
111 'desc' => __ ( 'Tick it to turn conditional logic to work below', "wpcomment" )
112 ),
113 );
114
115 $type = 'radio';
116 return apply_filters("poom_{$type}_input_setting", $input_meta, $this);
117 }
118 }