PluginProbe
Booking Calendar / 10.11
Booking Calendar v10.11
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 10.11.2 All 203 releases
booking / includes / ui_settings / parts / ui__nav_horis.php

ui__nav_horis.php in Booking Calendar 10.11, at includes/ui_settings/parts/ui__nav_horis.php

145 lines 5.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Admin Panel UI - Parts
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 2025-03-20
14 */
15
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit; // Exit, if accessed directly.
18 }
19
20 /**
21 * Show Top Horisontal Navigation Bar
22 *
23 * @param array $args - parameters.
24 *
25 * @return void
26 */
27 function wpbc_ui__top_horisontal_nav( $args =array() ) {
28
29 $defaults = array(
30 'attr' => array(),
31 );
32 $params = wp_parse_args( $args, $defaults );
33
34 $active_page_arr = array(
35 'active_page' => $args['active_page'], // wpbc-settings.
36 'active_tab' => $args ['active_tab'], // calendar_appearance.
37 'active_subtab' => $args['active_subtab'], // calendar_appearance_skin.
38 );
39
40 // Available Main Menu - slug => titles.
41 $show_these_pages_arr = array(
42 'wpbc' => __( 'Bookings', 'booking' ),
43 'wpbc-new' => __( 'Add Booking', 'booking' ),
44 'wpbc-availability' => __( 'Availability', 'booking' ),
45 'wpbc-prices' => __( 'Prices', 'booking' ),
46 'wpbc-resources' => __( 'Resources', 'booking' ),
47 'wpbc-settings' => __( 'Settings', 'booking' ),
48 'wpbc-setup' => __( 'Setup', 'booking' ),
49 );
50
51
52 // Ability to click on panel, only if there 'min' class - panel minimized!
53 echo '<div class="wpbc_ui_el__horis_top_bar__wrapper">';
54
55 echo ' <div class="wpbc_ui_el__horis_top_bar__content">';
56
57 $main_page_slug = $active_page_arr['active_page'];
58 $page_title = $show_these_pages_arr[ $main_page_slug ];
59
60 // Loop to show all main sections in horisontal menu.
61 foreach ( $show_these_pages_arr as $main_page_slug => $page_title ) {
62
63 // Show only active page settings list.
64 if ( $main_page_slug !== $active_page_arr['active_page'] ) {
65 continue;
66 }
67 $page_item_arr = $args['page_nav_tabs'][ $main_page_slug ];
68
69 do_action( 'hook__wpbc_ui__top_horisontal_nav__start', $active_page_arr['active_page'], $active_page_arr['active_tab'] );
70
71 foreach ( $page_item_arr as $main_menu_slug => $menu_item_arr ) {
72 do_action( 'hook__wpbc_ui__top_horisontal_nav__item_start', $active_page_arr['active_page'], $active_page_arr['active_tab'], $main_menu_slug );
73
74 wpbc_ui__horis_menu__item_main( $main_menu_slug, $menu_item_arr );
75
76 do_action( 'hook__wpbc_ui__top_horisontal_nav__item_end', $active_page_arr['active_page'], $active_page_arr['active_tab'], $main_menu_slug );
77 }
78 do_action( 'hook__wpbc_ui__top_horisontal_nav__end', $active_page_arr['active_page'], $active_page_arr['active_tab'] );
79
80 // wpbc_ui_el__divider_vertical();
81 } // Loop to show all main sections in horisontal menu.
82 echo ' </div><!-- wpbc_ui_el__horis_top_bar__content -->';
83
84 echo '</div><!-- wpbc_ui_el__horis_top_bar__wrapper -->';
85 }
86
87
88 /**
89 * Show Horisontal - "Menu Item".
90 *
91 * @param string $menu_slug - 'calendar_appearance'.
92 * @param array $menu_item_arr - [ [title] => Skin
93 * [page_title] => Calendar General Settings 3
94 * [hint] => Calendar General Settings 2
95 * [link] =>
96 * [position] =>
97 * [css_classes] =>
98 * [icon] =>
99 * [font_icon] => wpbc-bi-calendar2-range
100 * [default] =>
101 * [disabled] =>
102 * [hided] =>
103 * [is_active] => 1
104 * [url] => http://beta/wp-admin/admin.php?page=wpbc-settings&#038;tab=calendar_appearance
105 * [subtabs] => [....]
106 * ]
107 *
108 * @return void
109 */
110 function wpbc_ui__horis_menu__item_main( $menu_slug, $menu_item_arr ) {
111
112 $defaults = array(
113 'title' => '',
114 'page_title' => '',
115 'hint' => '',
116 'link' => '',
117 'position' => '',
118 'css_classes' => '',
119 'icon' => '',
120 'font_icon' => '',
121 'default' => false,
122 'disabled' => false,
123 'hided' => false,
124 'is_active' => 0,
125 'url' => '',
126 'subtabs' => array(),
127 );
128 $menu_item_arr = wp_parse_args( $menu_item_arr, $defaults );
129
130 ?><div class="wpbc_ui_el__horis_nav_item wpbc_ui_el__horis_nav_item__<?php echo esc_attr( $menu_slug ); ?> <?php echo ( ! empty( $menu_item_arr['is_active'] ) ) ? ' active ' : ''; ?>">
131 <?php
132 // Single Item.
133 ?>
134 <a href="<?php echo esc_url( $menu_item_arr['url'] ); ?>"
135 class="wpbc_ui_el__horis_nav_item__a wpbc_ui_el__horis_nav_item__single">
136 <?php if ( ! empty( $menu_item_arr['font_icon'] ) ) { ?>
137 <i class="wpbc_ui_el__horis_nav_icon tooltip_top menu_icon icon-1x <?php echo esc_attr( $menu_item_arr['font_icon'] ); ?>"
138 data-original-title="<?php echo esc_attr( $menu_item_arr['title'] ); ?>"></i>
139 <?php } ?>
140 <span class="wpbc_ui_el__horis_nav_title"><?php echo wp_kses_post( $menu_item_arr['title'] ); ?></span>
141 </a>
142 </div>
143 <?php
144 }
145