From 3124cdedba6a5932beac22cb20176ba3e1eea3f3 Mon Sep 17 00:00:00 2001 From: Alex Killing Date: Wed, 6 Nov 2024 18:24:24 +0100 Subject: [PATCH] 42292: Different sortation of buttons on Content Tab --- .../MemberView/class.ilMemberViewGUI.php | 18 +----------------- .../Container/classes/class.ilContainerGUI.php | 13 +++---------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/components/ILIAS/Container/MemberView/class.ilMemberViewGUI.php b/components/ILIAS/Container/MemberView/class.ilMemberViewGUI.php index aa6cf83cf0e2..491c59a5fbad 100755 --- a/components/ILIAS/Container/MemberView/class.ilMemberViewGUI.php +++ b/components/ILIAS/Container/MemberView/class.ilMemberViewGUI.php @@ -43,27 +43,11 @@ public static function showMemberViewSwitch(int $a_ref_id): bool !$tree->checkForParentType($a_ref_id, 'grp')) { return false; } - // TODO: check edit_permission $type = ilObject::_lookupType(ilObject::_lookupObjId($a_ref_id)); - - $isCourseOrGroupContentTab = - ( - $ilCtrl->getCmd() === 'view' && - ($type === 'crs' || $type === 'grp') - ) || ( - $ilCtrl->getCmd() === '' && - $type === 'crs' && - strtolower($ilCtrl->getCmdClass()) === 'ilobjcoursegui' - ) || ( - $ilCtrl->getCmd() === '' && - $type === 'grp' && - strtolower($ilCtrl->getCmdClass()) === 'ilobjgroupgui' - ); - if ( - $isCourseOrGroupContentTab && + in_array($type, ["crs", "grp"]) && $ilAccess->checkAccess('write', '', $a_ref_id) ) { $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_ref_id); diff --git a/components/ILIAS/Container/classes/class.ilContainerGUI.php b/components/ILIAS/Container/classes/class.ilContainerGUI.php index 50932a6ade5b..7b5be8a08b6f 100755 --- a/components/ILIAS/Container/classes/class.ilContainerGUI.php +++ b/components/ILIAS/Container/classes/class.ilContainerGUI.php @@ -325,16 +325,6 @@ public function getContainerPageHTML(): string return $ret; } - public function prepareOutput(bool $show_subobjects = true): bool - { - if (parent::prepareOutput($show_subobjects)) { // return false in admin mode - if ($show_subobjects === true && $this->getCreationMode() === false) { - ilMemberViewGUI::showMemberViewSwitch($this->object->getRefId()); - } - } - return true; - } - protected function setTitleAndDescription(): void { if (ilContainer::_lookupContainerSetting($this->object->getId(), "hide_header_icon_and_title")) { @@ -433,6 +423,9 @@ public function renderObject(): void if (!$this->edit_order) { $this->showPossibleSubObjects(); + if (!$this->isActiveAdministrationPanel() && $this->getCreationMode() === false) { + ilMemberViewGUI::showMemberViewSwitch($this->object->getRefId()); + } } if ($this->isActiveAdministrationPanel()) { $this->addImportButtonToToolbar();