| @@ -1,17 +1,13 @@ | ||
| 1 | 1 | <?php if (!defined('ABSPATH')) exit; // Exit if accessed directly ?> |
| 2 | 2 | |
| 3 | 3 | <?php |
| 4 | - | |
| 5 | -use FluentCommunity\Framework\Support\Arr; | |
| 6 | - | |
| 7 | -$renderIcon = \FluentCommunity\App\Functions\Utility::isCustomizationEnabled('icon_on_header_menu'); | |
| 8 | - | |
| 9 | 4 | /** |
| 10 | 5 | * |
| 11 | 6 | * @var string $portal_url |
| 12 | 7 | * @var string $logo |
| 13 | 8 | * @var string $white_logo |
| 9 | + * @var string $logo_permalink | |
| 14 | 10 | * @var string $site_title |
| 15 | 11 | * @var string $profile_url |
| 16 | 12 | * @var array | null $auth |
| 17 | 13 | * @var string $auth_url |
| @@ -17,31 +13,20 @@ | ||
| 17 | 13 | * @var string $auth_url |
| 18 | 14 | * @var array $menuItems |
| 19 | 15 | * @var array $profileLinks |
| 20 | 16 | * @var bool $has_color_scheme |
| 17 | + * @var string $context | |
| 21 | 18 | **/ |
| 22 | 19 | ?> |
| 23 | 20 | <div class="fcom_top_menu"> |
| 24 | 21 | <div class="top_menu_left"> |
| 25 | 22 | <div class="space_opener"> |
| 26 | - <button aria-label="Open Menu" class="fcom_space_opener_btn" style="background-color: transparent; cursor: pointer; border: 0 solid transparent;color: #5d5e61;" aria-disabled="false" type="button"> | |
| 23 | + <button aria-label="<?php echo esc_attr__('Open Menu', 'fluent-community'); ?>" class="fcom_space_opener_btn" aria-disabled="false" aria-expanded="false" type="button"> | |
| 27 | 24 | <span> |
| 28 | 25 | <i class="el-icon"> |
| 29 | - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="48" height="48" | |
| 30 | - color="currentColor" fill="none"> | |
| 31 | - <path fill-rule="evenodd" clip-rule="evenodd" | |
| 32 | - d="M3 4.5C3 3.94772 3.44772 3.5 4 3.5L20 3.5C20.5523 3.5 21 3.94772 21 4.5C21 5.05229 20.5523 5.5 20 5.5L4 5.5C3.44772 5.5 3 5.05228 3 4.5Z" | |
| 33 | - fill="currentColor"/> | |
| 34 | - <path fill-rule="evenodd" clip-rule="evenodd" | |
| 35 | - d="M3 14.5C3 13.9477 3.44772 13.5 4 13.5L20 13.5C20.5523 13.5 21 13.9477 21 14.5C21 15.0523 20.5523 15.5 20 15.5L4 15.5C3.44772 15.5 3 15.0523 3 14.5Z" | |
| 36 | - fill="currentColor"/> | |
| 37 | - <path fill-rule="evenodd" clip-rule="evenodd" | |
| 38 | - d="M3 9.5C3 8.94772 3.44772 8.5 4 8.5L20 8.5C20.5523 8.5 21 8.94772 21 9.5C21 10.0523 20.5523 10.5 20 10.5L4 10.5C3.44772 10.5 3 10.0523 3 9.5Z" | |
| 39 | - fill="currentColor"/> | |
| 40 | - <path fill-rule="evenodd" clip-rule="evenodd" | |
| 41 | - d="M3 19.5C3 18.9477 3.44772 18.5 4 18.5L20 18.5C20.5523 18.5 21 18.9477 21 19.5C21 20.0523 20.5523 20.5 20 20.5L4 20.5C3.44772 20.5 3 20.0523 3 19.5Z" | |
| 42 | - fill="currentColor"/> | |
| 43 | - </svg> | |
| 26 | + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="20" height="20" fill="currentColor"> | |
| 27 | + <path d="M1 2.75A.75.75 0 0 1 1.75 2h12.5a.75.75 0 0 1 0 1.5H1.75A.75.75 0 0 1 1 2.75Zm0 5A.75.75 0 0 1 1.75 7h12.5a.75.75 0 0 1 0 1.5H1.75A.75.75 0 0 1 1 7.75ZM1 12.75a.75.75 0 0 1 .75-.75h12.5a.75.75 0 0 1 0 1.5H1.75a.75.75 0 0 1-.75-.75Z"/> | |
| 28 | + </svg> | |
| 44 | 29 | </i> |
| 45 | 30 | </span> |
| 46 | 31 | </button> |
| 47 | 32 | </div> |
| @@ -47,9 +32,9 @@ | ||
| 47 | 32 | </div> |
| 48 | 33 | <div id="fcom_before_logo"></div> |
| 49 | 34 | <?php do_action('fluent_community/before_header_logo', $auth); ?> |
| 50 | 35 | <div class="fhr_logo"> |
| 51 | - <a class="fcom_route" href="<?php echo esc_url(\FluentCommunity\App\Services\Helper::baseUrl('/')); ?>"> | |
| 36 | + <a class="fcom_route" href="<?php echo esc_url($logo_permalink); ?>"> | |
| 52 | 37 | <?php if ($logo): ?> |
| 53 | 38 | <img class="show_on_light" src="<?php echo esc_url($logo); ?>" alt="<?php echo esc_attr($site_title); ?>"/> |
| 54 | 39 | <img class="show_on_dark" src="<?php echo esc_url($white_logo); ?>" alt="<?php echo esc_attr($site_title); ?>"/> |
| 55 | 40 | <?php else: ?> |
| @@ -61,19 +46,15 @@ | ||
| 61 | 46 | </div> |
| 62 | 47 | <div class="top_menu_center fcom_desktop_only fcom_general_menu"> |
| 63 | 48 | <?php if ($menuItems): ?> |
| 64 | 49 | <nav> |
| 65 | - <ul aria-label="Main menu" class="fcom_header_menu top_menu_items"> | |
| 66 | - <?php foreach ($menuItems as $itemKey => $item): ?> | |
| 67 | - <li class="<?php echo esc_attr('fcom_menu_item_' . $itemKey); ?>"> | |
| 68 | - <?php \FluentCommunity\App\Services\Helper::renderLink($item, 'fcom_menu_link', null, $renderIcon); ?> | |
| 69 | - </li> | |
| 70 | - <?php endforeach; ?> | |
| 50 | + <ul aria-label="<?php echo esc_attr__('Main menu', 'fluent-community'); ?>" class="fcom_header_menu top_menu_items"> | |
| 51 | + <?php \FluentCommunity\App\Services\Helper::renderMenuItems($menuItems, 'fcom_menu_link'); ?> | |
| 71 | 52 | </ul> |
| 72 | 53 | </nav> |
| 73 | 54 | <?php endif; ?> |
| 74 | - <?php do_action('fluent_community/after_header_menu'); ?> | |
| 55 | + <?php do_action('fluent_community/after_header_menu', $context); ?> | |
| 75 | 56 | </div> |
| 76 | 57 | <div class="top_menu_right"> |
| 77 | - <?php do_action('fluent_community/top_menu_right_items'); ?> | |
| 58 | + <?php do_action('fluent_community/top_menu_right_items', $context); ?> | |
| 78 | 59 | </div> |
| 79 | 60 | </div> |