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.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / dashboard / components / sidebar-nav-mobile.php
tutor / templates / dashboard / components Last commit date
header.php 5 days ago profile-completion.php 5 days ago quiz-attempt-row.php 5 days ago sidebar-nav-mobile.php 5 days ago sidebar.php 5 days ago
sidebar-nav-mobile.php
162 lines
1 <?php
2 /**
3 * Tutor dashboard nav mobile.
4 *
5 * @package Tutor\Templates
6 * @author Themeum <support@themeum.com>
7 * @link https://www.themeum.com/
8 * @since 4.0.0
9 */
10
11 defined( 'ABSPATH' ) || exit;
12
13 use Tutor\Components\Avatar;
14 use Tutor\Components\Constants\Size;
15 use TUTOR\Icon;
16 use Tutor\Components\SvgIcon;
17 use TUTOR\Dashboard;
18
19 if ( ! tutor_utils()->count( $dashboard_pages ) ) {
20 return;
21 }
22
23 $active_nav = '';
24 $visible_nav_items = array_slice( $dashboard_pages, 0, 2, true );
25 $more_nav_items = array_slice( $dashboard_pages, 2, null, true );
26
27 // Insert the Explore link after the first visible navigation item.
28 $explore_nav_item = array(
29 'title' => __( 'Explore', 'tutor' ),
30 'icon' => Icon::EXPLORE,
31 'url' => tutor_utils()->course_archive_page_url(),
32 );
33
34 $visible_nav_items = array_slice( $visible_nav_items, 0, 1, true ) +
35 array( 'explore' => $explore_nav_item ) +
36 array_slice( $visible_nav_items, 1, null, true );
37
38 ?>
39 <div class="tutor-dashboard-nav-mobile" role="navigation">
40 <ul class="tutor-dashboard-nav-mobile-list">
41 <?php
42 foreach ( $visible_nav_items as $key => $item ) {
43 if ( 'index' === $key ) {
44 $key = '';
45 }
46
47 $menu_title = $item;
48 $menu_link = tutor_utils()->get_tutor_dashboard_page_permalink( $key );
49
50 if ( is_array( $item ) ) {
51 $menu_title = tutor_utils()->array_get( 'title', $item );
52 $menu_icon_name = tutor_utils()->array_get( 'icon', $item, ( isset( $item['icon'] ) ? $item['icon'] : '' ) );
53 $active_icon_name = tutor_utils()->array_get( 'active_icon', $item, ( isset( $item['active_icon'] ) ? $item['active_icon'] : $menu_icon_name ) );
54
55 // Add new menu item property "url" for custom link.
56 if ( isset( $item['url'] ) ) {
57 $menu_link = $item['url'];
58 }
59 }
60
61 $is_active_menu = $key === $dashboard_page_slug;
62 $active_class = $is_active_menu ? 'active' : '';
63 $menu_link = apply_filters( 'tutor_dashboard_menu_link', $menu_link, $menu_title );
64 ?>
65 <li>
66 <a class="<?php echo esc_attr( $active_class ); ?>" href="<?php echo esc_url( $menu_link ?? '#' ); ?>">
67 <span class="tutor-dashboard-nav-mobile-icon">
68 <?php
69 SvgIcon::make()
70 ->name( ( $is_active_menu && ! tutor_utils()->is_kids_mode() ) ? $active_icon_name : $menu_icon_name )
71 ->size( Size::SIZE_20 )
72 ->render();
73 ?>
74 </span>
75 <span class="tutor-tiny tutor-dashboard-nav-mobile-text"><?php echo esc_html( $menu_title ); ?></span>
76 </a>
77 </li>
78 <?php
79 }
80 ?>
81 <li>
82 <a href="<?php echo esc_url( Dashboard::get_account_page_url( 'profile' ) ); ?>">
83 <div class="tutor-dashboard-nav-mobile-icon">
84 <?php
85 Avatar::make()
86 ->user( get_current_user_id() )
87 ->size( Size::SIZE_20 )
88 ->render();
89 ?>
90 </div>
91 <span class="tutor-tiny tutor-dashboard-nav-mobile-text"><?php esc_html_e( 'Profile', 'tutor' ); ?></span>
92 </a>
93 </li>
94 <?php
95 if ( tutor_utils()->count( $more_nav_items ) ) :
96 ?>
97 <li x-data="tutorPopover({ placement: 'top-end', offset: 16 })">
98 <button
99 type="button"
100 x-ref="trigger"
101 @click="toggle()"
102 :aria-expanded="open ? 'true' : 'false'"
103 aria-haspopup="true"
104 >
105 <span class="tutor-dashboard-nav-mobile-icon">
106 <?php SvgIcon::make()->name( Icon::ELLIPSES )->size( 20 )->render(); ?>
107 </span>
108 <span class="tutor-tiny tutor-dashboard-nav-mobile-text"><?php esc_html_e( 'More', 'tutor' ); ?></span>
109 </button>
110 <!-- Popover panel -->
111 <div
112 x-ref="content"
113 x-show="open"
114 x-cloak
115 @click.outside="handleClickOutside()"
116 class="tutor-popover tutor-dashboard-nav-mobile-more-popover"
117 role="menu"
118 aria-label="<?php echo esc_attr( $item['title'] ); ?>"
119 x-transition.origin.bottom.right
120 >
121 <ul>
122 <?php
123 foreach ( $more_nav_items as $key => $item ) {
124 $menu_title = $item;
125 $menu_link = tutor_utils()->get_tutor_dashboard_page_permalink( $key );
126
127 if ( is_array( $item ) ) {
128 $menu_title = tutor_utils()->array_get( 'title', $item );
129 $menu_icon_name = tutor_utils()->array_get( 'icon', $item, ( isset( $item['icon'] ) ? $item['icon'] : '' ) );
130 $active_icon_name = tutor_utils()->array_get( 'active_icon', $item, ( isset( $item['active_icon'] ) ? $item['active_icon'] : $menu_icon_name ) );
131
132 // Add new menu item property "url" for custom link.
133 if ( isset( $item['url'] ) ) {
134 $menu_link = $item['url'];
135 }
136 }
137
138 $is_active_menu = $key === $dashboard_page_slug;
139 $active_class = $is_active_menu ? 'active' : '';
140 $menu_link = apply_filters( 'tutor_dashboard_menu_link', $menu_link, $menu_title );
141 ?>
142 <li role="none">
143 <a role="menuitem" class="<?php echo esc_attr( $active_class ); ?>" href="<?php echo esc_url( $menu_link ?? '#' ); ?>" @click="open = false">
144 <?php
145 SvgIcon::make()
146 ->name( ( $is_active_menu && ! tutor_utils()->is_kids_mode() ) ? $active_icon_name : $menu_icon_name )
147 ->size( tutor_utils()->is_kids_mode() ? Size::SIZE_24 : Size::SIZE_20 )
148 ->render();
149 ?>
150 <span class="tutor-tiny"><?php echo esc_html( $menu_title ); ?></span>
151 </a>
152 </li>
153 <?php
154 }
155 ?>
156 </nav>
157 </div>
158 </li>
159 <?php endif ?>
160 </ul>
161 </div>
162