| 1 |
<?php if (!defined('ABSPATH')) exit; // Exit if accessed directly ?> |
| 2 |
<?php |
| 3 |
/** |
| 4 |
* @var $primaryItems array |
| 5 |
* @var $settingsItems array |
| 6 |
* @var $spaceGroups array |
| 7 |
* @var $topInlineLinks array |
| 8 |
* @var $bottomLinkGroups array |
| 9 |
* @var $is_admin bool |
| 10 |
* @var $has_color_scheme bool |
| 11 |
* @var $context string |
| 12 |
*/ |
| 13 |
|
| 14 |
use FluentCommunity\App\Services\Helper; |
| 15 |
use FluentCommunity\Framework\Support\Arr; |
| 16 |
|
| 17 |
$showFeedLink = \FluentCommunity\App\Functions\Utility::isCustomizationEnabled('feed_link_on_sidebar'); |
| 18 |
|
| 19 |
?> |
| 20 |
|
| 21 |
<div id="fcom_sidebar_wrap" class="fcom_sidebar_wrap"> |
| 22 |
<?php if (apply_filters('fluent_community/will_render_default_sidebar_items', true)) : ?> |
| 23 |
<nav aria-label="Main Sidebar Home menu"> |
| 24 |
<ul class="fcom_sm_only fcom_general_menu fcom_home_link"> |
| 25 |
<?php foreach ($primaryItems as $itemKey => $item): ?> |
| 26 |
<li class="<?php echo esc_attr('fcom_menu_item_' . $itemKey); ?>"> |
| 27 |
<?php Helper::renderLink($item, 'fcom_menu_link'); ?> |
| 28 |
</li> |
| 29 |
<?php endforeach; ?> |
| 30 |
</ul> |
| 31 |
</nav> |
| 32 |
<?php if($showFeedLink || $topInlineLinks): ?> |
| 33 |
<nav aria-label="Main Sidebar Mobile Menu"> |
| 34 |
<ul class="fcom_general_menu"> |
| 35 |
<?php if ($showFeedLink): ?> |
| 36 |
<li class="fcom_menu_item_all_feeds fcom_desktop_only"> |
| 37 |
<a class="fcom_menu_link fcom_dashboard route_url" |
| 38 |
href="<?php echo esc_url(Helper::baseUrl('/')); ?>"> |
| 39 |
<div class="community_avatar"> |
| 40 |
<span class="fcom_shape"> |
| 41 |
<i class="el-icon"> |
| 42 |
<svg width="20" height="18" viewBox="0 0 20 18" fill="none"><path fill-rule="evenodd" |
| 43 |
d="M10 13.166H10.0075H10Z" |
| 44 |
fill="currentColor"/><path |
| 45 |
d="M10 13.166H10.0075" stroke="currentColor" stroke-width="2" |
| 46 |
stroke-linecap="round" |
| 47 |
stroke-linejoin="round"/><path |
| 48 |
d="M16.6666 6.08301V10.2497C16.6666 13.3924 16.6666 14.9637 15.6903 15.94C14.714 16.9163 13.1426 16.9163 9.99992 16.9163C6.85722 16.9163 5.28587 16.9163 4.30956 15.94C3.33325 14.9637 3.33325 13.3924 3.33325 10.2497V6.08301" |
| 49 |
stroke="currentColor" stroke-width="1.5"/><path |
| 50 |
d="M18.3333 7.74967L14.714 4.27925C12.4918 2.14842 11.3807 1.08301 9.99996 1.08301C8.61925 1.08301 7.50814 2.14842 5.28592 4.27924L1.66663 7.74967" |
| 51 |
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/> |
| 52 |
</svg> |
| 53 |
</i> |
| 54 |
</span> |
| 55 |
</div> |
| 56 |
<span class="community_name"><?php esc_html_e('Feed', 'fluent-community'); ?></span> |
| 57 |
</a> |
| 58 |
</li> |
| 59 |
<?php endif; ?> |
| 60 |
<?php foreach ($topInlineLinks as $itemKey => $topInline): ?> |
| 61 |
<li class="<?php echo esc_attr('fcom_menu_item_' . $itemKey); ?>"> |
| 62 |
<?php Helper::renderLink($topInline, 'fcom_menu_link'); ?> |
| 63 |
</li> |
| 64 |
<?php endforeach; ?> |
| 65 |
</ul> |
| 66 |
</nav> |
| 67 |
<?php endif; ?> |
| 68 |
|
| 69 |
<div class="fcom_sidebar_contents"> |
| 70 |
<?php foreach ($spaceGroups as $spaceGroup): ?> |
| 71 |
<div class="fcom_communities_menu"> |
| 72 |
<div class="fcom_space_group_header fcom_group_title"> |
| 73 |
<h4 data-group_id="<?php echo (int)$spaceGroup['id']; ?>" class="space_section_title"> |
| 74 |
<span><?php echo esc_html($spaceGroup['title']); ?></span> |
| 75 |
<i class="el-icon fcom_space_down"> |
| 76 |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" data-v-d2e47025=""> |
| 77 |
<path fill="currentColor" |
| 78 |
d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path> |
| 79 |
</svg> |
| 80 |
</i> |
| 81 |
</h4> |
| 82 |
<?php if ($is_admin): ?> |
| 83 |
<div class="fcom_space_create"> |
| 84 |
<a class="fcom_space_create_link" data-parent_id="<?php echo (int)$spaceGroup['id']; ?>" href="<?php echo esc_url(Helper::baseUrl('discover/spaces/?create_space=yes&parent_id=' . $spaceGroup['id'])); ?>">+</a> |
| 85 |
</div> |
| 86 |
<?php endif; ?> |
| 87 |
</div> |
| 88 |
<nav aria-label="Group Menu for <?php echo esc_html($spaceGroup['title']); ?>"> |
| 89 |
<ul> |
| 90 |
<?php foreach ($spaceGroup['children'] as $link): ?> |
| 91 |
<li class="space_menu_item"> |
| 92 |
<?php Helper::renderLink($link, 'fcom_menu_link'); ?> |
| 93 |
</li> |
| 94 |
<?php endforeach; ?> |
| 95 |
</ul> |
| 96 |
</nav> |
| 97 |
</div> |
| 98 |
<?php endforeach; ?> |
| 99 |
|
| 100 |
<?php if ($bottomLinkGroups): ?> |
| 101 |
<?php foreach ($bottomLinkGroups as $bottomLinkGroup): ?> |
| 102 |
<div class="fcom_communities_menu"> |
| 103 |
<div class="fcom_space_group_header fcom_group_title"> |
| 104 |
<h4 role="region" aria-label="Link Groups" data-group_id="<?php echo esc_attr($bottomLinkGroup['slug']); ?>" |
| 105 |
class="space_section_title"> |
| 106 |
<span><?php echo esc_html($bottomLinkGroup['title']); ?></span> |
| 107 |
<i class="el-icon fcom_space_down"> |
| 108 |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" data-v-d2e47025=""> |
| 109 |
<path fill="currentColor" |
| 110 |
d="M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"></path> |
| 111 |
</svg> |
| 112 |
</i> |
| 113 |
</h4> |
| 114 |
<?php if ($is_admin): ?> |
| 115 |
<div class="fcom_space_create"> |
| 116 |
<a href="<?php echo esc_url(Helper::baseUrl('admin/settings/menu-settings')); ?>"> |
| 117 |
+ |
| 118 |
</a> |
| 119 |
</div> |
| 120 |
<?php endif; ?> |
| 121 |
</div> |
| 122 |
<nav aria-label="Group Menu for <?php echo esc_html($bottomLinkGroup['title']); ?>"> |
| 123 |
<ul> |
| 124 |
<?php foreach ($bottomLinkGroup['items'] as $buttomLink): ?> |
| 125 |
<li class="space_menu_item"> |
| 126 |
<?php Helper::renderLink($buttomLink, 'fcom_menu_link space_menu_item route_url', '🔗'); ?> |
| 127 |
</li> |
| 128 |
<?php endforeach; ?> |
| 129 |
</ul> |
| 130 |
</nav> |
| 131 |
</div> |
| 132 |
<?php endforeach; ?> |
| 133 |
<?php endif; ?> |
| 134 |
|
| 135 |
|
| 136 |
<?php if ($settingsItems): ?> |
| 137 |
<div style="margin-top: 20px;"> |
| 138 |
<h4 class="space_section_title"><?php esc_html_e('# Manage', 'fluent-community'); ?></h4> |
| 139 |
<ul style="margin-top: 20px;"> |
| 140 |
<?php foreach ($settingsItems as $itemKey => $item): ?> |
| 141 |
<li class="<?php echo esc_attr('fcom_menu_item_' . $itemKey); ?>"> |
| 142 |
<a class="fcom_menu_link <?php echo esc_attr(Arr::get($item, 'link_classes')); ?>" |
| 143 |
href="<?php echo esc_url($item['permalink']); ?>"> |
| 144 |
<?php if (!empty($item['icon_svg'])): ?> |
| 145 |
<i class="el-icon"> |
| 146 |
<?php echo \FluentCommunity\App\Services\CustomSanitizer::sanitizeSvg(Arr::get($item, 'el-icon', '')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 147 |
</i> |
| 148 |
<?php endif; ?> |
| 149 |
<span class="community_name"><?php echo wp_kses_post($item['title']); ?></span> |
| 150 |
</a> |
| 151 |
</li> |
| 152 |
<?php endforeach; ?> |
| 153 |
</ul> |
| 154 |
</div> |
| 155 |
<?php endif; ?> |
| 156 |
</div> |
| 157 |
<?php endif; ?> |
| 158 |
</div> |
| 159 |
|
| 160 |
|
| 161 |
<?php if ($context != 'ajax'): ?> |
| 162 |
<?php do_action('fluent_community/after_sidebar_wrap', $context); ?> |
| 163 |
<div id="fcom_menu_sidebar"></div> |
| 164 |
<?php do_action('fluent_community/after_portal_sidebar', $context); ?> |
| 165 |
<?php endif; ?> |
| 166 |
|