X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FContent%2FWidget.php;h=86339928702dadadd879f02e1dbef365d6785d8d;hb=00aa905c155725d91d7b614abdcfcd070250bf7d;hp=4a3e9186741d57ac6a1c6b6d27ed97445dec8d98;hpb=24f8ee8e676abf4dd16916fd417562aca7bcbb9f;p=friendica.git diff --git a/src/Content/Widget.php b/src/Content/Widget.php index 4a3e918674..8633992870 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -1,6 +1,6 @@ get('system', 'invitation_only')) { $x = intval(DI::pConfig()->get(local_user(), 'system', 'invites_remaining')); - if ($x || is_site_admin()) { + if ($x || DI::app()->isSiteAdmin()) { DI::page()['aside'] .= ''; @@ -318,23 +318,20 @@ class Widget /** * Return categories widget * - * @param string $baseurl baseurl - * @param string $selected optional, default empty + * @param int $uid Id of the user owning the categories + * @param string $baseurl Base page URL + * @param string $selected Selected category * @return string|void * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function categories($baseurl, $selected = '') + public static function categories(int $uid, string $baseurl, string $selected = '') { - $a = DI::app(); - - $uid = intval($a->getProfileOwner()); - if (!Feature::isEnabled($uid, 'categories')) { return ''; } $terms = array(); - foreach (Post\Category::getArray(local_user(), Post\Category::CATEGORY) as $savedFolderName) { + foreach (Post\Category::getArray($uid, Post\Category::CATEGORY) as $savedFolderName) { $terms[] = ['ref' => $savedFolderName, 'name' => $savedFolderName]; }