mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 22:17:17 +02:00
We now display the channel in the sidebar
This commit is contained in:
parent
d395de3aa1
commit
8050389d32
6 changed files with 46 additions and 4 deletions
|
@ -547,4 +547,35 @@ class Widget
|
|||
$accounttype
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all channels
|
||||
*
|
||||
* @param string $base
|
||||
* @param string $channelname
|
||||
* @param integer $uid
|
||||
* @return string
|
||||
*/
|
||||
public static function channels(string $base, string $channelname, int $uid): string
|
||||
{
|
||||
$channels = [];
|
||||
|
||||
foreach (DI::TimelineFactory()->getChannelsForUser($uid) as $channel) {
|
||||
$channels[] = ['ref' => $channel->code, 'name' => $channel->label];
|
||||
}
|
||||
|
||||
foreach (DI::TimelineFactory()->getCommunities(true) as $community) {
|
||||
$channels[] = ['ref' => $community->code, 'name' => $community->label];
|
||||
}
|
||||
|
||||
return self::filter(
|
||||
'channel',
|
||||
DI::l10n()->t('Channels'),
|
||||
'',
|
||||
'',
|
||||
$base,
|
||||
$channels,
|
||||
$channelname
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue