ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilRoleDesktopItemSelector.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 /*
5 * Repository Explorer
6 *
7 * @author Stefan Meyer <meyer@leifos.com>
8 * @version $Id$
9 *
10 */
11 
12 require_once("./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
13 
14 
16 {
17 
23  public $role_desk_obj = null;
24 
25 
26  public $root_id;
27  public $output;
28  public $ctrl;
29 
31  public $ref_id;
38  public function __construct($a_target, $role_desk_item_obj)
39  {
40  global $DIC;
41 
42  $tree = $DIC['tree'];
43  $ilCtrl = $DIC['ilCtrl'];
44 
45  $this->ctrl = $ilCtrl;
46 
47  $this->role_desk_obj = &$role_desk_item_obj;
48 
49  parent::__construct($a_target);
50  $this->tree = $tree;
51  $this->root_id = $this->tree->readRootId();
52  $this->order_column = "title";
53 
54  $this->setSessionExpandVariable("role_desk_item_link_expand");
55 
56  $this->addFilter("adm");
57  $this->addFilter("rolf");
58  #$this->addFilter("chat");
59  #$this->addFilter('fold');
60 
62  $this->setFiltered(true);
63 
65  }
66 
67  public function buildLinkTarget($a_node_id, $a_type)
68  {
69  $this->ctrl->setParameterByClass('ilobjrolegui', 'item_id', $a_node_id);
70  return $this->ctrl->getLinkTargetByClass('ilobjrolegui', 'assignDesktopItem');
71  }
72 
73  public function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
74  {
75  return '';
76  }
77 
78  public function isClickable($a_type, $a_ref_id = 0)
79  {
80  global $DIC;
81 
82  $rbacsystem = $DIC['rbacsystem'];
83 
84  return $rbacsystem->checkAccess('write', $a_ref_id) and !$this->role_desk_obj->isAssigned($a_ref_id);
85  }
86 
87  public function showChilds($a_ref_id)
88  {
89  global $DIC;
90 
91  $rbacsystem = $DIC['rbacsystem'];
92 
93  if ($a_ref_id) {
94  return $rbacsystem->checkAccess('read', $a_ref_id);
95  }
96  return true;
97  }
98 
99 
107  public function formatHeader($tpl, $a_obj_id, $a_option)
108  {
109  global $DIC;
110 
111  $lng = $DIC['lng'];
112 
113  $tpl = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
114 
115  $tpl->setCurrentBlock("text");
116  $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
117  $tpl->parseCurrentBlock();
118 
119  //$tpl->setCurrentBlock("row");
120  //$tpl->parseCurrentBlock();
121 
122  $this->output[] = $tpl->get();
123  }
124 } // END class ilObjectSelector
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
global $DIC
Definition: saml.php:7
const TITLE_LENGTH
max length of object title
setTitleLength($a_length)
Set max title length.
__construct($a_target, $role_desk_item_obj)
Constructor public.
setFiltered($a_bool)
active/deactivate the filter public
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:92
formatHeader($tpl, $a_obj_id, $a_option)
overwritten method from base class public
special template class to simplify handling of ITX/PEAR
Class ilExplorer class for explorer view in admin frame.
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter public
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
const IL_FM_NEGATIVE