Select Git revision
Forked from
Stud.IP / Stud.IP
Source project has a limited visibility.
-
Jan-Hendrik Willms authored
Closes #4927 Merge request studip/studip!3698
Jan-Hendrik Willms authoredCloses #4927 Merge request studip/studip!3698
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
plugin.php 22.59 KiB
<?php
# Lifter010: TODO
/**
* plugin.php - plugin administration controller
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* @author Elmar Ludwig
* @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
* @category Stud.IP
* @package admin
*/
class Admin_PluginController extends AuthenticatedController
{
private $plugin_admin;
/**
* Common tasks for all actions.
*/
public function before_filter(&$action, &$args)
{
global $perm;
parent::before_filter($action, $args);
// user must have root permission
$perm->check('root');
// set page title and navigation
PageLayout::setTitle(_('Verwaltung von Plugins'));
Navigation::activateItem('/admin/config/plugins');
$this->plugin_admin = new PluginAdministration();
if (Request::int('reset_filter')) {
$GLOBALS['user']->cfg->delete('PLUGINADMIN_DISPLAY_SETTINGS');
}
// Extract display settings
$settings = $current = $GLOBALS['user']->cfg->PLUGINADMIN_DISPLAY_SETTINGS;
foreach ((array)$settings as $key => $value) {
$settings[$key] = Request::get($key, $settings[$key]) ?: null;
}
if ($settings !== $current) {
$GLOBALS['user']->cfg->store('PLUGINADMIN_DISPLAY_SETTINGS', $settings);
}
$this->plugin_filter = $settings['plugin_filter'];
$this->core_filter = $settings['core_filter'];
$views = Sidebar::get()->addWidget(new ViewsWidget());
$views->addLink(
_('Pluginverwaltung'),
$this->indexURL()
)->setActive($action === 'index');
$views->addLink(
_('Weitere Plugins installieren'),
$this->searchURL()
)->setActive($action === 'search');
$views->addLink(
_('Vorhandene Plugins registrieren'),
$this->unregisteredURL()
)->setActive($action === 'unregistered');
}