mirror of
https://github.com/friendica/friendica
synced 2025-04-25 02:30:11 +00:00
Setting to select your network tabs
This commit is contained in:
parent
113436afd5
commit
d395de3aa1
9 changed files with 241 additions and 140 deletions
|
@ -97,7 +97,7 @@ class Timeline extends BaseModule
|
|||
protected function parseRequest(array $request)
|
||||
{
|
||||
$this->logger->debug('Got request', $request);
|
||||
$this->selectedTab = $this->parameters['content'] ?? '';
|
||||
$this->selectedTab = $this->parameters['content'] ?? $request['channel'] ?? '';
|
||||
|
||||
$this->accountTypeString = $request['accounttype'] ?? $this->parameters['accounttype'] ?? '';
|
||||
$this->accountType = User::getAccountTypeByString($this->accountTypeString);
|
||||
|
@ -159,14 +159,19 @@ class Timeline extends BaseModule
|
|||
]);
|
||||
}
|
||||
|
||||
protected function getTabArray(Timelines $timelines, string $prefix): array
|
||||
protected function getTabArray(Timelines $timelines, string $prefix, string $parameter = ''): array
|
||||
{
|
||||
$tabs = [];
|
||||
|
||||
foreach ($timelines as $tab) {
|
||||
$tabs[] = [
|
||||
if (is_null($tab->path) && !empty($parameter)) {
|
||||
$path = $prefix . '?' . http_build_query([$parameter => $tab->code]);
|
||||
} else {
|
||||
$path = $tab->path ?? $prefix . '/' . $tab->code;
|
||||
}
|
||||
$tabs[$tab->code] = [
|
||||
'label' => $tab->label,
|
||||
'url' => $tab->path ?? $prefix . '/' . $tab->code,
|
||||
'url' => $path,
|
||||
'sel' => $this->selectedTab == $tab->code ? 'active' : '',
|
||||
'title' => $tab->description,
|
||||
'id' => $prefix . '-' . $tab->code . '-tab',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue