ILIAS  release_8 Revision v8.24
class.ilMemberViewGUI.php
Go to the documentation of this file.
1<?php
2
23{
24 public static function showMemberViewSwitch(int $a_ref_id): bool
25 {
26 global $DIC;
27
28 $ilAccess = $DIC->access();
29 $ilCtrl = $DIC->ctrl();
30
32 if (!$settings->isEnabled()) {
33 return false;
34 }
35 $tree = $DIC->repositoryTree();
36 $lng = $DIC->language();
37 $ilTabs = $DIC->tabs();
38
39 // No course or group in path => aborting
40 if (!$tree->checkForParentType($a_ref_id, 'crs') &&
41 !$tree->checkForParentType($a_ref_id, 'grp')) {
42 return false;
43 }
44
45 // TODO: check edit_permission
46
48 if (($type === 'crs' || $type === 'grp') && $ilAccess->checkAccess('write', '', $a_ref_id)) {
49 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_ref_id);
50 $ilCtrl->setParameterByClass("ilrepositorygui", "mv", "1");
51 $ilCtrl->setParameterByClass("ilrepositorygui", "set_mode", "flat");
52 $ilTabs->addNonTabbedLink(
53 "members_view",
54 $lng->txt('mem_view_activate'),
55 $ilCtrl->getLinkTargetByClass("ilrepositorygui", "")
56 );
57 $ilCtrl->clearParametersByClass("ilrepositorygui");
58 return true;
59 }
60 return true;
61 }
62}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static showMemberViewSwitch(int $a_ref_id)
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
$type
$lng