return new Timelines($tabs);
}
+ public function isNetwork(string $selectedTab): bool
+ {
+ return in_array($selectedTab, [TimelineEntity::COMMENTED, TimelineEntity::RECEIVED, TimelineEntity::CREATED, TimelineEntity::MENTION, TimelineEntity::STAR]);
+ }
+
public function isCommunity(string $selectedTab): bool
{
return in_array($selectedTab, [TimelineEntity::LOCAL, TimelineEntity::GLOBAL]);
{
$channels = [];
+ foreach (DI::TimelineFactory()->getNetworkFeeds('') as $channel) {
+ $channels[] = ['ref' => $channel->code, 'name' => $channel->label];
+ }
+
foreach (DI::TimelineFactory()->getChannelsForUser($uid) as $channel) {
$channels[] = ['ref' => $channel->code, 'name' => $channel->label];
}
if (!$this->selectedTab) {
$this->selectedTab = self::getTimelineOrderBySession($this->session, $this->pConfig);
- } elseif (!$this->timeline->isChannel($this->selectedTab, $this->session->getLocalUserId()) && !$this->timeline->isCommunity($this->selectedTab)) {
+ } elseif (!$this->timeline->isNetwork($this->selectedTab) && !$this->timeline->isChannel($this->selectedTab, $this->session->getLocalUserId()) && !$this->timeline->isCommunity($this->selectedTab)) {
throw new HTTPException\BadRequestException($this->l10n->t('Network feed not available.'));
}