Skip to content
Snippets Groups Projects
Select Git revision
  • fb0acb3e51d1d8e354a2eca2dd02ba69caebdd32
  • 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

LikertEdit.vue

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.
    myplugins.php 7.97 KiB
    <?php
    require_once 'market_controller.php';
    
    class MypluginsController extends MarketController
    {
        function before_filter(&$action, &$args)
        {
            parent::before_filter($action, $args);
    
            Navigation::activateItem("/pluginmarket/myplugins");
            $this->set_content_type('text/html;charset=windows-1252');
        }
    
        public function overview_action()
        {
            $this->plugins = MarketPlugin::findBySQL("user_id = ? ORDER BY mkdate DESC", array($GLOBALS['user']->id));
        }
    
        public function addfromzip_action()
        {
            CSRFProtection::verifyUnsafeRequest();
            if (isset($_FILES['release_file']['tmp_name'])) {
                $plugin = new MarketPlugin();
                $plugin->setId($plugin->getNewId());
                $plugin->user_id = $GLOBALS['user']->id;
                $release = new MarketRelease();
                $release->plugin = $plugin;
                $release['user_id'] = $GLOBALS['user']->id;
                //throws Exception on error
                $release->installFile();
                $this->redirect($this->url_for('/overview', ['edit_plugin_id' => $plugin->id]));
            }
        }
    
        public function add_action() {
            $this->marketplugin = new MarketPlugin();
            if (Request::isXhr()) {
                $this->set_layout(null);
            }
    
            $this->render_action("edit");
        }
    
        public function edit_action($plugin_id) {
            $this->marketplugin = new MarketPlugin($plugin_id);
            if (Request::isXhr()) {
                $this->response->add_header('X-Title', _("Plugin bearbeiten"));
                $this->set_layout(null);
            }
        }
    
        public function add_release_action($plugin_id) {
            $this->marketplugin = new MarketPlugin($plugin_id);
            $this->release = new MarketRelease();
            if (Request::isXhr()) {
                $this->response->add_header('X-Title', _("Release hinzufgen"));
                $this->set_layout(null);
            }
            $this->render_action("edit_release");
        }
    
        public function edit_release_action($release_id) {
            $this->release = new MarketRelease($release_id);
            $this->marketplugin = $this->release->plugin;
            if (!$this->marketplugin->isNew() && !$this->marketplugin->isWritable()) {
                throw new AccessDeniedException("Kein Zugriff");
            }
            if (Request::isXhr()) {
                $this->response->add_header('X-Title', _("Release bearbeiten"));
                $this->set_layout(null);