diff options
Diffstat (limited to 'app/controllers/files.php')
| -rw-r--r-- | app/controllers/files.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/app/controllers/files.php b/app/controllers/files.php index f885edd..fd961d1 100644 --- a/app/controllers/files.php +++ b/app/controllers/files.php @@ -57,29 +57,31 @@ class FilesController extends AuthenticatedController /** * Helper method for filling the sidebar with actions. */ - private function buildSidebar(FolderType $folder, $view = true) + private function buildSidebar(FolderType $folder, $view = true, $active_plugin_id = null) { $sidebar = Sidebar::get(); - $sources = new LinksWidget(); + $sources = new ViewsWidget(); $sources->setTitle(_("Dateiquellen")); $sources->addLink( _("Stud.IP-Dateien"), $this->url_for("files/index"), - Icon::create("files", "clickable") - ); - foreach (PluginManager::getInstance()->getPlugins('FilesystemPlugin') as $plugin) { + Icon::create('files') + )->setActive(!$active_plugin_id); + foreach (PluginManager::getInstance()->getPlugins(FilesystemPlugin::class) as $plugin) { if ($plugin->isPersonalFileArea()) { $subnav = $plugin->getFileSelectNavigation(); $sources->addLink( $subnav->getTitle(), URLHelper::getURL("dispatch.php/files/system/".$plugin->getPluginId()), $subnav->getImage() - ); + )->setActive($plugin->getPluginId() == $active_plugin_id); } } - $sidebar->addWidget($sources); + if (count($sources->getElements()) > 1) { + $sidebar->addWidget($sources); + } $actions = new ActionsWidget(); @@ -688,7 +690,7 @@ class FilesController extends AuthenticatedController _('Ordner nicht gefunden!') ); } else { - $this->buildSidebar($this->topFolder, false); + $this->buildSidebar($this->topFolder, false, $plugin_id); } $this->render_action('index'); } |
