$gdirpath = Profile::zrl($this->config->get('system', 'directory'), true);
}
- if ((!$this->session->isAuthenticated() && $this->config->get('system', 'community_page_style') != Community::DISABLED_VISITOR) &&
- !($this->config->get('system', 'community_page_style') == Community::DISABLED)
- ) {
+ if (($this->session->getLocalUserId() || $this->config->get('system', 'community_page_style') != Community::DISABLED_VISITOR) &&
+ !($this->config->get('system', 'community_page_style') == Community::DISABLED)) {
$nav['community'] = ['community', $this->l10n->t('Community'), '', $this->l10n->t('Conversations on this and other servers')];
}
if ($this->session->getLocalUserId()) {
- $nav['channel'] = ['channel', $this->l10n->t('Channels'), '', $this->l10n->t('Current posts, filtered by several rules')];
$nav['calendar'] = ['calendar', $this->l10n->t('Calendar'), '', $this->l10n->t('Calendar')];
}
$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
+ );
+ }
}
return self::$dice->create(Contact\FriendSuggest\Factory\FriendSuggest::class);
}
+ /**
+ * @return Content\Conversation\Factory\Timeline
+ */
+ public static function TimelineFactory()
+ {
+ return self::$dice->create(Content\Conversation\Factory\Timeline::class);
+ }
+
/**
* @return Contact\Introduction\Repository\Introduction
*/
$module = 'network';
+ $this->page['aside'] .= Widget::channels($module, $this->selectedTab, $this->session->getLocalUserId());
$this->page['aside'] .= Widget::accountTypes($module, $this->accountTypeString);
$arr = ['query' => $this->args->getQueryString()];
</span>
<div id="{{$type}}-desc">{{$desc nofilter}}</div>
<ul role="menu" class="{{$type}}-ul">
+ {{if !$all_label}}
<li role="menuitem" {{if !is_null($selected) && !$selected}}class="selected"{{/if}}><a href="{{$base}}" class="{{$type}}-link{{if !$selected}} {{$type}}-selected{{/if}} {{$type}}-all">{{$all_label}}</a></li>
+ {{/if}}
{{foreach $options as $option}}
<li role="menuitem" {{if $selected == $option.ref}}class="selected"{{/if}}><a href="{{$base}}{{$type}}={{$option.ref}}" class="{{$type}}-link{{if $selected == $option.ref}} {{$type}}-selected{{/if}}">{{$option.name}}</a></li>
{{/foreach}}
{{/if}}
<ul class="{{$type}}-ul">
+ {{if !$all_label}}
<li class="tool {{if !$selected}}selected{{/if}}"><a href="{{$base}}" class="{{$type}}-link {{$type}}-all">{{$all_label}}</a>
+ {{/if}}
{{foreach $options as $option}}
<li class="tool {{if $selected == $option.ref}}selected{{/if}}"><a href="{{$base}}{{$type}}={{$option.ref}}" class="{{$type}}-link">{{$option.name}}</a></li>
{{/foreach}}