diff options
| author | Arne Schröder, M. A. <schroeder@data-quest.de> | 2026-02-18 11:26:21 +0000 |
|---|---|---|
| committer | Rasmus Fuhse <fuhse@data-quest.de> | 2026-02-18 11:26:21 +0000 |
| commit | 93ab04fdc51ae681ff2d4ec9774d2b44244ea2f2 (patch) | |
| tree | 1ae8fe74690ca02db422001280791e0d38726037 /lib/modules/IliasInterfaceModule.php | |
| parent | f87679a9d8ef2ea25526897da8aa761287cacabc (diff) | |
Resolve "ILIAS-Schnittstelle: Anzeige von Arbeitsbereichen in Navigation und Arbeitsplatz auch unterhalb von tutor"
Closes #6272
Merge request studip/studip!4742
Diffstat (limited to 'lib/modules/IliasInterfaceModule.php')
| -rw-r--r-- | lib/modules/IliasInterfaceModule.php | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/lib/modules/IliasInterfaceModule.php b/lib/modules/IliasInterfaceModule.php index 6f9eca8..0168e2b 100644 --- a/lib/modules/IliasInterfaceModule.php +++ b/lib/modules/IliasInterfaceModule.php @@ -17,22 +17,37 @@ class IliasInterfaceModule extends CorePlugin implements StudipModuleExtended, S parent::__construct(); if (Config::get()->ILIAS_INTERFACE_ENABLE) { $ilias_interface_config = Config::get()->ILIAS_INTERFACE_BASIC_SETTINGS; - if (Seminar_Perm::get()->have_perm('root')) { + $workgroups = false; + $learning_objects = false; + foreach (Config::get()->ILIAS_INTERFACE_SETTINGS as $ilias_index => $ilias_config) { + if ($ilias_config['is_active']) { + if (!empty($ilias_config['workgroup_category']) && User::findCurrent()->hasPermissionLevel('tutor')) { + $workgroups = true; + } + if (!empty($ilias_interface_config['create_objects']) + && !empty($ilias_interface_config['create_category']) + && User::findCurrent()->hasPermissionLevel($ilias_config['author_perm'])) { + $learning_objects = true; + } + } + } + + if (User::findCurrent()->hasPermissionLevel('root')) { Navigation::addItem('/admin/config/ilias_interface', new Navigation(_('ILIAS-Schnittstelle'), 'dispatch.php/admin/ilias_interface')); } - if (Seminar_Perm::get()->have_perm('tutor') || Seminar_Perm::get()->have_perm('autor')) { + if (User::findCurrent()->hasPermissionLevel('autor')) { $ilias = new Navigation(_('ILIAS'), 'dispatch.php/my_ilias_accounts/my_courses'); $ilias->setImage(Icon::create('ilias')); $ilias->setDescription(_('Schnittstelle zu ILIAS')); $ilias->addSubNavigation( 'my_courses', - new Navigation(_('Meine Kurse'), 'dispatch.php/my_ilias_accounts/my_courses') + new Navigation($workgroups ? _('Meine Kurse und Arbeitsbereiche') : _('Meine Kurse'), 'dispatch.php/my_ilias_accounts/my_courses') ); - if (Seminar_Perm::get()->have_perm('root') || !empty($ilias_interface_config['show_tools_page'])) { + if (User::findCurrent()->hasPermissionLevel('root') || !empty($ilias_interface_config['show_tools_page'])) { $ilias->addSubNavigation( 'my_accounts', - new Navigation(_('Meine Lernobjekte und Accounts'), 'dispatch.php/my_ilias_accounts') + new Navigation($learning_objects ? _('Meine Lernobjekte und Accounts') : _('Meine Accounts'), 'dispatch.php/my_ilias_accounts') ); } Navigation::addItem('/contents/my_ilias_accounts', $ilias); |
