| | |
| | | <?php |
| | | |
| | | use JVBase\managers\Cache; |
| | | use JVBase\meta\Form; |
| | | use JVBase\base\Site; |
| | | use JVBase\utility\Image; |
| | |
| | | </a> |
| | | </li> |
| | | <li class="notifications has-submenu"> |
| | | <button class="toggle notifications" type="button" title="Toggle Notifications" aria-expanded="false" aria-controls="notifications-dropdown"> |
| | | <button class="toggle notifications" type="button" data-action="toggle-submenu" title="Toggle Notifications" aria-expanded="false" aria-controls="notifications-dropdown"> |
| | | <?= jvbIcon('bell', ['title'=> 'No Notifications'])?> |
| | | <?= jvbIcon('bell-ringing', ['title'=> 'New Notifications']) ?> |
| | | <span class="notification-badge" aria-label="Notifications"> |
| | | </span> |
| | | </button> |
| | | <ul class="notifications-preview submenu"> |
| | | <ul class="notifications-preview submenu" id="notifications-dropdown"> |
| | | <li id="view-all"><a href="<?=get_home_url(null, '/dash/notifications/')?>" class="view-all">View All Notifications</a></li> |
| | | </ul> |
| | | <template class="notificationItem"> |
| | |
| | | */ |
| | | function jvbHelpMenu():string |
| | | { |
| | | if (!Site::has('helpMenu')) { |
| | | if (!Site::has('help_menu')) { |
| | | return ''; |
| | | } |
| | | $out = get_option(BASE.'help_menu'); |
| | | |
| | | if ($out === false) { |
| | | $open = '<li><a href="'; |
| | | $mid = '">'; |
| | | $close = '</a></li>'; |
| | | $cache = Cache::for('help_menu'); |
| | | $out = $cache->remember( |
| | | 'help_menu', |
| | | function () { |
| | | $open = '<li><a href="'; |
| | | $mid = '">'; |
| | | $close = '</a></li>'; |
| | | |
| | | $titles = array( |
| | | 'About', |
| | | 'Contact', |
| | | 'Request a Feature', |
| | | 'Technical Issue', |
| | | ); |
| | | $links = ''; |
| | | foreach ($titles as $t) { |
| | | $page = new WP_Query(array( |
| | | 'post_type' => 'page', |
| | | 'title' => $t, |
| | | 'fields' => 'ids' |
| | | )); |
| | | if ($page->have_posts()) { |
| | | $end = ($t == 'About') ? '<li><a href="'.get_home_url(null, '/directory/partners/').'" title="View our Partners">Partners</a></li>' : ''; |
| | | $links .= $open.get_the_permalink($page->posts[0]).'" title="'.$t.$mid.$t.$close.$end; |
| | | } |
| | | wp_reset_postdata(); |
| | | } |
| | | $titles = array( |
| | | 'About', |
| | | 'Contact', |
| | | 'Request a Feature', |
| | | 'Technical Issue', |
| | | ); |
| | | $links = ''; |
| | | foreach ($titles as $t) { |
| | | $page = new WP_Query(array( |
| | | 'post_type' => 'page', |
| | | 'title' => $t, |
| | | 'fields' => 'ids' |
| | | )); |
| | | if ($page->have_posts()) { |
| | | $end = ($t == 'About') ? '<li><a href="'.get_home_url(null, '/directory/partners/').'" title="View our Partners">Partners</a></li>' : ''; |
| | | $links .= $open.get_the_permalink($page->posts[0]).'" title="'.$t.$mid.$t.$close.$end; |
| | | } |
| | | wp_reset_postdata(); |
| | | } |
| | | |
| | | $out = '<li class="has-submenu"> |
| | | <button class="toggle quick-help" type="button" title="Toggle Quick Help Menu" aria-expanded="false" aria-controls="quick-help" aria-label="Toggle Quick Help Menu">'.jvbIcon('question', ['title'=> 'Quick Help']).'</button> |
| | | <ul class="submenu"> |
| | | return '<li class="has-submenu"> |
| | | <button class="toggle quick-help" data-action="toggle-submenu" type="button" title="Toggle Quick Help Menu" aria-expanded="false" aria-controls="quick-help" aria-label="Toggle Quick Help Menu">'.jvbIcon('question', ['title'=> 'Quick Help']).'</button> |
| | | <ul class="submenu" id="quick-help"> |
| | | '.$links.' |
| | | </ul> |
| | | </li>'; |
| | | |
| | | update_option(BASE.'help_menu', $out); |
| | | } |
| | | } |
| | | ); |
| | | |
| | | if (is_user_logged_in()) { |
| | | $out .= '<li><a href="'.wp_logout_url(get_home_url()).'" title="Logout">'.jvbIcon('sign-out').'<span class="screen-reader-text">Logout</span></a></li>'; |