PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 1.0.98
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v1.0.98
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 / Hooks / Handlers / PortalSettingsHandler.php

PortalSettingsHandler.php in FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses 1.0.98, at app/Hooks/Handlers/PortalSettingsHandler.php

50 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCommunity\App\Hooks\Handlers;
4
5 use FluentCommunity\App\Functions\Utility;
6 use FluentCommunity\App\Services\Helper;
7 use FluentCommunity\App\Vite;
8 use FluentCommunity\Framework\Support\Arr;
9
10 class PortalSettingsHandler
11 {
12 public function register()
13 {
14 add_filter('fluent_community/portal_data_vars', function ($vars) {
15 if (Arr::get($vars, 'route_group') != 'admin') {
16 return $vars;
17 }
18
19 $isRtl = Helper::isRtl();
20 unset($vars['js_files']['fcom_app_admin']);
21 $vars['js_files']['fcom_app'] = [
22 'url' => Vite::getStaticSrcUrl('admin_app.js'),
23 'deps' => []
24 ];
25
26 if (!Utility::isDev()) {
27 $vars['css_files']['fcom_admin_vendor'] = [
28 'url' => Vite::getStaticSrcUrl('admin_app.css', $isRtl) // vite automatically build src/admin_app.css for all components also styles inside components
29 ];
30 }
31
32 add_filter('fluent_community/header_vars', function ($vars) {
33 $vars['menuItems'] = [];
34 return $vars;
35 });
36
37 add_filter('fluent_community/will_render_default_sidebar_items', '__return_false');
38
39 add_action('fluent_community/after_header_menu', function () {
40 echo '<h4 style="margin: 0; font-size: 20px;">' . __('Portal Settings', 'fluent-community') . '</h4>';
41 });
42
43 $vars['js_vars']['fluentComAdmin']['portal_slug'] = ltrim(Helper::getPortalSlug(true), '/') . '/admin';
44
45 // check if current route starts with admin
46 return $vars;
47 });
48 }
49 }
50