ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilGroupActionTargetExplorerGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
5
15{
19 protected $select_parent = false;
20
24 public function __construct($a_parent_obj, $a_parent_cmd, $a_select_parent = false)
25 {
26 global $DIC;
27
28 $user = $DIC->user();
29
30 parent::__construct($a_parent_obj, $a_parent_cmd, null, "", "");
31 $this->select_parent = $a_select_parent;
32
33 // open paths to objects with access
34 if ($a_select_parent) {
35 $ref_ids = ilUtil::_getObjectsByOperations(array("root", "crs", "cat"), "create_grp", $user->getId(), 5);
36 } else {
37 $ref_ids = ilUtil::_getObjectsByOperations("grp", "manage_members", $user->getId(), 5);
38 }
39 foreach ($ref_ids as $ref_id) {
40 $this->setPathOpen($ref_id);
41 }
42 }
43
49 public function setClickableType($a_val)
50 {
51 $this->clickable_type = $a_val;
52 }
53
59 public function getClickableType()
60 {
61 return $this->clickable_type;
62 }
63
67 public function getNodeOnClick($a_node)
68 {
69 if ($this->select_parent) {
70 $this->ctrl->setParameter($this->parent_obj, "grp_act_par_ref_id", $a_node["child"]);
71 $url = $this->ctrl->getLinkTarget($this->parent_obj, "createGroup", "", true, false);
72 return "il.Group.UserActions.initCreationForm(event, '$url'); return false;";
73 }
74 $this->ctrl->setParameter($this->parent_obj, "grp_act_ref_id", $a_node["child"]);
75 $url = $this->ctrl->getLinkTarget($this->parent_obj, "confirmAddUser", "", true, false);
76 return "event.stopPropagation(); il.Util.ajaxReplaceInner('$url', 'il_grp_action_modal_content'); return false;";
77 }
78
85 public function isNodeClickable($a_node)
86 {
87 if ($this->select_parent) {
88 if ($this->access->checkAccess("create", "", $a_node["child"], "grp")) {
89 return true;
90 }
91 } else {
92 if ($a_node["type"] == $this->getClickableType() &&
93 $this->access->checkAccess("manage_members", "", $a_node["child"])) {
94 return true;
95 }
96 }
97 return false;
98 }
99}
An exception for terminatinating execution or to throw for unit testing.
__construct($a_parent_obj, $a_parent_cmd, $a_select_parent=false)
Constructor.
Explorer for selecting repository items.
setPathOpen($a_id)
Set node path to be opened.
static _getObjectsByOperations($a_obj_type, $a_operation, $a_usr_id=0, $limit=0)
Get all objects of a specific type and check access This function is not recursive,...
$url
global $DIC
Definition: saml.php:7