From 9360ea5d075fddbbec3dedb51e064b13d9f05343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michaela=20Br=C3=BCckner?= Date: Tue, 24 Jun 2025 13:01:56 +0200 Subject: re #4754 Merge request studip/studip!3796 --- app/controllers/admin/ilias_interface.php | 6 ++- app/controllers/course/ilias_interface.php | 20 ++++++-- app/views/admin/ilias_interface/edit_content.php | 37 +++++++------- .../ilias_interface/edit_interface_settings.php | 10 +++- .../admin/ilias_interface/edit_permissions.php | 16 +++---- app/views/course/ilias_interface/index.php | 12 ++++- app/views/my_ilias_accounts/index.php | 12 +++-- lib/ilias_interface/ConnectedIlias.php | 56 +++++++++++++++------- lib/modules/IliasInterfaceModule.php | 12 ++++- 9 files changed, 124 insertions(+), 57 deletions(-) diff --git a/app/controllers/admin/ilias_interface.php b/app/controllers/admin/ilias_interface.php index dfb8f0a..ee069c4 100644 --- a/app/controllers/admin/ilias_interface.php +++ b/app/controllers/admin/ilias_interface.php @@ -104,6 +104,8 @@ class Admin_IliasInterfaceController extends AuthenticatedController $this->ilias_interface_config['cache'] = Request::bool('ilias_interface_cache', false); $this->ilias_interface_config['allow_change_course'] = Request::get('ilias_interface_allow_change_course'); $this->ilias_interface_config['allow_add_own_course'] = Request::get('ilias_interface_allow_add_own_course'); + $this->ilias_interface_config['create_category'] = (boolean)Request::get('ilias_interface_create_category'); + $this->ilias_interface_config['create_objects'] = (boolean)Request::get('ilias_interface_create_objects'); //store config entry Config::get()->store('ILIAS_INTERFACE_BASIC_SETTINGS', $this->ilias_interface_config); @@ -433,14 +435,14 @@ class Admin_IliasInterfaceController extends AuthenticatedController } if (array_key_exists($ilias_role, $this->global_roles)) { $this->ilias_configs[$index]['additional_roles'][$studip_role][$ilias_role] = [ - 'id' => $this->global_roles[$ilias_role]['id'], + 'id' => $this->global_roles[$ilias_role]['id'], 'name' => $this->global_roles[$ilias_role]['name']]; PageLayout::postSuccess(sprintf(_('ILIAS-Rolle %s wird Stud.IP-Rechtestufe %s zugewiesen.'), $this->global_roles[$ilias_role]['name'], $studip_role)); } else { PageLayout::postError(_('ILIAS-Rolle nicht gefunden.')); } } - } + } //store config entry Config::get()->store('ILIAS_INTERFACE_SETTINGS', $this->ilias_configs); diff --git a/app/controllers/course/ilias_interface.php b/app/controllers/course/ilias_interface.php index d79ed0b..13307bf 100644 --- a/app/controllers/course/ilias_interface.php +++ b/app/controllers/course/ilias_interface.php @@ -89,9 +89,17 @@ class Course_IliasInterfaceController extends AuthenticatedController if (($this->module_count == 0) && (!$this->courses)) { if (Context::isInstitute()) { - PageLayout::postInfo(_('Momentan sind dieser Einrichtung keine Lernobjekte zugeordnet.')); + if ($this->ilias_interface_config['create_objects']) { + PageLayout::postInfo(_('Momentan sind dieser Einrichtung keine Lernobjekte zugeordnet.')); + } else { + PageLayout::postInfo(_('Momentan sind dieser Einrichtung keine ILIAS-Kurse zugeordnet.')); + } } else { - PageLayout::postInfo(_('Momentan sind dieser Veranstaltung keine Lernobjekte zugeordnet.')); + if ($this->ilias_interface_config['create_objects']) { + PageLayout::postInfo(_('Momentan sind dieser Veranstaltung keine Lernobjekte zugeordnet.')); + } else { + PageLayout::postInfo(_('Momentan ist dieser Veranstaltung kein ILIAS-Kurs zugeordnet.')); + } } } @@ -105,7 +113,7 @@ class Course_IliasInterfaceController extends AuthenticatedController Icon::create('add') )->asDialog(); } - if ($this->author_permission) { + if ($this->author_permission && $this->ilias_interface_config['create_objects']) { $widget->addLink( _('Meine Lernobjekte'), $this->url_for('course/ilias_interface/add_object/my_modules'), @@ -241,7 +249,11 @@ class Course_IliasInterfaceController extends AuthenticatedController */ public function add_object_action($mode = 'search', $index = '') { - PageLayout::setTitle(_('Lernobjekt hinzufügen')); + if ($this->ilias_interface_config['create_objects']) { + PageLayout::setTitle(_('Lernobjekt hinzufügen')); + } else { + PageLayout::setTitle(_('Neuen ILIAS-Kurs anlegen')); + } if (!$this->edit_permission) { throw new AccessDeniedException(); diff --git a/app/views/admin/ilias_interface/edit_content.php b/app/views/admin/ilias_interface/edit_content.php index 2fdc534..a67fa21 100644 --- a/app/views/admin/ilias_interface/edit_content.php +++ b/app/views/admin/ilias_interface/edit_content.php @@ -11,9 +11,9 @@ - + + + = 50400) && (ConnectedIlias::getIntVersion($ilias_config['version']) < 60000)) : ?> - - + +