4 require_once
'Services/Repository/classes/class.ilRepositoryExplorer.php';
48 $this->lng = $DIC->language();
53 $this->access = $a_access_handler;
55 parent::__construct($a_target);
61 $root =
new $root(null);
68 $this->tree = $a_tree;
70 $this->order_column =
'title';
74 $this->filter =
array();
89 $this->access->checkAccess(
'read',
'', $a_ref_id)) {
107 if (is_array($this->clickable) && in_array(
$a_type, $this->clickable) &&
116 $this->form_items[
$type] =
true;
120 $this->form_items[
$type] =
false;
124 $this->form_items =
array();
128 $this->checked_items = $a_checked_items;
132 return in_array($a_id, $this->checked_items) ? true :
false;
136 $this->post_var = $a_post_var;
145 if (!array_key_exists(
$a_type, $this->form_items) || !$this->form_items[
$a_type]) {
149 switch ($this->type) {
150 case self::SEL_TYPE_CHECK:
153 case self::SEL_TYPE_RADIO:
162 if (!isset($a_node_id) or !is_array($a_option)) {
163 require_once
'./Services/Exceptions/classes/class.ilException.php';
164 throw new ilException(
"Missing parameter or wrong datatype! " .
165 "node_id: " . $a_node_id .
" options:" . var_dump($a_option));
169 foreach ($a_option[
"tab"] as $picture) {
170 if ($picture ==
'plus') {
171 $tpl->setCurrentBlock(
"expander");
172 $tpl->setVariable(
"EXP_DESC",
$lng->txt(
"expand"));
174 $tpl->setVariable(
"LINK_NAME", $a_node_id);
175 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
176 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/plus.png"));
177 $tpl->parseCurrentBlock();
181 if ($picture ==
'minus' && $this->show_minus) {
182 $tpl->setCurrentBlock(
"expander");
183 $tpl->setVariable(
"EXP_DESC",
$lng->txt(
"collapse"));
185 $tpl->setVariable(
"LINK_NAME", $a_node_id);
186 $tpl->setVariable(
"LINK_TARGET_EXPANDER",
$target);
187 $tpl->setVariable(
"IMGPATH", $this->
getImage(
"browser/minus.png"));
188 $tpl->parseCurrentBlock();
194 $tpl->setCurrentBlock(
"blank");
195 $tpl->setVariable(
"BLANK_PATH", $this->
getImage(
"browser/blank.png"));
196 $tpl->parseCurrentBlock();
199 if ($this->output_icons) {
200 $tpl->setCurrentBlock(
"icon");
201 $tpl->setVariable(
"ICON_IMAGE", $this->
getImage(
"icon_" . $a_option[
"type"] .
".svg", $a_option[
"type"], $a_obj_id));
203 $tpl->setVariable(
"TARGET_ID",
"iconid_" . $a_node_id);
204 $this->iconList[] =
"iconid_" . $a_node_id;
205 $tpl->setVariable(
"TXT_ALT_IMG",
$lng->txt($a_option[
"desc"]));
206 $tpl->parseCurrentBlock();
209 if (strlen($formItem = $this->
buildFormItem($a_node_id, $a_option[
'type']))) {
210 $tpl->setCurrentBlock(
'check');
211 $tpl->setVariable(
'OBJ_CHECK', $formItem);
212 $tpl->parseCurrentBlock();
215 if ($this->
isClickable($a_option[
"type"], $a_node_id, $a_obj_id)) {
216 $tpl->setCurrentBlock(
"link");
224 if ($style_class !=
"") {
225 $tpl->setVariable(
"A_CLASS",
' class="' . $style_class .
'" ');
228 if (($onclick = $this->
buildOnClick($a_node_id, $a_option[
"type"], $a_option[
"title"])) !=
"") {
229 $tpl->setVariable(
"ONCLICK",
"onClick=\"$onclick\"");
232 $tpl->setVariable(
"LINK_NAME", $a_node_id);
234 $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]),
239 $this->
buildDescription($a_option[
"description"], $a_node_id, $a_option[
"type"]),
243 $frame_target = $this->
buildFrameTarget($a_option[
"type"], $a_node_id, $a_option[
"obj_id"]);
244 if ($frame_target !=
"") {
245 $tpl->setVariable(
"TARGET",
" target=\"" . $frame_target .
"\"");
247 $tpl->parseCurrentBlock();
249 $tpl->setCurrentBlock(
"text");
251 $this->
buildTitle($a_option[
"title"], $a_node_id, $a_option[
"type"]),
260 $tpl->parseCurrentBlock();
263 $tpl->setCurrentBlock(
"list_item");
264 $tpl->parseCurrentBlock();
265 $tpl->touchBlock(
"element");
282 $tpl->setCurrentBlock(
"icon");
283 $title = $this->tree->getNodeData($this->root_id);
291 $tpl->parseCurrentBlock();
293 if (strlen($formItem = $this->
buildFormItem($a_obj_id, $a_option[
'type']))) {
294 $tpl->setCurrentBlock(
'check');
295 $tpl->setVariable(
'OBJ_CHECK', $formItem);
296 $tpl->parseCurrentBlock();
309 $this->custom_link_target = $a_target;
314 if (!$this->custom_link_target) {
315 return parent::buildLinkTarget($a_node_id,
$a_type);
318 $link = $this->custom_link_target .
"&" . $this->target_get .
"=" . $a_node_id;
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static getClassByType($a_obj_type)
Get class by type.
sortNodes($a_nodes, $a_parent_obj_id)
formatObject($tpl, $a_node_id, $a_option, $a_obj_id=0)
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
getNodeStyleClass($a_id, $a_type)
get style class for node
showChilds($a_ref_id, $a_obj_id=0)
buildLinkTarget($a_node_id, $a_type)
addFormItemForType($type)
createReference($a_object_id)
Create workspace reference for object.
formatHeader($tpl, $a_obj_id, $a_option)
getTreeId()
get tree id public
isClickable($a_type, $a_ref_id=0, $a_obj_id=0)
Access handler for personal workspace.
removeFormItemForType($type)
Tree handler for personal workspace.
setFiltered($a_bool)
active/deactivate the filter public
createTarget($a_type, $a_node_id, $a_highlighted_subtree=false, $a_append_anch=true)
Creates Get Parameter private.
buildOnClick($a_node_id, $a_type, $a_title)
get onclick event handling (may be overwritten by derived classes)
buildFormItem($a_node_id, $a_type)
__construct($a_type, $a_target, $a_session_variable, ilWorkspaceTree $a_tree, ilWorkspaceAccessHandler $a_access_handler)
Constructor public.
getImage($a_name, $a_type="", $a_obj_id="")
get image path
setCheckedItems($a_checked_items=array())
setTypeClickable($a_type)
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
STATIC, do not use $this inside!
Create styles array
The data for the language used.
static formRadioButton($checked, $varname, $value, $onclick=null, $disabled=false)
??? public
buildTitle($a_title, $a_id, $a_type)
standard implementation for title, may be overwritten by derived classes
isVisible($a_ref_id, $a_type)
setSessionExpandVariable($a_var_name="expand")
set name of expand session variable
addFilter($a_item)
adds item to the filter public
setCustomLinkTarget($a_target)
addTree($a_tree_id, $a_node_id=-1)
create a new tree to do: ???
buildDescription($a_desc, $a_id, $a_type)
standard implementation for description, may be overwritten by derived classes
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
readRootId()
read root id from database