2018-03-11

This commit is contained in:
Visman 2018-03-11 20:39:29 +07:00
parent 50a09149a5
commit d4e56d515a
3 changed files with 23 additions and 5 deletions

View file

@ -74,13 +74,25 @@ class Page extends Model
if ($this->user->g_read_board == '1' && $this->user->g_search == '1') {
$sub = [];
$sub['latest'] = [$r->link('SearchAction', ['action' => 'latest_active_topics']), 'Latest active topics', 'Find latest active topics'];
$sub['latest'] = [
$r->link('SearchAction', ['action' => 'latest_active_topics']),
'Latest active topics',
'Find latest active topics',
];
if (! $this->user->isGuest) {
$sub['with-your-posts'] = [$r->link('SearchAction', ['action' => 'topics_with_your_posts']), 'Topics with your posts', 'Find topics with your posts'];
$sub['with-your-posts'] = [
$r->link('SearchAction', ['action' => 'topics_with_your_posts']),
'Topics with your posts',
'Find topics with your posts',
];
}
$sub['unanswered'] = [$r->link('SearchAction', ['action' => 'unanswered_topics']), 'Unanswered topics', 'Find unanswered topics'];
$sub['unanswered'] = [
$r->link('SearchAction', ['action' => 'unanswered_topics']),
'Unanswered topics',
'Find unanswered topics',
];
$nav['search'] = [$r->link('Search'), 'Search', null, $sub];
$nav['search'] = [$r->link('Search'), 'Search', null, $sub];
}
if ($this->user->isGuest) {

View file

@ -394,6 +394,11 @@ class Search extends Page
$asTopicsList = true;
$list = false;
$uid = isset($args['uid']) ? (int) $args['uid'] : null;
$subIndex = [
'topics_with_your_posts' => 'with-your-posts',
'latest_active_topics' => 'latest',
'unanswered_topics' => 'unanswered',
];
switch ($action) {
case 'search':
if (1 === $model->showAs) {
@ -421,6 +426,7 @@ class Search extends Page
$model->name = \ForkBB\__('Quick search ' . $action);
$model->linkMarker = 'SearchAction';
$model->linkArgs = ['action' => $action];
$this->fSubIndex = $subIndex[$action];
break;
# default:
# throw new InvalidArgumentException('Unknown action: ' . $action);

View file

@ -34,7 +34,7 @@
@foreach ($val[3] as $key => $val)
<li id="id-nav-{!! $key !!}" class="f-menu-item">
@if (isset($val[0]))
<a class="f-menu-a" href="{!! __($val[0]) !!}" title="{!! __($val[2]) !!}">{!! __($val[1]) !!}</a>
<a class="f-menu-a @if ($key == $p->fSubIndex) active @endif" href="{!! __($val[0]) !!}" title="{!! __($val[2]) !!}">{!! __($val[1]) !!}</a>
@else
<span class="f-menu-span">{!! __($val[1]) !!}</span>
@endif