ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
4 include_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 
82  public function getNodeHref($a_node)
83  {
84  return "";
85  }
86 
87 
94  public function isNodeClickable($a_node)
95  {
96  if ($this->select_parent) {
97  if ($this->access->checkAccess("create", "", $a_node["child"], "grp")) {
98  return true;
99  }
100  } else {
101  if ($a_node["type"] == $this->getClickableType() &&
102  $this->access->checkAccess("manage_members", "", $a_node["child"])) {
103  return true;
104  }
105  }
106  return false;
107  }
108 }
__construct($a_parent_obj, $a_parent_cmd, $a_select_parent=false)
Constructor.
Explorer for selecting repository items.
global $DIC
Definition: saml.php:7
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, instead it parses the serialized rbac_pa entries.
setPathOpen($a_id)
Set node path to be opened.
$user
Definition: migrateto20.php:57
$url