Improved timeline menu

This commit is contained in:
Michael 2023-09-21 20:43:14 +00:00
parent 073da9735d
commit fac76a33df
4 changed files with 74 additions and 22 deletions

View file

@ -560,16 +560,24 @@ class Widget
{
$channels = [];
$enabled = DI::pConfig()->get($uid, 'system', 'enabled_timelines', []);
foreach (DI::TimelineFactory()->getNetworkFeeds('') as $channel) {
$channels[] = ['ref' => $channel->code, 'name' => $channel->label];
if (empty($enabled) || in_array($channel->code, $enabled)) {
$channels[] = ['ref' => $channel->code, 'name' => $channel->label];
}
}
foreach (DI::TimelineFactory()->getChannelsForUser($uid) as $channel) {
$channels[] = ['ref' => $channel->code, 'name' => $channel->label];
if (empty($enabled) || in_array($channel->code, $enabled)) {
$channels[] = ['ref' => $channel->code, 'name' => $channel->label];
}
}
foreach (DI::TimelineFactory()->getCommunities(true) as $community) {
$channels[] = ['ref' => $community->code, 'name' => $community->label];
if (empty($enabled) || in_array($community->code, $enabled)) {
$channels[] = ['ref' => $community->code, 'name' => $community->label];
}
}
return self::filter(