diff options
| author | Murtaza Sultani <sultani@data-quest.de> | 2025-07-30 09:48:20 +0200 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2025-07-30 07:48:20 +0000 |
| commit | 8b5da1acae37d9bc983394c3f27508c24024d69b (patch) | |
| tree | 93360533b83eeff9f6c78e60cedadeb026bcad8e /app/controllers/course/forum/BaseController.php | |
| parent | d6ce47b2ea667524acafda4e539a81695158c07d (diff) | |
Resolve "Forum in freien Veranstaltungen sind nicht aufrufbar"issue-5760
Closes #5699
Merge request studip/studip!4371
Diffstat (limited to 'app/controllers/course/forum/BaseController.php')
| -rw-r--r-- | app/controllers/course/forum/BaseController.php | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/app/controllers/course/forum/BaseController.php b/app/controllers/course/forum/BaseController.php deleted file mode 100644 index 6525250..0000000 --- a/app/controllers/course/forum/BaseController.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php -namespace Forum; - -use ActionsWidget; -use Context; -use CoreForum; -use Icon; -use Request; -use SearchWidget; -use Sidebar; -use StudipController; - -abstract class BaseController extends StudipController -{ - protected $with_session = true; - - public function before_filter(&$action, &$args) - { - object_set_visit_module('forum'); - - $this->range_id = Context::getId(); - $this->is_moderator = CoreForum::isModerator($this->range_id); - $this->is_admin = CoreForum::isAdmin($this->range_id); - - $this->buildSidebar(); - - parent::before_filter($action, $args); - } - - protected function buildSidebar(): void - { - $actions = new ActionsWidget(); - - $actions->addLink( - _('Neue Diskussion starten'), - $this->url_for('course/forum/discussions/edit'), - Icon::create('add', Icon::ROLE_CLICKABLE, ['title' => _('Neue Diskussion starten')]) - )->asDialog('width=900;height=750'); - - if ($this->is_admin) { - $actions->addLink( - _('Forum verwalten'), - $this->url_for('course/forum/configs/edit'), - Icon::create('admin', Icon::ROLE_CLICKABLE, ['title' => _('Forum verwalten')]), - ['data-dialog' => 'width=500;height=300'] - ); - } - - Sidebar::Get()->addWidget($actions); - - $search = new SearchWidget($this->url_for('course/forum/search', [ - 'begin' => Request::int('begin'), - 'end' => Request::int('end') - ])); - - $search->addNeedle( - _('Suche nach Diskussionen oder Beiträge'), - 'q', - true - ); - - Sidebar::Get()->addWidget($search, 'forum_search'); - } -} |
