PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 2.10.0
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v2.10.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 1.1.0 All 77 releases
← All changes | app/Http/Controllers/OptionController.php +26 -3 1.0.912.10.0 View file →
@@ -2,10 +2,10 @@
2 2
3 3 namespace FluentCommunity\App\Http\Controllers;
4 4
5 5 use FluentCommunity\App\Functions\Utility;
6 +use FluentCommunity\App\Hooks\Handlers\PortalHandler;
6 7 use FluentCommunity\App\Models\BaseSpace;
7 -use FluentCommunity\App\Models\SpaceGroup;
8 8 use FluentCommunity\App\Services\FeedsHelper;
9 9 use FluentCommunity\App\Services\LockscreenService;
10 10 use FluentCommunity\Framework\Http\Request\Request;
11 11
@@ -10,8 +10,28 @@
10 10 use FluentCommunity\Framework\Http\Request\Request;
11 11
12 12 class OptionController extends Controller
13 13 {
14 +
15 + public function getAppVars()
16 + {
17 + $appVars = (new PortalHandler())->appVars();
18 + unset($appVars['rest']);
19 +
20 + $data = [
21 + 'appVars' => $appVars,
22 + 'menu_links_groups' => Utility::getPortalSidebarData('sidebar')
23 + ];
24 +
25 + return apply_filters('fluent_community/app_vars_api_response', $data, $this->request->all());
26 + }
27 +
28 + public function getMenuItems()
29 + {
30 + $data = Utility::getPortalSidebarData('sidebar');
31 + return apply_filters('fluent_community/menu_items_api_response', $data, $this->request->all());
32 + }
33 +
14 34 public function getSidebarMenuHtml(Request $request)
15 35 {
16 36 ob_start();
17 37 do_action('fluent_community/portal_sidebar', 'ajax');
@@ -32,12 +52,14 @@
32 52 })
33 53 ->get();
34 54 }
35 55
56 + BaseSpace::preloadMemberships($userSpaces, $userModel->ID);
57 +
36 58 $userSpaces->each(function ($space) use ($userModel) {
37 59 $space->permissions = $userModel->getSpacePermissions($space);
38 60 $space->membership = $space->getMembership($userModel->ID);
39 - $space->description_rendered = FeedsHelper::mdToHtml($space->description);
61 + $space->description_rendered = wp_kses_post(FeedsHelper::mdToHtml($space->description));
40 62 if ($space->privacy == 'private' && !$space->membership) {
41 63 $space->lockscreen_config = LockscreenService::getLockscreenConfig($space);
42 64 }
43 65 $space->topics = Utility::getTopicsBySpaceId($space->id);
@@ -46,10 +68,11 @@
46 68 } else {
47 69 $userSpaces = (object)[];
48 70 }
49 71
50 - return [
72 + $data = [
51 73 'sidebar_html' => $html,
52 74 'auth_spaces' => $userSpaces
53 75 ];
76 + return apply_filters('fluent_community/sidebar_menu_html_api_response', $data, $request->all());
54 77 }
55 78 }