diff options
| author | Murtaza Sultani <sultani@data-quest.de> | 2026-01-15 17:10:04 +0100 |
|---|---|---|
| committer | Murtaza Sultani <sultani@data-quest.de> | 2026-01-15 17:10:04 +0100 |
| commit | c3e07e221b0bef64d3ad4da48c6371c75ca12cc3 (patch) | |
| tree | a2da9becb70c334b38cdf429f77257167d37993b /lib | |
| parent | 083da68644d230b8a4b1d8201ed832a5206d3d5c (diff) | |
Resolve "Neues Forum Polishing", #6064, #6063, #6151
Closes #6165
Merge request studip/studip!4671
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/classes/Forum/BaseController.php | 7 | ||||
| -rw-r--r-- | lib/exceptions/NotFoundException.php | 29 |
2 files changed, 32 insertions, 4 deletions
diff --git a/lib/classes/Forum/BaseController.php b/lib/classes/Forum/BaseController.php index 327e0bc..5a7e8f8 100644 --- a/lib/classes/Forum/BaseController.php +++ b/lib/classes/Forum/BaseController.php @@ -17,7 +17,7 @@ abstract class BaseController extends StudipController protected $is_admin = false; protected $is_moderator = false; - public function before_filter(&$action, &$args) + public function before_filter(&$action, &$args): void { object_set_visit_module('forum'); @@ -49,9 +49,8 @@ abstract class BaseController extends StudipController $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=350'] - ); + Icon::create('admin', Icon::ROLE_CLICKABLE, ['title' => _('Forum verwalten')]) + )->asDialog('width=500;height=350'); } Sidebar::Get()->addWidget($actions); diff --git a/lib/exceptions/NotFoundException.php b/lib/exceptions/NotFoundException.php new file mode 100644 index 0000000..d1ed900 --- /dev/null +++ b/lib/exceptions/NotFoundException.php @@ -0,0 +1,29 @@ +<?php +declare(strict_types=1); + +class NotFoundException extends Exception +{ + private array $details = []; + + public function __construct( + string $message = '', + int $code = 0, + ?Throwable $previous = null + ) { + parent::__construct( + $message ?: _('Die angeforderte Ressource wurde nicht gefunden.'), + $code ?: 404, + $previous + ); + } + + public function setDetails(array $details): void + { + $this->details = $details; + } + + public function getDetails(): array + { + return $this->details; + } +} |
