diff --git a/app/controllers/course/details.php b/app/controllers/course/details.php index a956f07de5bcc8940e0e8fe6770d139eaae995f5..2a685e3b683521bf9423906445caeab87633ead0 100644 --- a/app/controllers/course/details.php +++ b/app/controllers/course/details.php @@ -67,11 +67,11 @@ class Course_DetailsController extends AuthenticatedController public function index_action() { - $this->prelim_discussion = vorbesprechung($this->course->id); $this->title = $this->course->getFullname(); $this->course_domains = UserDomain::getUserDomainsForSeminar($this->course->id); $this->sem = new Seminar($this->course); + $this->links = []; //public folders $folders = Folder::findBySQL("range_type='course' AND range_id = ? AND folder_type = 'CoursePublicFolder'", [$this->course->id]); @@ -233,6 +233,12 @@ class Course_DetailsController extends AuthenticatedController ['data-dialog' => 'size=big'] ); + $this->links[] = [ + 'label' => $abo_msg, + 'url' => $this->url_for("course/enrolment/apply/{$this->course->id}"), + 'attributes' => ['data-dialog' => 'size=big'], + ]; + } if (Config::get()->SCHEDULE_ENABLE @@ -253,6 +259,12 @@ class Course_DetailsController extends AuthenticatedController $this->url_for("calendar/schedule/addvirtual/{$this->course->id}"), Icon::create('info') ); + + $this->links[] = [ + 'label' => _('Nur im Stundenplan vormerken'), + 'url' => $this->url_for("calendar/schedule/addvirtual/{$this->course->id}"), + 'attributes' => [], + ]; } } diff --git a/app/views/course/details/index.php b/app/views/course/details/index.php index 3b9d86ccd2526c9a8cb073fbcf2ee4126612fcfc..15cee6ca6cd142e9c1218b7eb6809a6c041bf520 100644 --- a/app/views/course/details/index.php +++ b/app/views/course/details/index.php @@ -1,3 +1,14 @@ +<?php +/** + * @var array<array{label: string, url: string, attributes: array}> $links + * @var Course $course + * @var Course[] $siblings + * @var Course_DetailsController $controller + * @var Seminar $sem + * @var string $prelim_discussion + * @var stdClass $id_sfx + */ +?> <style> /* This should be done by an own class (maybe not table? maybe dd?) */ #tablefix { @@ -498,9 +509,17 @@ if (!empty($mvv_tree)) : ?> <? endforeach ?> -<? if (Request::get('from')) : ?> +<? if (count($links) > 0 || Request::get('from')) : ?> <footer data-dialog-button> - <?= \Studip\LinkButton::createCancel(_('Zurück'), URLHelper::getURL(Request::get('from')))?> + <? foreach ($links as $link): ?> + <?= Studip\LinkButton::create( + $link['label'], + URLHelper::getURL($link['url'], $link['attributes'] ?? []) + ) ?> + <? endforeach ?> + <? if (Request::get('from')): ?> + <?= Studip\LinkButton::createCancel(_('Zurück'), URLHelper::getURL(Request::get('from')))?> + <? endif ?> </footer> <? endif ?> -<?= Feedback::getHTML($course->id, 'Course'); ?> +<?= Feedback::getHTML($course->id, Course::class) ?>