ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilContainerSelectionExplorer.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 include_once('./Services/UIComponent/Explorer/classes/class.ilExplorer.php');
25 
36 {
40  protected $access;
41 
45  protected $lng;
46 
47  protected $target_type;
48 
52  public function __construct($a_target)
53  {
54  global $DIC;
55 
56  $this->access = $DIC->access();
57  $this->lng = $DIC->language();
58  $tree = $DIC->repositoryTree();
59 
60  parent::__construct($a_target);
61 
62  $this->tree = $tree;
63  $this->root_id = $this->tree->readRootId();
64  $this->order_column = "title";
65 
66  $this->setSessionExpandVariable("ref_repexpand");
67 
68 
69  $this->addFilter("root");
70  $this->addFilter("cat");
71  $this->addFilter("grp");
72  #$this->addFilter("fold");
73  $this->addFilter("crs");
74 
76  $this->setFiltered(true);
78 
79  $this->checkPermissions(true);
80  }
81 
87  public function setTargetType($a_type)
88  {
89  $this->target_type = $a_type;
90  }
91 
97  public function getTargetType()
98  {
99  return $this->target_type;
100  }
101 
107  public function isClickable($a_type, $a_id = 0)
108  {
109  $ilAccess = $this->access;
110 
111  if ($this->getTargetType() == $a_type) {
112  if ($ilAccess->checkAccess('visible', '', $a_id)) {
113  return true;
114  }
115  }
116  return false;
117  }
118 
125  public function isVisible($a_ref_id, $a_type)
126  {
127  $ilAccess = $this->access;
128 
129  return $ilAccess->checkAccess('visible', '', $a_ref_id);
130  }
131 
138  public function formatHeader($a_tpl, $a_obj_id, $a_option)
139  {
140  $lng = $this->lng;
141 
142  $tpl = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
143 
144  $tpl->setCurrentBlock("text");
145  $tpl->setVariable("OBJ_TITLE", $lng->txt("repository"));
146  $tpl->parseCurrentBlock();
147 
148  $this->output[] = $tpl->get();
149  }
150 }
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.
isVisible($a_ref_id, $a_type)
Visible permission is sufficient.
const IL_FM_POSITIVE
checkPermissions($a_check)
check permissions via rbac
formatHeader($a_tpl, $a_obj_id, $a_option)
overwritten method from base class public
setFiltered($a_bool)
active/deactivate the filter public
$a_type
Definition: workflow.php:92
special template class to simplify handling of ITX/PEAR
Class ilExplorer class for explorer view in admin frame.
isClickable($a_type, $a_id=0)
check if item is clickable
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter public