| 1 |
<?php |
| 2 |
/* |
| 3 |
* Followig class handling hidden input control and their |
| 4 |
* dependencies. Do not make changes in code |
| 5 |
* Create on: 9 November, 2013 |
| 6 |
*/ |
| 7 |
|
| 8 |
class NM_Hidden_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 = __ ( 'Hidden Input', "wpcomment" ); |
| 25 |
$this -> desc = __ ( 'regular hidden input', "wpcomment" ); |
| 26 |
$this -> icon = __ ( '<i class="fa fa-hashtag" aria-hidden="true"></i>', 'wp-comment-fields' ); |
| 27 |
$this -> settings = self::get_settings(); |
| 28 |
|
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
private function get_settings(){ |
| 35 |
|
| 36 |
$input_meta = array ( |
| 37 |
|
| 38 |
'title' => array ( |
| 39 |
'type' => 'text', |
| 40 |
'title' => __ ( 'Title', 'wp-comment-fields' ), |
| 41 |
'desc' => __ ( 'Label will show in cart', 'wp-comment-fields' ) |
| 42 |
), |
| 43 |
'data_name' => array ( |
| 44 |
'type' => 'text', |
| 45 |
'title' => __ ( 'Data name', "wpcomment" ), |
| 46 |
'desc' => __ ( 'REQUIRED: The identification name of this field, that you can insert into body email configuration. Note:Use only lowercase characters and underscores.', "wpcomment" ) |
| 47 |
), |
| 48 |
'field_value' => array ( |
| 49 |
'type' => 'text', |
| 50 |
'title' => __ ( 'Field value', "wpcomment" ), |
| 51 |
'desc' => __ ( 'you can pre-set the value of this hidden input.', "wpcomment" ) |
| 52 |
), |
| 53 |
'visibility' => array ( |
| 54 |
'type' => 'select', |
| 55 |
'title' => __ ( 'Visibility', 'wp-comment-fields' ), |
| 56 |
'desc' => __ ( 'Set field visibility based on user.', "wpcomment"), |
| 57 |
'options' => wpcomment_field_visibility_options(), |
| 58 |
'default' => 'everyone', |
| 59 |
), |
| 60 |
'visibility_role' => array ( |
| 61 |
'type' => 'text', |
| 62 |
'title' => __ ( 'User Roles', 'wp-comment-fields' ), |
| 63 |
'desc' => __ ( 'Role separated by comma.', "wpcomment"), |
| 64 |
'hidden' => true, |
| 65 |
), |
| 66 |
'cart_display' => array ( |
| 67 |
'type' => 'checkbox', |
| 68 |
'title' => __ ( 'Show in Cart', 'wp-comment-fields' ), |
| 69 |
'desc' => __ ( 'Display Field Value in Cart', 'wp-comment-fields' ), |
| 70 |
'col_classes' => array('col-md-3','col-sm-12') |
| 71 |
), |
| 72 |
); |
| 73 |
|
| 74 |
$type = 'hidden'; |
| 75 |
return apply_filters("poom_{$type}_input_setting", $input_meta, $this); |
| 76 |
} |
| 77 |
} |