[Directory] Fixup directory plugin
This commit is contained in:
parent
cc9f2d6ff2
commit
483ac38888
|
@ -32,8 +32,9 @@ class Directory extends Module
|
|||
*/
|
||||
public function onAddRoute(RouteLoader $r)
|
||||
{
|
||||
$r->connect('actors', '/actors', [Controller\Directory::class, 'actors']);
|
||||
$r->connect('groups', '/groups', [Controller\Directory::class, 'groups']);
|
||||
$r->connect('directory_actors', '/actors', [Controller\Directory::class, 'actors']);
|
||||
$r->connect('directory_groups', '/groups', [Controller\Directory::class, 'groups']);
|
||||
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
|
@ -46,16 +47,8 @@ class Directory extends Module
|
|||
*/
|
||||
public function onStartTwigPopulateVars(array &$vars): bool
|
||||
{
|
||||
$vars['main_nav_tabs'] = [
|
||||
[
|
||||
'title' => 'Actors',
|
||||
'route' => 'actors',
|
||||
],
|
||||
[
|
||||
'title' => 'Groups',
|
||||
'route' => 'groups',
|
||||
],
|
||||
];
|
||||
$vars['main_nav_tabs'][] = ['title' => 'Actors', 'route' => 'directory_actors'];
|
||||
$vars['main_nav_tabs'][] = ['title' => 'Groups', 'route' => 'directory_groups'];
|
||||
|
||||
return Event::next;
|
||||
}
|
||||
|
|
|
@ -91,11 +91,13 @@
|
|||
<li>
|
||||
<a href="{{ path('main_all') }}" class='hover-effect {{ active('main_all') }}'>Network</a>
|
||||
</li>
|
||||
{% for tab in main_nav_tabs %}
|
||||
{% if main_nav_tabs is defined %}
|
||||
{% for tab in main_nav_tabs %}
|
||||
<li>
|
||||
<a href="{{ path(tab['route']) }}" class='hover-effect {{ active(tab['route']) }}' >{{ tab['title'] }}</a>
|
||||
<a href="{{ path(tab['route']) }}" class='hover-effect {{ active(tab['route']) }}' >{{ tab['title'] }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="timeline">
|
||||
|
|
Loading…
Reference in New Issue
Block a user