ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 $ilToolbar = $DIC->toolbar();
38 $ui = $DIC->ui();
39 $ilTab = $DIC->tabs();
40
41 // No course or group in path => aborting
42 if (!$tree->checkForParentType($a_ref_id, 'crs') &&
43 !$tree->checkForParentType($a_ref_id, 'grp')) {
44 return false;
45 }
46 // TODO: check edit_permission
47
49 if (
50 in_array($type, ["crs", "grp"]) &&
51 $ilAccess->checkAccess('write', '', $a_ref_id)
52 ) {
53 $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_ref_id);
54 $ilCtrl->setParameterByClass("ilrepositorygui", "mv", "1");
55 $ilCtrl->setParameterByClass("ilrepositorygui", "set_mode", "flat");
56 $ilToolbar->addComponent(
57 $ui->factory()->button()->standard(
58 $lng->txt('mem_view_activate'),
59 $ilCtrl->getLinkTargetByClass("ilrepositorygui", "")
60 )
61 );
62 $ilCtrl->clearParametersByClass("ilrepositorygui");
63 return true;
64 }
65 return true;
66 }
67}
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 $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26