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/Functions/Utility.php +44 -0 2.7.52.10.0 View file →
@@ -10,8 +10,9 @@
10 10 use FluentCommunity\App\Services\FeedsHelper;
11 11 use FluentCommunity\App\Services\Helper;
12 12 use FluentCommunity\Framework\Support\Arr;
13 13 use FluentCommunity\Modules\Course\Model\Course;
14 +use FluentCommunity\Modules\PushNotification\PushNotificationModule;
14 15
15 16 class Utility
16 17 {
17 18 public static function isDev()
@@ -116,8 +117,9 @@
116 117 'has_crm_sync' => 'no',
117 118 'content_moderation' => 'no',
118 119 'followers_module' => 'no',
119 120 'custom_profile_fields' => 'no',
121 + 'pwa_module' => 'no',
120 122 ];
121 123
122 124 if (defined('FLUENT_COMMUNITY_CLOUD_STORAGE') && FLUENT_COMMUNITY_CLOUD_STORAGE) {
123 125 $features['cloud_storage'] = 'yes';
@@ -134,8 +136,9 @@
134 136 $features['cloud_storage'] = 'no';
135 137 $features['user_badge'] = 'no';
136 138 $features['followers_module'] = 'no';
137 139 $features['custom_profile_fields'] = 'no';
140 + $features['pwa_module'] = 'no';
138 141 }
139 142
140 143 return $features;
141 144 }
@@ -262,13 +265,15 @@
262 265
263 266 $defaults = [
264 267 'can_customize_username' => 'no',
265 268 'can_change_email' => 'no',
269 + 'can_change_password' => 'yes',
266 270 'show_last_activity' => 'yes',
267 271 'can_deactive_account' => 'no',
268 272 'email_auto_login' => 'yes',
269 273 'enable_gravatar' => 'yes',
270 274 'enable_user_sync' => 'yes',
275 + 'skip_crm_undeliverable_emails' => 'yes',
271 276 'members_page_status' => 'everybody', // everybody, logged_in, admin_only
272 277 'profile_page_visibility' => 'everybody', // everybody, logged_in, admin_only
273 278 'user_space_visibility' => 'everybody', // everybody, logged_in, admin_only
274 279 'leaderboard_members_visibility' => 'everybody', // everybody, logged_in, admin_only
@@ -472,8 +477,29 @@
472 477
473 478 return $settings;
474 479 }
475 480
481 + public static function getPushNotificationSettings()
482 + {
483 + static $settings;
484 + if ($settings) return $settings;
485 +
486 + $default = [
487 + 'push_enabled' => 'yes',
488 + 'com_my_post_push' => 'yes',
489 + 'reply_my_com_push' => 'yes',
490 + 'mention_push' => 'yes',
491 + 'co_com_push' => 'yes',
492 + 'prompt_placements' => PushNotificationModule::PROMPT_PLACEMENTS
493 + ];
494 +
495 + $settings = self::getOption('global_push_settings', $default);
496 +
497 + $settings = wp_parse_args($settings, $default);
498 +
499 + return $settings;
500 + }
501 +
476 502 public static function hasEmailAnnouncementEnabled()
477 503 {
478 504 $settings = self::getEmailNotificationSettings();
479 505 return Arr::get($settings, 'mention_mail', 'no') === 'yes';
@@ -524,8 +550,25 @@
524 550 $key = 'fluent_community_post_topics';
525 551 $topics = self::getFromCache($key, function () {
526 552 $topics = Term::where('taxonomy_name', 'post_topic')->orderBy('title', 'ASC')->get();
527 553
554 + // Respect the admin-defined order (settings.serial) when present;
555 + // topics without a serial fall back to the alphabetical order above.
556 + $topics = $topics->sort(function ($a, $b) {
557 + $serialA = Arr::get($a->settings, 'serial');
558 + $serialB = Arr::get($b->settings, 'serial');
559 + if ($serialA === null && $serialB === null) {
560 + return 0;
561 + }
562 + if ($serialA === null) {
563 + return 1;
564 + }
565 + if ($serialB === null) {
566 + return -1;
567 + }
568 + return (int) $serialA <=> (int) $serialB;
569 + })->values();
570 +
528 571 /*
529 572 * object_id = term_id
530 573 * meta_key = space_id
531 574 */
@@ -548,8 +591,9 @@
548 591 'title' => $topic->title,
549 592 'description' => $topic->description,
550 593 'slug' => $topic->slug,
551 594 'admin_only' => Arr::get($topic->settings, 'admin_only', 'no'),
595 + 'serial' => Arr::get($topic->settings, 'serial'),
552 596 'space_ids' => isset($relations[$topic->id]) ? $relations[$topic->id] : []
553 597 ];
554 598 }
555 599