announcements
4 years ago
assignments
4 years ago
earning
4 years ago
enrolled-courses
4 years ago
instructor
4 years ago
my-quiz-attempts
4 years ago
notifications
4 years ago
question-answer
4 years ago
quiz-attempts
4 years ago
reviews
4 years ago
settings
4 years ago
withdraw-method-fields
4 years ago
announcements.php
4 years ago
assignments.php
4 years ago
create-course.php
4 years ago
dashboard-menu.php
4 years ago
dashboard.php
4 years ago
earning.php
4 years ago
enrolled-courses.php
4 years ago
index.php
4 years ago
logged-in.php
5 years ago
my-courses.php
4 years ago
my-profile.php
4 years ago
my-quiz-attempts.php
4 years ago
purchase_history.php
4 years ago
question-answer.php
4 years ago
quiz-attempts.php
4 years ago
registration.php
4 years ago
reviews.php
4 years ago
settings.php
4 years ago
wishlist.php
4 years ago
withdraw.php
4 years ago
dashboard-menu.php
132 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Markup for Dashboard Menu |
| 4 | * |
| 5 | * @since 2.0.0 |
| 6 | */ |
| 7 | if ( class_exists( '\TUTOR\Utils' ) && is_user_logged_in() ) : ?> |
| 8 | <style> |
| 9 | .wp-site-blocks .tutor-header-profile-menu { |
| 10 | position: relative; |
| 11 | cursor: pointer; |
| 12 | } |
| 13 | |
| 14 | .wp-site-blocks |
| 15 | .tutor-header-profile-menu |
| 16 | .tutor-header-profile-photo |
| 17 | span.tutor-text-avatar { |
| 18 | display: inline-block; |
| 19 | text-align: center; |
| 20 | line-height: 30px; |
| 21 | height: 30px; |
| 22 | width: 30px; |
| 23 | border-radius: 50%; |
| 24 | } |
| 25 | |
| 26 | .wp-site-blocks |
| 27 | .tutor-header-profile-menu |
| 28 | .tutor-header-profile-photo |
| 29 | img.tutor-image-avatar { |
| 30 | display: flex; |
| 31 | text-align: center; |
| 32 | line-height: 30px; |
| 33 | height: 30px; |
| 34 | width: 30px; |
| 35 | border-radius: 100%; |
| 36 | } |
| 37 | |
| 38 | .wp-site-blocks .tutor-header-profile-menu:hover ul { |
| 39 | opacity: 1; |
| 40 | visibility: visible; |
| 41 | } |
| 42 | |
| 43 | .wp-site-blocks .tutor-header-profile-menu ul { |
| 44 | position: absolute; |
| 45 | z-index: 999; |
| 46 | background: #fff; |
| 47 | padding: 10px 0; |
| 48 | list-style: none; |
| 49 | width: 200px; |
| 50 | right: 0; |
| 51 | top: 49px; |
| 52 | border-radius: 3px; |
| 53 | opacity: 0; |
| 54 | visibility: hidden; |
| 55 | transition: 300ms; |
| 56 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); |
| 57 | max-height: 510px; |
| 58 | overflow-x: hidden; |
| 59 | overflow-y: scroll; |
| 60 | } |
| 61 | |
| 62 | .wp-site-blocks .tutor-header-profile-menu ul li { |
| 63 | display: block; |
| 64 | } |
| 65 | |
| 66 | .wp-site-blocks .tutor-header-profile-menu ul li a { |
| 67 | display: block; |
| 68 | width: 100%; |
| 69 | padding: 5px 25px; |
| 70 | color: #1f2949; |
| 71 | transition: 300ms; |
| 72 | font-size: 14px; |
| 73 | } |
| 74 | |
| 75 | .wp-site-blocks .tutor-header-profile-menu ul:before { |
| 76 | content: ""; |
| 77 | bottom: 100%; |
| 78 | height: 20px; |
| 79 | width: 100%; |
| 80 | z-index: 2; |
| 81 | left: 0; |
| 82 | position: absolute; |
| 83 | } |
| 84 | </style> |
| 85 | <div class="tutor-header-profile-menu"> |
| 86 | <div class="tutor-header-profile-photo"> |
| 87 | <?php |
| 88 | if ( function_exists( 'tutor_utils' ) ){ |
| 89 | echo tutor_utils()->get_tutor_avatar( get_current_user_id(), 'thumbnail' ); |
| 90 | } else { |
| 91 | $get_avatar_url = get_avatar_url( get_current_user_id(), 'thumbnail' ); |
| 92 | echo "<img alt='' src='$get_avatar_url' />"; |
| 93 | } |
| 94 | ?> |
| 95 | </div><!-- .tutor-header-profile-photo --> |
| 96 | <ul> |
| 97 | <?php |
| 98 | if ( function_exists( 'tutor_utils' ) ) { |
| 99 | $dashboard_page_id = tutor_utils()->get_option( 'tutor_dashboard_page_id' ); |
| 100 | $dashboard_pages = tutor_utils()->tutor_dashboard_nav_ui_items(); |
| 101 | |
| 102 | foreach ( $dashboard_pages as $dashboard_key => $dashboard_page ) { |
| 103 | $menu_title = $dashboard_page; |
| 104 | $menu_link = tutils()->get_tutor_dashboard_page_permalink( $dashboard_key ); |
| 105 | $separator = false; |
| 106 | if ( is_array( $dashboard_page ) ) { |
| 107 | $menu_title = tutor_utils()->array_get( 'title', $dashboard_page ); |
| 108 | /** |
| 109 | * Add new menu item property "url" for custom link |
| 110 | */ |
| 111 | if ( isset( $dashboard_page['url'] ) ) { |
| 112 | $menu_link = $dashboard_page['url']; |
| 113 | } |
| 114 | if ( isset( $dashboard_page['type'] ) && $dashboard_page['type'] === 'separator' ) { |
| 115 | $separator = true; |
| 116 | } |
| 117 | } |
| 118 | if ( $separator ) { |
| 119 | echo '<li class="tutor-dashboard-menu-divider"></li>'; |
| 120 | if ( $menu_title ) { |
| 121 | echo "<li class='tutor-dashboard-menu-divider-header'>$menu_title</li>"; |
| 122 | } |
| 123 | } else { |
| 124 | if ( $dashboard_key === 'index') $dashboard_key = ''; |
| 125 | echo "<li><a href='" . esc_url( $menu_link ) . "'>" . esc_html( $menu_title ) . " </a></li>"; |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | ?> |
| 130 | </ul> |
| 131 | </div><!-- .tutor-header-profile-menu --> |
| 132 | <?php endif; ?> |