diff options
| author | David Siegfried <david.siegfried@uni-vechta.de> | 2022-11-07 13:04:29 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2022-11-07 13:04:29 +0000 |
| commit | a2a499c2d267561f1a445ffe02a8a5b5f96cf4c0 (patch) | |
| tree | f2cb7075d9fdf8c262d1625b0471059f4e737fbb /app/controllers/course/basicdata.php | |
| parent | cf4f0ddaa8a5e7e8380175c7d07402fa6ea3e8c5 (diff) | |
prevent php8-warning, closes #1750
Closes #1750
Merge request studip/studip!1139
Diffstat (limited to 'app/controllers/course/basicdata.php')
| -rw-r--r-- | app/controllers/course/basicdata.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/controllers/course/basicdata.php b/app/controllers/course/basicdata.php index 8a32bc3..708e8db 100644 --- a/app/controllers/course/basicdata.php +++ b/app/controllers/course/basicdata.php @@ -369,6 +369,7 @@ class Course_BasicdataController extends AuthenticatedController $this->url_for('avatar/update/course', $course_id), Icon::create('edit') ); + if ($this->deputies_enabled) { if (Deputy::isDeputy($GLOBALS['user']->id, $this->course_id)) { $newstatus = 'dozent'; @@ -376,11 +377,16 @@ class Course_BasicdataController extends AuthenticatedController } else if (in_array($GLOBALS['user']->id, array_keys($this->dozenten)) && count($this->dozenten) > 1) { $newstatus = 'deputy'; $text = _('Vertretung werden'); + } else { + $newstatus = ''; + $text = ''; + } + if ($newstatus !== '' && $text !== '') { + $widget->addLink($text, + $this->url_for('course/basicdata/switchdeputy', $this->course_id, $newstatus), + Icon::create('persons') + ); } - $widget->addLink($text, - $this->url_for('course/basicdata/switchdeputy', $this->course_id, $newstatus), - Icon::create('persons') - ); } $sidebar->addWidget($widget); if ($GLOBALS['perm']->have_studip_perm('admin', $this->course_id)) { |
