Skip to content

Commit

Permalink
42292: Different sortation of buttons on Content Tab
Browse files Browse the repository at this point in the history
  • Loading branch information
alex40724 committed Nov 6, 2024
1 parent de15b29 commit 3124cde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
18 changes: 1 addition & 17 deletions components/ILIAS/Container/MemberView/class.ilMemberViewGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 3 additions & 10 deletions components/ILIAS/Container/classes/class.ilContainerGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 3124cde

Please sign in to comment.