PluginProbe
Booking Calendar / 10.11
Booking Calendar v10.11
11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 All 204 releases
booking / includes / ui_settings / class-settings-page-parts.php

class-settings-page-parts.php in Booking Calendar 10.11, at includes/ui_settings/class-settings-page-parts.php

241 lines 8.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Page Structure in Admin Panel
4 *
5 * @version 1.2
6 * @package Any
7 * @category Page Structure in Admin Panel
8 * @author wpdevelop
9 *
10 * @web-site https://wpbookingcalendar.com/
11 * @email info@wpbookingcalendar.com
12 *
13 * @modified 2024-12-23, 2015-11-02
14 */
15
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit; // Exit, if accessed directly.
18 }
19
20 // UI Parts.
21 require_once WPBC_PLUGIN_DIR . '/includes/ui_settings/elements/ui_el__dropdown_menu.php';
22 require_once WPBC_PLUGIN_DIR . '/includes/ui_settings/elements/ui_el__a.php';
23 require_once WPBC_PLUGIN_DIR . '/includes/ui_settings/elements/ui_el__divider.php';
24 require_once WPBC_PLUGIN_DIR . '/includes/ui_settings/parts/ui__nav_top.php';
25 require_once WPBC_PLUGIN_DIR . '/includes/ui_settings/parts/ui__nav_vert.php';
26 require_once WPBC_PLUGIN_DIR . '/includes/ui_settings/parts/ui__nav_horis.php';
27 require_once WPBC_PLUGIN_DIR . '/includes/ui_settings/parts/ui__timeline_toolbar.php';
28
29
30 // FixIn: 11.0.0.1.
31
32 /**
33 * Define Settings Page Structure
34 */
35 class WPBC_Settings_Page_Parts {
36
37 private $page_structure_obj;
38 private $active_page;
39 private $active_tab;
40 private $active_subtab;
41
42
43 /**
44 * Constructor.
45 *
46 * @param array $template_params_arr - array(
47 * 'active_page' => $page_tag,
48 * 'active_tab' => $active_page_tab,
49 * 'active_subtab' => $active_page_subtab,
50 * 'page_structure_obj' => $this,
51 * ).
52 */
53 public function __construct( $template_params_arr ) {
54
55 $this->active_page = $template_params_arr['active_page'];
56 $this->active_tab = $template_params_arr['active_tab'];
57 $this->active_subtab = $template_params_arr['active_subtab'];
58 $this->page_structure_obj = $template_params_arr['page_structure_obj'];
59 }
60
61
62 /**
63 * Show Template Header
64 *
65 * @return void
66 */
67 public function template_header() {
68
69 // Top wrapper for admin pages.
70 ?><div class="wpbc_admin"><?php
71
72 $tabs_arr = $this->page_structure_obj->get_nav_tabs();
73 $current_page_params_arr = $this->page_structure_obj->get_current_page_params();
74
75 wpbc_ui__top_nav(
76 array(
77 'page_tag' => $this->active_page,
78 'active_page_tab' => $this->active_tab,
79 'active_page_subtab' => $this->active_subtab,
80 )
81 );
82
83 // Fires Before showing settings Content page ( for example in setup Wizard for show_top_right_wizard_button ).
84 do_action( 'wpbc_after_wpbc_page_top__header_tabs', $this->active_page, $this->active_tab, $this->active_subtab );
85
86 // By default it shoud be ''. Other options: '', 'min', 'compact', 'max'.
87 $left_navigation__default_view_mode = strval( $this->page_structure_obj->is_use_option__in_subtabs_or_tabs( 'left_navigation__default_view_mode' ) );
88
89 ?><div class="wpbc_settings_page_wrapper <?php echo esc_attr( $left_navigation__default_view_mode ); ?>"><?php
90
91 if ( ! empty( $left_navigation__default_view_mode ) ) {
92 if ( 'none' === $left_navigation__default_view_mode ) {
93 echo '<script type="text/javascript"> jQuery( document ).ready( function () { wpbc_admin_ui__sidebar_left__do_hide(); } ); </script>';
94 }
95 if ( 'min' === $left_navigation__default_view_mode ) {
96 echo '<script type="text/javascript"> jQuery( document ).ready( function () { wpbc_admin_ui__sidebar_left__do_min(); } ); </script>';
97 }
98 if ( 'compact' === $left_navigation__default_view_mode ) {
99 echo '<script type="text/javascript"> jQuery( document ).ready( function () { wpbc_admin_ui__sidebar_left__do_compact(); } ); </script>';
100 }
101 if ( 'max' === $left_navigation__default_view_mode ) {
102 echo '<script type="text/javascript"> jQuery( document ).ready( function () { wpbc_admin_ui__sidebar_left__do_max(); } ); </script>';
103 }
104 }
105
106 // Left vertical menu.
107 wpbc_ui__left_vertical_nav(
108 array(
109 'active_page' => $this->active_page, // wpbc-settings.
110 'active_tab' => $this->active_tab, // calendar_appearance.
111 'active_subtab' => $this->active_subtab, // calendar_appearance_skin.
112 'page_nav_tabs' => $this->page_structure_obj->get_nav_tabs(),
113 )
114 );
115
116 ?>
117 <div class="wpbc_settings_page_content">
118 <div id="<?php echo esc_attr( $this->active_page ); ?>-admin-page" class="wrap wpbc_page wpbc_page_tab__<?php echo esc_attr( $this->active_tab ); ?> wpbc_page_subtab__<?php echo esc_attr( $this->active_subtab ); ?>">
119 <div class="wpbc_admin_message"></div>
120 <div class="wpbc_admin_page">
121 <div id="ajax_working"></div>
122 <div class="clear wpbc_header_margin" style="height:0px;"></div>
123 <div id="ajax_respond" class="ajax_respond" style="display:none;"></div>
124 <div class="clear"></div>
125
126 <?php
127
128 $is_show_top_path = $this->page_structure_obj->is_use_option__in_subtabs_or_tabs( 'is_show_top_path' );
129 if ( $is_show_top_path ) {
130 wpbc_ui_settings__top_path();
131 }
132
133 $is_show_top_navigation = $this->page_structure_obj->is_use_option__in_subtabs_or_tabs( 'is_show_top_navigation' );
134 if ( $is_show_top_navigation ) {
135 // Top horisonal menu.
136 wpbc_ui__top_horisontal_nav(
137 array(
138 'active_page' => $this->active_page, // wpbc-settings.
139 'active_tab' => $this->active_tab, // calendar_appearance.
140 'active_subtab' => $this->active_subtab, // calendar_appearance_skin.
141 'page_nav_tabs' => $this->page_structure_obj->get_nav_tabs(),
142 )
143 );
144 }
145
146 $this->show_title_and_description();
147 }
148
149
150 /**
151 * Show Template Footer
152 *
153 * @return void
154 */
155 public function template_footer() {
156
157 // echo '</div><!-- wpbc_settings_flex_container_right -->';
158 // echo '</div><!-- wpbc_settings_flex_container -->';
159 echo '</div><!-- wpbc_admin_page -->';
160 echo '</div><!-- wpbc_page -->';
161 echo '</div><!-- .wpbc_settings_page_content -->';
162 echo '</div><!-- .wpbc_settings_page_wrapper -->';
163 echo '</div><!-- .wpbc_admin -->';
164
165 }
166
167
168 /**
169 * Show Header Title and Description
170 *
171 * @return void
172 */
173 private function show_title_and_description() {
174
175 $current_page_params_arr = $this->page_structure_obj->get_current_page_params();
176
177 if (
178 ( ! empty( $current_page_params_arr['subtab'] ) ) &&
179 ( ! empty( $current_page_params_arr['subtab']['tag'] ) ) &&
180 ( $current_page_params_arr['subtab']['tag'] === $this->active_subtab )
181 ) { // Active: Subtab.
182 // Header - Title.
183 if ( isset( $current_page_params_arr['subtab']['page_title'] ) ) {
184 $this->show_title( $current_page_params_arr['subtab']['page_title'] );
185 }
186 // Header - Title Description.
187 if ( isset( $current_page_params_arr['subtab']['page_description'] ) ) {
188 $this->show_title_description( $current_page_params_arr['subtab']['page_description'] );
189 } elseif ( isset( $current_page_params_arr['subtab']['hint'] ) ) {
190 $this->show_title_description( $current_page_params_arr['subtab']['hint'] );
191 }
192 } elseif ( ! empty( $current_page_params_arr['tab'] ) ) { // Active: Main tab.
193 // Header - Title.
194 if ( isset( $current_page_params_arr['tab']['page_title'] ) ) {
195 $this->show_title( $current_page_params_arr['tab']['page_title'] );
196 }
197 if ( isset( $current_page_params_arr['tab']['page_description'] ) ) {
198 $this->show_title_description( $current_page_params_arr['tab']['page_description'] );
199 } elseif ( isset( $current_page_params_arr['tab']['hint'] ) ) {
200 $this->show_title_description( $current_page_params_arr['tab']['hint'] );
201 }
202 }
203 }
204
205
206 /**
207 * Show Title
208 *
209 * @param string $value - title of the page.
210 *
211 * @return void
212 */
213 private function show_title( $value ) {
214 if ( ! empty( $value ) ) {
215 echo '<h1 class="wpbc_settings_page_header_title">' . wp_kses_post( $value ) . '</h1>';
216 }
217 }
218
219
220 /**
221 * Show Title Description
222 *
223 * @param string|array $value - Title Description of the page.
224 *
225 * @return void
226 */
227 private function show_title_description( $value ) {
228
229 if ( ! empty( $value ) ) {
230 if ( is_array( $value ) ) {
231
232 if ( ! empty( $value['title'] ) ) {
233 echo '<p class="wpbc_settings_page_header_title_description">' . wp_kses_post( $value['title'] ) . '</p>';
234 }
235 } else {
236 echo '<p class="wpbc_settings_page_header_title_description">' . wp_kses_post( $value ) . '</p>';
237 }
238 }
239 }
240 }
241