ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
69 public function getNodeHref($a_node)
70 {
71 return "#";
72 }
73
77 public function getNodeOnClick($a_node)
78 {
79 if ($this->select_parent) {
80 $this->ctrl->setParameter($this->parent_obj, "grp_act_par_ref_id", $a_node["child"]);
81 $url = $this->ctrl->getLinkTarget($this->parent_obj, "createGroup", "", true, false);
82 return "il.Group.UserActions.initCreationForm(event, '$url'); return false;";
83 }
84 $this->ctrl->setParameter($this->parent_obj, "grp_act_ref_id", $a_node["child"]);
85 $url = $this->ctrl->getLinkTarget($this->parent_obj, "confirmAddUser", "", true, false);
86 return "event.stopPropagation(); event.preventDefault(); il.Util.ajaxReplaceInner('$url', 'il_grp_action_modal_content'); return false;";
87 }
88
95 public function isNodeClickable($a_node)
96 {
97 if ($this->select_parent) {
98 if ($this->access->checkAccess("create", "", $a_node["child"], "grp")) {
99 return true;
100 }
101 } else {
102 if ($a_node["type"] == $this->getClickableType() &&
103 $this->access->checkAccess("manage_members", "", $a_node["child"])) {
104 return true;
105 }
106 }
107 return false;
108 }
109}
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,...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$url
$DIC
Definition: xapitoken.php:46