X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FWidget.php;h=b9a75e4d2d8c5c1546f246175d55ff3b59171cb5;hb=ddd2c72be8e7245389f97d74dd847f5a20410936;hp=486bada7d5c87efe0155fc41646ee823f72210c0;hpb=1ec8b62b589a82690321a9910d31fb10c1156e61;p=friendica.git diff --git a/src/Content/Widget.php b/src/Content/Widget.php index 486bada7d5..b9a75e4d2d 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -1,6 +1,6 @@ getNetworkFeeds('') as $channel) { - $channels[] = ['ref' => $channel->code, 'name' => $channel->label]; + $enabled = DI::pConfig()->get($uid, 'system', 'enabled_timelines', []); + + foreach (DI::NetworkFactory()->getTimelines('') as $channel) { + 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]; + foreach (DI::ChannelFactory()->getTimelines($uid) as $channel) { + 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]; + foreach (DI::userDefinedChannel()->selectByUid($uid) as $channel) { + if (empty($enabled) || in_array($channel->code, $enabled)) { + $channels[] = ['ref' => $channel->code, 'name' => $channel->label]; + } + } + + foreach (DI::CommunityFactory()->getTimelines(true) as $community) { + if (empty($enabled) || in_array($community->code, $enabled)) { + $channels[] = ['ref' => $community->code, 'name' => $community->label]; + } } return self::filter(