diff options
| author | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2023-11-17 16:46:30 +0000 |
|---|---|---|
| committer | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2023-11-17 16:46:30 +0000 |
| commit | df2c285ccb1df958285eecba3d8a8f25144f78d6 (patch) | |
| tree | 9f4ec5cc40175010d51d4b50c34ccef99155c672 /lib/classes/ActionMenu.php | |
| parent | b0d92db0cde16a51cb4733dfd068d4c50ec006d4 (diff) | |
move view filter into table, add combined filter widget, fixes #3421
Closes #3421
Merge request studip/studip!2374
Diffstat (limited to 'lib/classes/ActionMenu.php')
| -rw-r--r-- | lib/classes/ActionMenu.php | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/classes/ActionMenu.php b/lib/classes/ActionMenu.php index 07b87a9..cf4fb80 100644 --- a/lib/classes/ActionMenu.php +++ b/lib/classes/ActionMenu.php @@ -26,6 +26,7 @@ class ActionMenu private $actions = []; private $attributes = []; + private $title; private $condition_all = null; private $condition = true; @@ -48,6 +49,7 @@ class ActionMenu private function __construct() { $this->addCSSClass('action-menu'); + $this->setTitle(_('Aktionen')); } /** @@ -294,6 +296,7 @@ class ActionMenu } return $action; }, $this->actions); + $template->title = $this->title; $template->action_menu_title = $this->generateTitle(); $template->attributes = $this->attributes; return $template->render(); @@ -377,6 +380,20 @@ class ActionMenu } /** + * Sets the title for the action menu. + * + * @param string $title display title + * + * @return ActionMenu instance to allow chaining + */ + public function setTitle(string $title): ActionMenu + { + $this->title = $title; + + return $this; + } + + /** * Generates the title of the action menu, including its context, if the context has been set. * * @return string The title of the action menu. @@ -385,11 +402,12 @@ class ActionMenu { if ($this->context) { return sprintf( - _('Aktionsmenü für %s'), + _('%s für %s'), + $this->title, $this->context ); } else { - return _('Aktionsmenü'); + return $this->title; } } } |
