PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.4
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.4
1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk 1.2.0 All 47 releases
fluent-cart / app / Views / admin / admin_menu.php

admin_menu.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.6.4, at app/Views/admin/admin_menu.php

196 lines 17.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2 <?php
3
4 use FluentCart\App\App;
5 use FluentCart\App\Services\Permission\PermissionManager;
6
7 // Inline SVGs render immediately with the HTML — no network request, no load blink.
8 $logoDir = App::isDevMode()
9 ? FLUENTCART_PLUGIN_PATH . 'resources/images/logo/'
10 : FLUENTCART_PLUGIN_PATH . 'assets/images/logo/';
11 $lightLogoSvg = file_get_contents($logoDir . 'logo-full-dark.svg');
12 $darkLogoSvg = file_get_contents($logoDir . 'logo-full.svg');
13
14 ?>
15 <div class="fct_admin_menu_wrap fct_global_menu_wrap">
16 <div class="fct_admin_menu_row">
17 <div class="fct_admin_logo_wrap">
18 <a aria-label="<?php echo esc_html__('FluentCart Logo', 'fluent-cart'); ?>"
19 title="<?php echo esc_html__('FluentCart Logo', 'fluent-cart'); ?>"
20 href="<?php echo esc_url(admin_url('admin.php?page=fluent-cart#/')); ?>">
21 <span class="logo-light"><?php echo $lightLogoSvg; ?></span>
22 <span class="logo-dark"><?php echo $darkLogoSvg; ?></span>
23 </a>
24 </div><!-- .fct_admin_logo_wrap -->
25
26 <div class="fct_admin_menu">
27 <ul class="fct_menu">
28 <?php foreach ($menu_items as $itemSlug => $menu_item):
29 if (empty($menu_item['permission']) || PermissionManager::hasPermission($menu_item['permission'])):
30 ?>
31 <li class="fct_menu_item fct_menu_item_<?php echo esc_attr($itemSlug);
32 echo !empty($menu_item['children']) ? ' has-child' : ''; ?>">
33
34 <?php if (!empty($menu_item['children']) && !empty($menu_item['link']) && $menu_item['link'] !== '#'): ?>
35 <a aria-label="<?php echo esc_attr($menu_item['label']) ?>"
36 href="<?php echo esc_url($menu_item['link']); ?>">
37 <?php echo esc_html($menu_item['label']); ?>
38 <span class="fct_menu_down_arrow">
39 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"
40 fill="currentColor">
41 <path fill="currentColor"
42 d="M10.1025513,12.7783485 L16.8106554,6.0794438 C17.0871744,5.80330401 17.5303978,5.80851813 17.8006227,6.09108986 C18.0708475,6.37366159 18.0657451,6.82658676 17.7892261,7.10272655 L10.5858152,14.2962587 C10.3114043,14.5702933 9.87226896,14.5675493 9.60115804,14.2901058 L2.2046872,6.72087106 C1.93149355,6.44129625 1.93181183,5.98834118 2.20539811,5.7091676 C2.47898439,5.42999401 2.92223711,5.43031926 3.19543076,5.70989407 L10.1025513,12.7783485 Z"></path>
43 </svg>
44 </span>
45 </a>
46 <?php elseif (!empty($menu_item['children'])): ?>
47 <button aria-label="<?php echo esc_attr($menu_item['label']) ?>">
48 <?php echo esc_html($menu_item['label']); ?>
49 <span class="fct_menu_down_arrow">
50 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"
51 fill="currentColor">
52 <path fill="currentColor"
53 d="M10.1025513,12.7783485 L16.8106554,6.0794438 C17.0871744,5.80330401 17.5303978,5.80851813 17.8006227,6.09108986 C18.0708475,6.37366159 18.0657451,6.82658676 17.7892261,7.10272655 L10.5858152,14.2962587 C10.3114043,14.5702933 9.87226896,14.5675493 9.60115804,14.2901058 L2.2046872,6.72087106 C1.93149355,6.44129625 1.93181183,5.98834118 2.20539811,5.7091676 C2.47898439,5.42999401 2.92223711,5.43031926 3.19543076,5.70989407 L10.1025513,12.7783485 Z"></path>
54 </svg>
55 </span>
56 </button>
57 <?php else : ?>
58
59 <a type="button" aria-label="<?php echo esc_attr($menu_item['label']) ?>"
60 href="<?php echo esc_url($menu_item['link']); ?>">
61 <?php echo esc_html($menu_item['label']); ?>
62 </a>
63
64 <?php endif; ?>
65
66
67
68 <?php if (!empty($menu_item['children'])): ?>
69 <ul class="fct_menu_child">
70 <?php foreach ($menu_item['children'] as $childSlug => $childItem):
71 if (empty($childItem['permission']) || PermissionManager::hasPermission($childItem['permission'])):
72 ?>
73 <li class="fct_menu_child_item fct_menu_child_item_<?php echo esc_attr($childSlug); ?>">
74 <a type="button"
75 aria-label="<?php echo esc_attr($childItem['label']) ?>"
76 href="<?php echo esc_url($childItem['link']); ?>">
77 <?php echo esc_html($childItem['label']); ?>
78 </a>
79 </li>
80 <?php endif; endforeach; ?>
81 </ul>
82 <?php endif; ?>
83 </li>
84 <?php endif; endforeach; ?>
85 </ul>
86 </div>
87
88 <div class="fct_admin_menu_actions">
89 <!-- Pre-rendered so the search button is visible from first paint.
90 Click delegates to window.fluentCart.openSearch() once Vue mounts. -->
91 <div id="fct_admin_menu_search">
92 <div class="fct-global-search-input-wrap">
93 <button type="button" class="fct-setting-search-button" aria-label="<?php echo esc_attr__('Search', 'fluent-cart'); ?>"
94 onclick="window.fluentCart?.openSearch?.()">
95 <span class="fct-setting-search-icon">
96 <div class="icon">
97 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
98 <path d="M14.5833 14.5833L18.3333 18.3333" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
99 <path d="M16.6667 9.16666C16.6667 5.02452 13.3089 1.66666 9.16675 1.66666C5.02461 1.66666 1.66675 5.02452 1.66675 9.16666C1.66675 13.3088 5.02461 16.6667 9.16675 16.6667C13.3089 16.6667 16.6667 13.3088 16.6667 9.16666Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>
100 </svg>
101 </div>
102 </span>
103 <span class="fct-global-search-button-keys">
104 <kbd class="fct-global-search-button-key">/</kbd>
105 </span>
106 </button>
107 </div>
108 </div>
109 <div class="fct_admin_menu_button_wrap">
110 <!-- Pre-rendered so the correct icon is visible from first paint.
111 data-fct-theme on <html> (set by the inline head script) drives
112 which icon span is visible via CSS. Vue teleport or vanilla JS
113 attach handlers after load without rebuilding the button. -->
114 <div id="theme-button-container">
115 <div class="fct-theme-button-container">
116 <button class="theme-selected-button" type="button" aria-haspopup="true"
117 aria-label="<?php echo esc_attr__('Toggle color theme', 'fluent-cart'); ?>">
118 <span class="fct-theme-icon fct-theme-icon--light">
119 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none"><path d="M10 14.5C8.80653 14.5 7.66193 14.0259 6.81802 13.182C5.97411 12.3381 5.5 11.1935 5.5 10C5.5 8.80653 5.97411 7.66193 6.81802 6.81802C7.66193 5.97411 8.80653 5.5 10 5.5C11.1935 5.5 12.3381 5.97411 13.182 6.81802C14.0259 7.66193 14.5 8.80653 14.5 10C14.5 11.1935 14.0259 12.3381 13.182 13.182C12.3381 14.0259 11.1935 14.5 10 14.5ZM10 13C10.7956 13 11.5587 12.6839 12.1213 12.1213C12.6839 11.5587 13 10.7956 13 10C13 9.20435 12.6839 8.44129 12.1213 7.87868C11.5587 7.31607 10.7956 7 10 7C9.20435 7 8.44129 7.31607 7.87868 7.87868C7.31607 8.44129 7 9.20435 7 10C7 10.7956 7.31607 11.5587 7.87868 12.1213C8.44129 12.6839 9.20435 13 10 13ZM9.25 1.75H10.75V4H9.25V1.75ZM9.25 16H10.75V18.25H9.25V16ZM3.63625 4.69675L4.69675 3.63625L6.2875 5.227L5.227 6.2875L3.63625 4.6975V4.69675ZM13.7125 14.773L14.773 13.7125L16.3638 15.3032L15.3032 16.3638L13.7125 14.773ZM15.3032 3.6355L16.3638 4.69675L14.773 6.2875L13.7125 5.227L15.3032 3.63625V3.6355ZM5.227 13.7125L6.2875 14.773L4.69675 16.3638L3.63625 15.3032L5.227 13.7125ZM18.25 9.25V10.75H16V9.25H18.25ZM4 9.25V10.75H1.75V9.25H4Z" fill="currentColor"/></svg>
120 </span>
121 <span class="fct-theme-icon fct-theme-icon--dark">
122 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none"><path d="M8.5 6.25C8.49985 7.29298 8.81035 8.31237 9.39192 9.17816C9.97348 10.0439 10.7997 10.7169 11.7653 11.1112C12.7309 11.5055 13.7921 11.6032 14.8134 11.3919C15.8348 11.1807 16.7701 10.67 17.5 9.925V10C17.5 14.1423 14.1423 17.5 10 17.5C5.85775 17.5 2.5 14.1423 2.5 10C2.5 5.85775 5.85775 2.5 10 2.5H10.075C9.57553 2.98834 9.17886 3.57172 8.90836 4.21576C8.63786 4.8598 8.49902 5.55146 8.5 6.25ZM4 10C3.99945 11.3387 4.44665 12.6392 5.27042 13.6945C6.09419 14.7497 7.24723 15.4992 8.54606 15.8236C9.84489 16.148 11.2149 16.0287 12.4381 15.4847C13.6614 14.9407 14.6675 14.0033 15.2965 12.8215C14.1771 13.0852 13.0088 13.0586 11.9026 12.744C10.7964 12.4295 9.78888 11.8376 8.97566 11.0243C8.16244 10.2111 7.57048 9.20361 7.25596 8.09738C6.94144 6.99116 6.91477 5.82292 7.1785 4.7035C6.21818 5.2151 5.41509 5.97825 4.85519 6.91123C4.2953 7.84422 3.99968 8.91191 4 10Z" fill="currentColor"/></svg>
123 </span>
124 <span class="fct-theme-icon fct-theme-icon--system">
125 <svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.875 4.375V6.25H4.375V7.5H6.875V9.375H8.125V4.375H6.875ZM9.375 7.5H15.625V6.25H9.375V7.5ZM13.125 10.625V12.5H15.625V13.75H13.125V15.625H11.875V10.625H13.125ZM10.625 13.75H4.375V12.5H10.625V13.75Z" fill="currentColor"/></svg>
126 </span>
127 </button>
128 </div>
129 </div>
130 <?php if (PermissionManager::hasPermission(["store/settings", 'store/sensitive'])): ?>
131 <div class="fct_admin_settings_btn_wrap">
132 <a class="fct_admin_settings_btn"
133 href="<?php echo esc_url(admin_url('admin.php?page=fluent-cart#/settings/store-settings/')) ?>">
134 <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 22 22"
135 fill="none">
136 <path d="M20.3175 6.14139L19.8239 5.28479C19.4506 4.63696 19.264 4.31305 18.9464 4.18388C18.6288 4.05472 18.2696 4.15664 17.5513 4.36048L16.3311 4.70418C15.8725 4.80994 15.3913 4.74994 14.9726 4.53479L14.6357 4.34042C14.2766 4.11043 14.0004 3.77133 13.8475 3.37274L13.5136 2.37536C13.294 1.71534 13.1842 1.38533 12.9228 1.19657C12.6615 1.00781 12.3143 1.00781 11.6199 1.00781H10.5051C9.81078 1.00781 9.4636 1.00781 9.20223 1.19657C8.94085 1.38533 8.83106 1.71534 8.61149 2.37536L8.27753 3.37274C8.12465 3.77133 7.84845 4.11043 7.48937 4.34042L7.15249 4.53479C6.73374 4.74994 6.25259 4.80994 5.79398 4.70418L4.57375 4.36048C3.85541 4.15664 3.49625 4.05472 3.17867 4.18388C2.86109 4.31305 2.67445 4.63696 2.30115 5.28479L1.80757 6.14139C1.45766 6.74864 1.2827 7.05227 1.31666 7.37549C1.35061 7.69871 1.58483 7.95918 2.05326 8.48012L3.0843 9.63282C3.3363 9.95185 3.51521 10.5078 3.51521 11.0077C3.51521 11.5078 3.33636 12.0636 3.08433 12.3827L2.05326 13.5354C1.58483 14.0564 1.35062 14.3168 1.31666 14.6401C1.2827 14.9633 1.45766 15.2669 1.80757 15.8741L2.30114 16.7307C2.67443 17.3785 2.86109 17.7025 3.17867 17.8316C3.49625 17.9608 3.85542 17.8589 4.57377 17.655L5.79394 17.3113C6.25263 17.2055 6.73387 17.2656 7.15267 17.4808L7.4895 17.6752C7.84851 17.9052 8.12464 18.2442 8.2775 18.6428L8.61149 19.6403C8.83106 20.3003 8.94085 20.6303 9.20223 20.8191C9.4636 21.0078 9.81078 21.0078 10.5051 21.0078H11.6199C12.3143 21.0078 12.6615 21.0078 12.9228 20.8191C13.1842 20.6303 13.294 20.3003 13.5136 19.6403L13.8476 18.6428C14.0004 18.2442 14.2765 17.9052 14.6356 17.6752L14.9724 17.4808C15.3912 17.2656 15.8724 17.2055 16.3311 17.3113L17.5513 17.655C18.2696 17.8589 18.6288 17.9608 18.9464 17.8316C19.264 17.7025 19.4506 17.3785 19.8239 16.7307L20.3175 15.8741C20.6674 15.2669 20.8423 14.9633 20.8084 14.6401C20.7744 14.3168 20.5402 14.0564 20.0718 13.5354L19.0407 12.3827C18.7887 12.0636 18.6098 11.5078 18.6098 11.0077C18.6098 10.5078 18.7888 9.95185 19.0407 9.63282L20.0718 8.48012C20.5402 7.95918 20.7744 7.69871 20.8084 7.37549C20.8423 7.05227 20.6674 6.74864 20.3175 6.14139Z"
137 stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
138 <path d="M14.5195 11C14.5195 12.933 12.9525 14.5 11.0195 14.5C9.08653 14.5 7.51953 12.933 7.51953 11C7.51953 9.067 9.08653 7.5 11.0195 7.5C12.9525 7.5 14.5195 9.067 14.5195 11Z"
139 stroke="currentColor" stroke-width="1.5"/>
140 </svg>
141 </a>
142 </div>
143 <?php endif; ?>
144 <div class="fct-mobile-menu-container" id="mobile-menu-container">
145 <div class="fct-offcanvas-menu-overlay" data-fct-offcanvas-menu-overlay></div>
146
147 <div class="menu-toggle-button" data-fct-menu-toggle>
148 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" class="">
149 <path d="M8.3335 4.16602L16.6668 4.16602" stroke="currentColor" stroke-width="1.5"
150 stroke-linecap="round" stroke-linejoin="round"></path>
151 <path d="M3.3335 10L16.6668 10" stroke="currentColor" stroke-width="1.5"
152 stroke-linecap="round" stroke-linejoin="round"></path>
153 <path d="M3.3335 15.832L11.6668 15.832" stroke="currentColor" stroke-width="1.5"
154 stroke-linecap="round" stroke-linejoin="round"></path>
155 </svg>
156 </div>
157
158 <div class="fct-offcanvas-menu" data-fct-offcanvas-menu>
159 <button class="fct-offcanvas-menu-close" data-fct-offcanvas-menu-close>
160 <span class="icon">
161 <svg class="cross" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
162 <path d="M15.8337 4.1665L4.16699 15.8332M4.16699 4.1665L15.8337 15.8332"
163 stroke="currentColor" stroke-width="1.5" stroke-linecap="round"
164 stroke-linejoin="round"></path>
165 </svg>
166 </span>
167 </button>
168 <div class="fct-offcanvas-menu-list">
169 <?php foreach ($menu_items as $itemSlug => $menu_item): ?>
170 <?php if (!empty($menu_item['children'])): ?>
171 <?php foreach ($menu_item['children'] as $childSlug => $childItem): ?>
172 <div class="fct-offcanvas-menu-item">
173 <div class="fct-offcanvas-menu-label">
174 <a href="<?php echo esc_url($childItem['link']); ?>"><?php echo esc_html($childItem['label']); ?></a>
175 </div>
176 </div>
177 <?php endforeach; ?>
178 <?php else: ?>
179 <div class="fct-offcanvas-menu-item">
180 <div class="fct-offcanvas-menu-label">
181 <a href="<?php echo esc_url($menu_item['link']); ?>"><?php echo esc_html($menu_item['label']); ?></a>
182 </div>
183 </div>
184 <?php endif; ?>
185 <?php endforeach; ?>
186
187 </div>
188 </div>
189 </div>
190 </div>
191
192 </div>
193
194 </div>
195 </div>
196