Skip to content
Snippets Groups Projects
Select Git revision
  • 520fbf4f963092cb1abec96f6e2ade84f3837220
  • main default protected
  • step-3263
  • feature/plugins-cli
  • feature/vite
  • step-2484-peerreview
  • biest/issue-5051
  • tests/simplify-jsonapi-tests
  • fix/typo-in-1a70031
  • feature/broadcasting
  • database-seeders-and-factories
  • feature/peer-review-2
  • feature-feedback-jsonapi
  • feature/peerreview
  • feature/balloon-plus
  • feature/stock-images-unsplash
  • tic-2588
  • 5.0
  • 5.2
  • biest/unlock-blocks
  • biest-1514
21 results

plugin.php

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    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');
        }