X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FWidget.php;h=1b2502d2d65e08a66de4110ca9f3cbf3acba23fd;hb=65b86fe0d556829c09e8c8f5c707b868ad37dfe1;hp=daa34a8b00b2d3a8c3a9681df3519e3e1b498483;hpb=6f290607de7f10cea7429aacd0b394fd3f4c4e69;p=friendica.git diff --git a/src/Content/Widget.php b/src/Content/Widget.php index daa34a8b00..1b2502d2d6 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -1,6 +1,6 @@ get('system', 'directory'); + $global_dir = Search::getGlobalDirectory(); if (DI::config()->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'] .= ''; @@ -81,7 +83,7 @@ class Widget $nv['random'] = DI::l10n()->t('Random Profile'); $nv['inv'] = DI::l10n()->t('Invite Friends'); $nv['directory'] = DI::l10n()->t('Global Directory'); - $nv['global_dir'] = $global_dir; + $nv['global_dir'] = Profile::zrl($global_dir, true); $nv['local_directory'] = DI::l10n()->t('Local Directory'); $aside = []; @@ -318,23 +320,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]; }