| 1 |
<?php /** |
| 2 |
* @version 1.0 |
| 3 |
* @package Booking Calendar |
| 4 |
* @category Content of Settings page |
| 5 |
* @author wpdevelop |
| 6 |
* |
| 7 |
* @web-site https://wpbookingcalendar.com/ |
| 8 |
* @email info@wpbookingcalendar.com |
| 9 |
* |
| 10 |
* @modified 2015-11-02 |
| 11 |
*/ |
| 12 |
|
| 13 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
class WPBC_Page_SettingsFields extends WPBC_Page_Structure { |
| 18 |
|
| 19 |
public function in_page() { |
| 20 |
return 'wpbc-settings'; |
| 21 |
} |
| 22 |
|
| 23 |
public function tabs() { |
| 24 |
|
| 25 |
$tabs = array(); |
| 26 |
$tabs[ 'sub-toolbar' ] = array( |
| 27 |
'title' => 'Sub Toolbar Elements' // Title of TAB |
| 28 |
, 'hint' => 'Customization of Form Fields' // Hint |
| 29 |
, 'page_title' => 'Form fields' // Title of Page |
| 30 |
//, 'link' => '' // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link |
| 31 |
//, 'position' => '' // 'left' || 'right' || '' |
| 32 |
//, 'css_classes' => '' // CSS class(es) |
| 33 |
//, 'icon' => '' // Icon - link to the real PNG img |
| 34 |
, 'font_icon' => 'wpbc_icn_draw' // CSS definition of forn Icon |
| 35 |
, 'default' => false // Is this tab activated by default or not: true || false. |
| 36 |
, 'subtabs' => array() |
| 37 |
|
| 38 |
); |
| 39 |
// $tabs[ 'upgrade' ] = array( |
| 40 |
// 'title' => 'Upgrade' // Title of TAB |
| 41 |
// , 'hint' => 'Upgrade to higher version' // Hint |
| 42 |
// //, 'page_title' => 'Upgrade' // Title of Page |
| 43 |
// , 'link' => 'http://server.com/' // Can be skiped, then generated link based on Page and Tab tags. Or can be extenral link |
| 44 |
// , 'position' => 'right' // 'left' || 'right' || '' |
| 45 |
// //, 'css_classes' => '' // CSS class(es) |
| 46 |
// //, 'icon' => '' // Icon - link to the real PNG img |
| 47 |
// , 'font_icon' => 'wpbc_icn_auto_graph'// CSS definition of forn Icon |
| 48 |
// //, 'default' => false // Is this tab activated by default or not: true || false. |
| 49 |
// //, 'subtabs' => array() |
| 50 |
// |
| 51 |
// ); |
| 52 |
|
| 53 |
$subtabs = array(); |
| 54 |
|
| 55 |
$subtabs['form-html-section-1'] = array( 'type' => 'html' , 'html' => '<div style="float:left;">' ); |
| 56 |
|
| 57 |
$subtabs['sub-toolbar'] = array( |
| 58 |
'type' => 'subtab' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' |
| 59 |
, 'title' => 'Form' // Title of TAB |
| 60 |
, 'page_title' => 'Form Settings' // Title of Page |
| 61 |
, 'hint' => 'Customization of Form Settings' // Hint |
| 62 |
, 'link' => '' // link |
| 63 |
, 'position' => '' // 'left' || 'right' || '' |
| 64 |
, 'css_classes' => '' // CSS class(es) |
| 65 |
//, 'icon' => 'https://www.paypalobjects.com/webstatic/icon/pp258.png' // Icon - link to the real PNG img |
| 66 |
//, 'font_icon' => 'wpbc_icn_payment' // CSS definition of Font Icon |
| 67 |
, 'default' => true // Is this sub tab activated by default or not: true || false. |
| 68 |
, 'disabled' => false // Is this sub tab deactivated: true || false. |
| 69 |
, 'checkbox' => false // or definition array for specific checkbox: array( 'checked' => true, 'name' => 'feature1_active_status' ) |
| 70 |
, 'content' => 'content' // Function to load as conten of this TAB |
| 71 |
); |
| 72 |
|
| 73 |
$subtabs['form-separator'] = array( |
| 74 |
'type' => 'separator' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' |
| 75 |
); |
| 76 |
$subtabs['form-goto'] = array( |
| 77 |
'type' => 'goto-link' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' |
| 78 |
, 'title' =>ucwords( 'Form fields' ) // Title of TAB |
| 79 |
, 'hint' => '' // Hint |
| 80 |
, 'show_section' => 'id_of_show_section' // ID of HTML element, for scroll to. |
| 81 |
); |
| 82 |
|
| 83 |
$subtabs['form-html-section-2'] = array( 'type' => 'html' , 'html' => '</div>' ); |
| 84 |
|
| 85 |
ob_start(); |
| 86 |
$params = array( |
| 87 |
'label_for' => 'deny_reason1' // "For" parameter of label element |
| 88 |
//, 'label' => 'Reason:' // Label above the input group |
| 89 |
, 'style' => '' // CSS Style of entire div element |
| 90 |
, 'items' => array( |
| 91 |
array( |
| 92 |
'type' => 'addon' |
| 93 |
, 'element' => 'radio' // text | radio | checkbox |
| 94 |
, 'text' => 'Reason of cancelation' // Simple plain text showing |
| 95 |
, 'id' => 'radios' // ID, if this radio | checkbox element |
| 96 |
, 'name' => 'radioss' // Name, if this radio | checkbox element |
| 97 |
, 'value' => '' // value, if this radio | checkbox element |
| 98 |
, 'selected' => false // Selected, if this radio | checkbox element |
| 99 |
, 'legend' => '' // aria-label parameter , if this radio | checkbox element |
| 100 |
, 'class' => '' // Any CSS class here |
| 101 |
, 'attr' => array() // Any additional attributes, if this radio | checkbox element |
| 102 |
) |
| 103 |
, array( |
| 104 |
'type' => 'text' |
| 105 |
, 'id' => 'deny_reason' // HTML ID of element |
| 106 |
, 'value' => '' // Value of Text field |
| 107 |
, 'placeholder' => 'Reason of Cancelation' |
| 108 |
, 'style' => '' // CSS of select element |
| 109 |
, 'class' => '' // CSS Class of select element |
| 110 |
, 'attr' => array() // Any additional attributes, if this radio | checkbox element |
| 111 |
|
| 112 |
) |
| 113 |
, array( |
| 114 |
'type' => 'button' |
| 115 |
, 'title' => 'Delete' |
| 116 |
, 'class' => 'button-secondary' |
| 117 |
, 'font_icon' => 'wpbc_icn_delete_outline' |
| 118 |
, 'icon_position' => 'right' |
| 119 |
, 'action' => "jQuery('#booking_filters_formID').trigger( 'submit' );" ) |
| 120 |
) |
| 121 |
); |
| 122 |
?><span style="float:left;margin:0 5px;"><div class="control-group wpbc-no-padding"><?php // col-sm-2 col-xs-12 " ><?php |
| 123 |
wpbc_bs_input_group( $params ); |
| 124 |
?></div></span><?php |
| 125 |
|
| 126 |
$html_element_data = ob_get_clean(); |
| 127 |
|
| 128 |
$subtabs['form-selection'] = array( |
| 129 |
'type' => 'html' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' |
| 130 |
, 'html' => $html_element_data |
| 131 |
); |
| 132 |
/**/ |
| 133 |
$subtabs['form-save'] = array( |
| 134 |
'type' => 'button' // Required| Possible values: 'subtab' | 'separator' | 'button' | 'goto-link' |
| 135 |
, 'title' => 'Save Changes' // Title of TAB |
| 136 |
, 'form' => 'wpbc_form' // Required for 'button'! Name of Form to submit |
| 137 |
); |
| 138 |
|
| 139 |
$tabs[ 'sub-toolbar' ][ 'subtabs' ] = $subtabs; |
| 140 |
|
| 141 |
return $tabs; |
| 142 |
} |
| 143 |
|
| 144 |
|
| 145 |
public function content() { |
| 146 |
debuge( 'Content <strong>' . basename(__FILE__ ) . '</strong> <span style="font-size:9px;">' . __FILE__ . '</span>'); |
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
wpbc_bs_toolbar_sub_html_container_start(); |
| 151 |
$params = array( |
| 152 |
'label_for' => 'deny_reason1' // "For" parameter of label element |
| 153 |
, 'label' => 'Reason:' // Label above the input group |
| 154 |
, 'style' => '' // CSS Style of entire div element |
| 155 |
, 'items' => array( |
| 156 |
array( |
| 157 |
'type' => 'addon' |
| 158 |
, 'element' => 'radio' // text | radio | checkbox |
| 159 |
, 'text' => 'Reason of cancelation' // Simple plain text showing |
| 160 |
, 'id' => 'radios' // ID, if this radio | checkbox element |
| 161 |
, 'name' => 'radioss' // Name, if this radio | checkbox element |
| 162 |
, 'value' => '' // value, if this radio | checkbox element |
| 163 |
, 'selected' => false // Selected, if this radio | checkbox element |
| 164 |
, 'legend' => '' // aria-label parameter , if this radio | checkbox element |
| 165 |
, 'class' => '' // Any CSS class here |
| 166 |
, 'attr' => array() // Any additional attributes, if this radio | checkbox element |
| 167 |
) |
| 168 |
, array( |
| 169 |
'type' => 'text' |
| 170 |
, 'id' => 'deny_reason' // HTML ID of element |
| 171 |
, 'value' => '' // Value of Text field |
| 172 |
, 'placeholder' => 'Reason of Cancelation' |
| 173 |
, 'style' => '' // CSS of select element |
| 174 |
, 'class' => '' // CSS Class of select element |
| 175 |
, 'attr' => array() // Any additional attributes, if this radio | checkbox element |
| 176 |
|
| 177 |
) |
| 178 |
, array( |
| 179 |
'type' => 'button' |
| 180 |
, 'title' => 'Delete' |
| 181 |
, 'class' => 'button-secondary' |
| 182 |
, 'font_icon' => 'wpbc_icn_delete_outline' |
| 183 |
, 'icon_position' => 'right' |
| 184 |
, 'action' => "jQuery('#booking_filters_formID').trigger( 'submit' );" ) |
| 185 |
) |
| 186 |
); |
| 187 |
?><span class="wpdevelop"><div class="control-group wpbc-no-padding"><?php // col-sm-2 col-xs-12 " ><?php |
| 188 |
wpbc_bs_input_group( $params ); |
| 189 |
?></div></span><?php |
| 190 |
wpbc_bs_toolbar_sub_html_container_end(); |
| 191 |
|
| 192 |
} |
| 193 |
|
| 194 |
|
| 195 |
public function update() { |
| 196 |
|
| 197 |
} |
| 198 |
} |
| 199 |
|
| 200 |
add_action('wpbc_menu_created', array( new WPBC_Page_SettingsFields() , '__construct') ); // Executed after creation of Menu |