ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilMemberViewGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilMemberViewGUI:

Static Public Member Functions

static showMemberViewSwitch (int $a_ref_id)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Stefan Meyer <meyer.leifos.com>

Definition at line 22 of file class.ilMemberViewGUI.php.

Member Function Documentation

◆ showMemberViewSwitch()

static ilMemberViewGUI::showMemberViewSwitch ( int  $a_ref_id)
static

Definition at line 24 of file class.ilMemberViewGUI.php.

References $DIC, $lng, ILIAS\LTI\ToolProvider\$settings, ilObject\_lookupObjId(), ilObject\_lookupType(), and ilMemberViewSettings\getInstance().

Referenced by ilContainerGUI\prepareOutput().

24  : 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 
47  // TODO: check edit_permission
48 
50 
51  $isCourseOrGroupContentTab =
52  (
53  $ilCtrl->getCmd() === 'view' &&
54  ($type === 'crs' || $type === 'grp')
55  ) || (
56  $ilCtrl->getCmd() === '' &&
57  $type === 'crs' &&
58  strtolower($ilCtrl->getCmdClass()) === 'ilobjcoursegui'
59  ) || (
60  $ilCtrl->getCmd() === '' &&
61  $type === 'grp' &&
62  strtolower($ilCtrl->getCmdClass()) === 'ilobjgroupgui'
63  );
64 
65  if (
66  $isCourseOrGroupContentTab &&
67  $ilAccess->checkAccess('write', '', $a_ref_id)
68  ) {
69  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $a_ref_id);
70  $ilCtrl->setParameterByClass("ilrepositorygui", "mv", "1");
71  $ilCtrl->setParameterByClass("ilrepositorygui", "set_mode", "flat");
72  $ilToolbar->addComponent(
73  $ui->factory()->button()->standard(
74  $lng->txt('mem_view_activate'),
75  $ilCtrl->getLinkTargetByClass("ilrepositorygui", "")
76  )
77  );
78  $ilCtrl->clearParametersByClass("ilrepositorygui");
79  return true;
80  }
81  return true;
82  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
$lng
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: