X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FWidget.php;h=86339928702dadadd879f02e1dbef365d6785d8d;hb=72a3ab6382551811f22391b7e82e7398628b235b;hp=b5ccd6f14db7640fa1561cccd3b0d6118f15b280;hpb=e56a53647bd5469551bf4f9ef2df50a5dd16b943;p=friendica.git diff --git a/src/Content/Widget.php b/src/Content/Widget.php index b5ccd6f14d..8633992870 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -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]; }