]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Feature.php
Add trending_tags additional feature + usage in mod/community
[friendica.git] / src / Content / Feature.php
index 446ea2705ca42bd64d407443f2220026258efcfd..339e1a1fd5496fd768e2bac48d8d230974c999db 100644 (file)
@@ -5,8 +5,8 @@
  */
 namespace Friendica\Content;
 
-use Friendica\Core\Addon;
 use Friendica\Core\Config;
+use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
 
@@ -18,8 +18,9 @@ class Feature
         * @param integer $uid     user id
         * @param string  $feature feature
         * @return boolean
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function isEnabled($uid, $feature)
+       public static function isEnabled(int $uid, $feature)
        {
                $x = Config::get('feature_lock', $feature, false);
 
@@ -36,7 +37,7 @@ class Feature
                }
 
                $arr = ['uid' => $uid, 'feature' => $feature, 'enabled' => $x];
-               Addon::callHooks('isEnabled', $arr);
+               Hook::callAll('isEnabled', $arr);
                return($arr['enabled']);
        }
 
@@ -45,6 +46,7 @@ class Feature
         *
         * @param string $feature feature
         * @return boolean
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        private static function getDefault($feature)
        {
@@ -69,6 +71,7 @@ class Feature
         * @param bool $filtered True removes any locked features
         *
         * @return array
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
        public static function get($filtered = true)
        {
@@ -81,12 +84,14 @@ class Feature
                                ['multi_profiles',  L10n::t('Multiple Profiles'),      L10n::t('Ability to create multiple profiles'), false, Config::get('feature_lock', 'multi_profiles', false)],
                                ['photo_location',  L10n::t('Photo Location'),         L10n::t("Photo metadata is normally stripped. This extracts the location \x28if present\x29 prior to stripping metadata and links it to a map."), false, Config::get('feature_lock', 'photo_location', false)],
                                ['export_calendar', L10n::t('Export Public Calendar'), L10n::t('Ability for visitors to download the public calendar'), false, Config::get('feature_lock', 'export_calendar', false)],
+                               ['trending_tags', L10n::t('Trending Tags'), L10n::t('Show a community page widget with a list of the most popular tags in recent public posts.'), false, Config::get('feature_lock', 'trending_tags', false)],
                        ],
 
                        // Post composition
                        'composition' => [
                                L10n::t('Post Composition Features'),
                                ['aclautomention', L10n::t('Auto-mention Forums'), L10n::t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock', 'aclautomention', false)],
+                               ['explicit_mentions', L10n::t('Explicit Mentions'), L10n::t('Add explicit mentions to comment box for manual control over who gets mentioned in replies.'), false, Config::get('feature_lock', 'explicit_mentions', false)],
                        ],
 
                        // Network sidebar widgets
@@ -139,7 +144,7 @@ class Feature
                        }
                }
 
-               Addon::callHooks('get', $arr);
+               Hook::callAll('get', $arr);
                return $arr;
        }
 }