ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilSearchRootSelector.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2001 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/*
25* Repository Explorer
26*
27* @author Stefan Meyer <meyer@leifos.com>
28* @version $Id$
29*
30* @package core
31*/
32
33require_once("./Services/UIComponent/Explorer/classes/class.ilExplorer.php");
34
36{
37
45 var $ctrl;
46
55 function ilSearchRootSelector($a_target)
56 {
57 global $tree,$ilCtrl;
58
59 $this->ctrl = $ilCtrl;
60
61 parent::ilExplorer($a_target);
62 $this->tree = $tree;
63 $this->root_id = $this->tree->readRootId();
64 $this->order_column = "title";
65
66 $this->setSessionExpandVariable("search_root_expand");
67
68 // add here all container objects
69 $this->addFilter("root");
70 $this->addFilter("cat");
71 $this->addFilter("grp");
72 $this->addFilter("fold");
73 $this->addFilter("crs");
74 $this->setClickableTypes(array("root", "cat", "grp", "fold", "crs"));
75
76 $this->setFiltered(true);
78
80 }
81
82 function setClickableTypes($a_types)
83 {
84 $this->clickable_types = $a_types;
85 }
86
87 function isClickable($a_type, $a_ref_id = 0)
88 {
89 if (in_array($a_type, $this->clickable_types))
90 {
91 return true;
92 }
93 return false;
94 }
95
96 function setTargetClass($a_class)
97 {
98 $this->target_class = $a_class;
99 }
100 function getTargetClass()
101 {
102 return $this->target_class ? $this->target_class : 'ilsearchgui';
103 }
104 function setCmd($a_cmd)
105 {
106 $this->cmd = $a_cmd;
107 }
108 function getCmd()
109 {
110 return $this->cmd ? $this->cmd : 'selectRoot';
111 }
112
113 function setSelectableType($a_type)
114 {
115 $this->selectable_type = $a_type;
116 }
117 function setRefId($a_ref_id)
118 {
119 $this->ref_id = $a_ref_id;
120 }
121
122
123 function buildLinkTarget($a_node_id, $a_type)
124 {
125 $this->ctrl->setParameterByClass($this->getTargetClass(),"root_id",$a_node_id);
126
127 return $this->ctrl->getLinkTargetByClass($this->getTargetClass(),$this->getCmd());
128
129 }
130
131 function buildFrameTarget($a_type, $a_child = 0, $a_obj_id = 0)
132 {
133 return '';
134 }
135
136 function showChilds($a_ref_id)
137 {
138 global $rbacsystem;
139
140 if ($a_ref_id == 0)
141 {
142 return true;
143 }
144
145 if ($rbacsystem->checkAccess("read", $a_ref_id))
146 {
147 return true;
148 }
149 else
150 {
151 return false;
152 }
153 }
154
155
163 function formatHeader(&$tpl,$a_option)
164 {
165 global $lng, $ilias;
166
167 #$tpl = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
168
169 if (in_array("root", $this->clickable_types))
170 {
171 $tpl->setCurrentBlock("link");
172 //$tpl->setVariable("LINK_NAME",$lng->txt('repository'));
173
174 $this->ctrl->setParameterByClass($this->getTargetClass(),'root_id',ROOT_FOLDER_ID);
175 $tpl->setVariable("LINK_TARGET",$this->ctrl->getLinkTargetByClass($this->getTargetClass(),$this->getCmd()));
176 $tpl->setVariable("TITLE", $lng->txt("repository"));
177
178 $tpl->parseCurrentBlock();
179 }
180
181 #$this->output[] = $tpl->get();
182
183 return true;
184 }
185
186} // END class ilRepositoryExplorer
187?>
global $tpl
Definition: ilias.php:8
const IL_FM_POSITIVE
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 @access public
setTitleLength($a_length)
Set max title length.
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
setFiltered($a_bool)
active/deactivate the filter @access public
const TITLE_LENGTH
max length of object title
buildLinkTarget($a_node_id, $a_type)
get link target (may be overwritten by derived classes)
formatHeader(&$tpl, $a_option)
overwritten method from base class @access public
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
isClickable($a_type, $a_ref_id=0)
check if links for certain object type are activated
ilSearchRootSelector($a_target)
Constructor @access public.
showChilds($a_ref_id)
determines wether the childs of an object should be shown or not note: this standard implementation a...
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40