diff --git a/plugins/Cover/Cover.php b/plugins/Cover/Cover.php index 1add646b6f..2158c797c8 100644 --- a/plugins/Cover/Cover.php +++ b/plugins/Cover/Cover.php @@ -61,15 +61,11 @@ class Cover extends Module */ public function onStartTwigPopulateVars(array &$vars): bool { - $vars['profile_tabs'] = [['title' => 'Cover', - 'route' => 'settings_profile_cover', - ]]; + $vars['profile_tabs'][] = ['title' => 'Cover', + 'route' => 'settings_profile_cover', + ]; if (Common::user() != null) { - if (array_key_exists('profile_extras',$vars)) { - $vars['profile_extras'] = []; - } - $cover = DB::find('cover', ['gsactor_id' => Common::user()->getId()]); if ($cover != null) { $vars['profile_extras'][] = ['name' => 'cover', 'vars' => ['img' => '/cover']]; diff --git a/plugins/Directory/Controller/Directory.php b/plugins/Directory/Controller/Directory.php index cd3a3c8f39..6f2f36d39e 100644 --- a/plugins/Directory/Controller/Directory.php +++ b/plugins/Directory/Controller/Directory.php @@ -26,6 +26,13 @@ use Symfony\Component\HttpFoundation\Request; class Directory { + /** + * actors stream + * + * @param Request $request + * + * @return array template + */ public function actors(Request $request) { return ['_template' => 'directory/actors.html.twig', 'actors' => DB::dql('select g from App\Entity\GSActor g order by g.nickname ASC')]; diff --git a/plugins/Directory/Directory.php b/plugins/Directory/Directory.php index d71f8e8429..ed7ca97693 100644 --- a/plugins/Directory/Directory.php +++ b/plugins/Directory/Directory.php @@ -23,10 +23,18 @@ namespace Plugin\Directory; use App\Core\Event; use App\Core\Module; +use App\Core\Router\RouteLoader; class Directory extends Module { - public function onAddRoute($r) + /** + * Map URLs to actions + * + * @param RouteLoader $r + * + * @return bool hook value; true means continue processing, false means stop. + */ + public function onAddRoute(RouteLoader $r) { $r->connect('actors', '/actors', [Controller\Directory::class, 'actors']); $r->connect('groups', '/groups', [Controller\Directory::class, 'groups']); @@ -42,9 +50,6 @@ class Directory extends Module */ public function onStartTwigPopulateVars(array &$vars): bool { - if (array_key_exists('main_nav_tabs',$vars)) { - $vars['main_nav_tabs'] = []; - } $vars['main_nav_tabs'][] = ['title' => 'Actors', 'route' => 'actors', ];