ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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, ilObject\_lookupObjId(), ilObject\_lookupType(), and ilMemberViewSettings\getInstance().

Referenced by ilContainerGUI\renderObject().

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  // 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  }
static _lookupObjId(int $ref_id)
global $DIC
Definition: shib_login.php:22
global $lng
Definition: privfeed.php:31
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: