mirror of
https://github.com/friendica/friendica
synced 2025-04-26 23:50:11 +00:00
Show only the user's categories on their profile
This commit is contained in:
parent
c03ff7833b
commit
30dcf3380c
2 changed files with 6 additions and 9 deletions
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue