PluginProbe
Booking Calendar / 11.3
Booking Calendar v11.3
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 11.3, at includes/ui_settings/parts/ui__nav_horis.php

144 lines 5.7 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-availability' => __( 'Availability', 'booking' ),
44 'wpbc-prices' => __( 'Prices', 'booking' ),
45 'wpbc-resources' => __( 'Resources', 'booking' ),
46 'wpbc-settings' => __( 'Settings', 'booking' ),
47 'wpbc-setup' => __( 'Setup', 'booking' ),
48 );
49
50
51 // Ability to click on panel, only if there 'min' class - panel minimized!
52 echo '<div class="wpbc_ui_el__horis_top_bar__wrapper">';
53
54 echo ' <div class="wpbc_ui_el__horis_top_bar__content">';
55
56 $main_page_slug = $active_page_arr['active_page'];
57 $page_title = $show_these_pages_arr[ $main_page_slug ];
58
59 // Loop to show all main sections in horisontal menu.
60 foreach ( $show_these_pages_arr as $main_page_slug => $page_title ) {
61
62 // Show only active page settings list.
63 if ( $main_page_slug !== $active_page_arr['active_page'] ) {
64 continue;
65 }
66 $page_item_arr = $args['page_nav_tabs'][ $main_page_slug ];
67
68 do_action( 'hook__wpbc_ui__top_horisontal_nav__start', $active_page_arr['active_page'], $active_page_arr['active_tab'] ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
69
70 foreach ( $page_item_arr as $main_menu_slug => $menu_item_arr ) {
71 do_action( 'hook__wpbc_ui__top_horisontal_nav__item_start', $active_page_arr['active_page'], $active_page_arr['active_tab'], $main_menu_slug ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
72
73 wpbc_ui__horis_menu__item_main( $main_menu_slug, $menu_item_arr );
74
75 do_action( 'hook__wpbc_ui__top_horisontal_nav__item_end', $active_page_arr['active_page'], $active_page_arr['active_tab'], $main_menu_slug ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
76 }
77 do_action( 'hook__wpbc_ui__top_horisontal_nav__end', $active_page_arr['active_page'], $active_page_arr['active_tab'] ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
78
79 // wpbc_ui_el__divider_vertical();
80 } // Loop to show all main sections in horisontal menu.
81 echo ' </div><!-- wpbc_ui_el__horis_top_bar__content -->';
82
83 echo '</div><!-- wpbc_ui_el__horis_top_bar__wrapper -->';
84 }
85
86
87 /**
88 * Show Horisontal - "Menu Item".
89 *
90 * @param string $menu_slug - 'calendar_appearance'.
91 * @param array $menu_item_arr - [ [title] => Skin
92 * [page_title] => Calendar General Settings 3
93 * [hint] => Calendar General Settings 2
94 * [link] =>
95 * [position] =>
96 * [css_classes] =>
97 * [icon] =>
98 * [font_icon] => wpbc-bi-calendar2-range
99 * [default] =>
100 * [disabled] =>
101 * [hided] =>
102 * [is_active] => 1
103 * [url] => http://beta/wp-admin/admin.php?page=wpbc-settings&#038;tab=calendar_appearance
104 * [subtabs] => [....]
105 * ]
106 *
107 * @return void
108 */
109 function wpbc_ui__horis_menu__item_main( $menu_slug, $menu_item_arr ) {
110
111 $defaults = array(
112 'title' => '',
113 'page_title' => '',
114 'hint' => '',
115 'link' => '',
116 'position' => '',
117 'css_classes' => '',
118 'icon' => '',
119 'font_icon' => '',
120 'default' => false,
121 'disabled' => false,
122 'hided' => false,
123 'is_active' => 0,
124 'url' => '',
125 'subtabs' => array(),
126 );
127 $menu_item_arr = wp_parse_args( $menu_item_arr, $defaults );
128
129 ?><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 ' : ''; ?>">
130 <?php
131 // Single Item.
132 ?>
133 <a href="<?php echo esc_url( $menu_item_arr['url'] ); ?>"
134 class="wpbc_ui_el__horis_nav_item__a wpbc_ui_el__horis_nav_item__single">
135 <?php if ( ! empty( $menu_item_arr['font_icon'] ) ) { ?>
136 <i class="wpbc_ui_el__horis_nav_icon tooltip_top menu_icon icon-1x <?php echo esc_attr( $menu_item_arr['font_icon'] ); ?>"
137 data-original-title="<?php echo esc_attr( $menu_item_arr['title'] ); ?>"></i>
138 <?php } ?>
139 <span class="wpbc_ui_el__horis_nav_title"><?php echo wp_kses_post( $menu_item_arr['title'] ); ?></span>
140 </a>
141 </div>
142 <?php
143 }
144