PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 2.8.1
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v2.8.1
2.11.0 2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 All 78 releases
fluent-community / app / Views / portal / main_sidebar.php

main_sidebar.php in FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses 2.8.1, at app/Views/portal/main_sidebar.php

161 lines 10.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (!defined('ABSPATH')) { exit;} // Exit if accessed directly ?>
2 <?php
3 /**
4 * @var array $primaryItems
5 * @var array $settingsItems
6 * @var array $spaceGroups
7 * @var array $topInlineLinks
8 * @var array $bottomLinkGroups
9 * @var bool $is_admin
10 * @var bool $has_color_scheme
11 * @var string $context
12 */
13
14 use FluentCommunity\App\Services\Helper;
15 use FluentCommunity\Framework\Support\Arr;
16
17 $fluentCommunityPrimaryItems = $primaryItems ?? [];
18 $fluentCommunitySettingsItems = $settingsItems ?? [];
19 $fluentCommunitySpaceGroups = $spaceGroups ?? [];
20 $fluentCommunityTopInlineLinks = $topInlineLinks ?? [];
21 $fluentCommunityBottomLinkGroups = $bottomLinkGroups ?? [];
22 $fluentCommunityIsAdmin = $is_admin ?? false;
23 $fluentCommunityContext = $context ?? '';
24 $fluentCommunityFeedItem = $fluentCommunityPrimaryItems['all_feeds'] ?? [];
25 $fluentCommunityShowFeedLink = $fluentCommunityFeedItem && \FluentCommunity\App\Functions\Utility::isCustomizationEnabled('feed_link_on_sidebar');
26 $fluentCommunityCollapsedGroups = Helper::getCollapsedSidebarGroups(array_merge($fluentCommunitySpaceGroups, $fluentCommunityBottomLinkGroups));
27
28 ?>
29
30 <?php if ($fluentCommunityContext != 'ajax'): ?>
31 <?php do_action('fluent_community/before_sidebar_wrap', $fluentCommunityContext); ?>
32 <?php endif; ?>
33
34 <div id="fcom_sidebar_wrap" class="fcom_sidebar_wrap">
35 <?php if (apply_filters('fluent_community/will_render_default_sidebar_items', true)) : ?>
36 <nav aria-label="<?php echo esc_attr__('Main Sidebar Home menu', 'fluent-community'); ?>">
37 <ul class="fcom_sm_only fcom_general_menu fcom_home_link">
38 <?php Helper::renderMenuItems($fluentCommunityPrimaryItems, 'fcom_menu_link', '<span class="fcom_no_avatar"></span>', true); ?>
39 </ul>
40 </nav>
41 <?php if($fluentCommunityShowFeedLink || $fluentCommunityTopInlineLinks): ?>
42 <nav aria-label="<?php echo esc_attr__('Main Sidebar Mobile Menu', 'fluent-community'); ?>">
43 <ul class="fcom_general_menu">
44 <?php if ($fluentCommunityShowFeedLink): ?>
45 <li class="fcom_menu_item_all_feeds fcom_desktop_only">
46 <a class="fcom_menu_link <?php echo esc_attr(Arr::get($fluentCommunityFeedItem, 'link_classes', 'fcom_dashboard route_url')); ?>"
47 data-fcom-tip="<?php echo esc_attr(Arr::get($fluentCommunityFeedItem, 'title', __('Feed', 'fluent-community'))); ?>"
48 title="<?php echo esc_attr(Arr::get($fluentCommunityFeedItem, 'title', __('Feed', 'fluent-community'))); ?>"
49 href="<?php echo esc_url(Arr::get($fluentCommunityFeedItem, 'permalink', Helper::baseUrl('/'))); ?>">
50 <div class="community_avatar">
51 <span class="fcom_shape">
52 <i class="el-icon">
53 <?php Helper::printLinkIcon($fluentCommunityFeedItem); // prints directly with internal escaping ?>
54 </i>
55 </span>
56 </div>
57 <span class="community_name">
58 <?php echo esc_html(Arr::get($fluentCommunityFeedItem, 'title', __('Feed', 'fluent-community'))); ?>
59 </span>
60 </a>
61 </li>
62 <?php endif; ?>
63 <?php Helper::renderMenuItems($fluentCommunityTopInlineLinks, 'fcom_menu_link fcom_custom_link', '<span class="fcom_no_avatar"></span>', true); ?>
64 </ul>
65 </nav>
66 <?php endif; ?>
67
68 <div class="fcom_sidebar_contents">
69 <?php foreach ($fluentCommunitySpaceGroups as $fluentCommunitySpaceGroup): ?>
70 <?php if($fluentCommunitySpaceGroup['children']): ?>
71 <?php
72 $fluentCommunityGroupCollapsedClass = in_array(sanitize_key((string) $fluentCommunitySpaceGroup['id']), $fluentCommunityCollapsedGroups, true)
73 ? ' fcom_group_collapsed'
74 : '';
75 ?>
76 <div class="<?php echo esc_attr('fcom_communities_menu' . $fluentCommunityGroupCollapsedClass); ?>">
77 <div class="fcom_space_group_header fcom_group_title">
78 <h4 data-group_id="<?php echo (int)$fluentCommunitySpaceGroup['id']; ?>" data-fcom-tip="<?php echo esc_attr($fluentCommunitySpaceGroup['title']); ?>" title="<?php echo esc_attr($fluentCommunitySpaceGroup['title']); ?>" class="space_section_title" tabindex="0" role="button" aria-label="<?php echo esc_attr($fluentCommunitySpaceGroup['title']); ?>" aria-expanded="<?php echo $fluentCommunityGroupCollapsedClass ? 'false' : 'true'; ?>">
79 <span><?php echo esc_html($fluentCommunitySpaceGroup['title']); ?></span>
80 <i class="el-icon fcom_space_down">
81 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" 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></svg>
82 </i>
83 </h4>
84 <?php if ($fluentCommunityIsAdmin): ?>
85 <div class="fcom_space_create">
86 <a class="fcom_space_create_link" data-parent_id="<?php echo (int)$fluentCommunitySpaceGroup['id']; ?>" href="<?php echo esc_url(Helper::baseUrl('discover/spaces/?create_space=yes&parent_id=' . $fluentCommunitySpaceGroup['id'])); ?>">+</a>
87 </div>
88 <?php endif; ?>
89 </div>
90 <nav aria-label="Group Menu for <?php echo esc_html($fluentCommunitySpaceGroup['title']); ?>">
91 <ul>
92 <?php foreach ($fluentCommunitySpaceGroup['children'] as $fluentCommunityLink): ?>
93 <li class="space_menu_item">
94 <?php Helper::renderLink($fluentCommunityLink, 'fcom_menu_link'); ?>
95 </li>
96 <?php endforeach; ?>
97 </ul>
98 </nav>
99 </div>
100 <?php endif; ?>
101 <?php endforeach; ?>
102
103 <?php if ($fluentCommunityBottomLinkGroups): ?>
104 <?php foreach ($fluentCommunityBottomLinkGroups as $fluentCommunityBottomLink): ?>
105 <?php
106 $fluentCommunityBottomItems = isset($fluentCommunityBottomLink['items']) ? $fluentCommunityBottomLink['items'] : [];
107
108 $fluentCommunityBottomCollapsedClass = in_array(sanitize_key((string) $fluentCommunityBottomLink['slug']), $fluentCommunityCollapsedGroups, true)
109 ? ' fcom_group_collapsed'
110 : '';
111 ?>
112 <div class="<?php echo esc_attr('fcom_communities_menu' . $fluentCommunityBottomCollapsedClass); ?>">
113 <div class="fcom_space_group_header fcom_group_title">
114 <h4 role="button" tabindex="0" aria-expanded="<?php echo $fluentCommunityBottomCollapsedClass ? 'false' : 'true'; ?>" aria-label="<?php echo esc_attr($fluentCommunityBottomLink['title']); ?>" data-group_id="<?php echo esc_attr($fluentCommunityBottomLink['slug']); ?>" data-fcom-tip="<?php echo esc_attr($fluentCommunityBottomLink['title']); ?>" title="<?php echo esc_attr($fluentCommunityBottomLink['title']); ?>"
115 class="space_section_title">
116 <span><?php echo esc_html($fluentCommunityBottomLink['title']); ?></span>
117 <i class="el-icon fcom_space_down">
118 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" 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></svg>
119 </i>
120 </h4>
121 <?php if ($fluentCommunityIsAdmin): ?>
122 <div class="fcom_space_create">
123 <a href="<?php echo esc_url(Helper::baseUrl('admin/settings/menu-settings')); ?>">
124 +
125 </a>
126 </div>
127 <?php endif; ?>
128 </div>
129 <nav aria-label="Group Menu for <?php echo esc_html($fluentCommunityBottomLink['title']); ?>">
130 <ul>
131 <?php foreach ($fluentCommunityBottomLink['items'] as $fluentCommunityButtomLink): ?>
132 <li class="space_menu_item">
133 <?php Helper::renderLink($fluentCommunityButtomLink, 'fcom_menu_link space_menu_item route_url fcom_custom_link', '🔗'); ?>
134 </li>
135 <?php endforeach; ?>
136 </ul>
137 </nav>
138 </div>
139 <?php endforeach; ?>
140 <?php endif; ?>
141
142
143 <?php if ($fluentCommunitySettingsItems): ?>
144 <div style="margin-top: 20px;">
145 <h4 class="space_section_title"><?php esc_html_e('# Manage', 'fluent-community'); ?></h4>
146 <ul style="margin-top: 20px;">
147 <?php Helper::renderSettingsMenuItems($fluentCommunitySettingsItems); ?>
148 </ul>
149 </div>
150 <?php endif; ?>
151 </div>
152 <?php endif; ?>
153 </div>
154
155
156 <?php if ($fluentCommunityContext != 'ajax'): ?>
157 <?php do_action('fluent_community/after_sidebar_wrap', $fluentCommunityContext); ?>
158 <div id="fcom_menu_sidebar"></div>
159 <?php do_action('fluent_community/after_portal_sidebar', $fluentCommunityContext); ?>
160 <?php endif; ?>
161