ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilExplorer Class Reference

Class ilExplorer class for explorer view in admin frame. More...

+ Inheritance diagram for ilExplorer:
+ Collaboration diagram for ilExplorer:

Public Member Functions

 ilExplorer ($a_target)
 Constructor @access public. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get id. More...
 
 setAsynchExpanding ($a_val)
 Set asynch expanding. More...
 
 getAsynchExpanding ()
 Get asynch expanding. More...
 
 initItemCounter ($a_number)
 Init item counter. More...
 
 setTitle ($a_val)
 Set title. More...
 
 setTitleLength ($a_length)
 Set max title length. More...
 
 getTitleLength ()
 Get max title length. More...
 
 getTitle ()
 Get title. More...
 
 setRoot ($a_root_id)
 Set root node. More...
 
 getRoot ()
 get root id More...
 
 setOrderColumn ($a_column)
 set the order column @access public More...
 
 setOrderDirection ($a_direction)
 set the order direction @access public More...
 
 setTargetGet ($a_target_get)
 set the varname in Get-string @access public More...
 
 setParamsGet ($a_params_get)
 set additional params to be passed in Get-string @access public More...
 
 setExpandTarget ($a_exp_target)
 target script for expand icons More...
 
 setFrameUpdater ($a_up_frame, $a_up_script, $a_params="")
 Set Explorer Updater. More...
 
 highlightNode ($a_id)
 set highlighted node More...
 
 checkPermissions ($a_check)
 check permissions via rbac More...
 
 setSessionExpandVariable ($a_var_name="expand")
 set name of expand session variable More...
 
 outputIcons ($a_icons)
 output icons More...
 
 setClickable ($a_type, $a_clickable)
 (de-)activates links for a certain object type More...
 
 isVisible ($a_ref_id, $a_type)
 
 setTreeLead ($a_val)
 Set tree leading content. More...
 
 getTreeLead ()
 Get tree leading content. More...
 
 isClickable ($a_type, $a_ref_id=0)
 check if links for certain object type are activated More...
 
 setPostSort ($a_sort)
 process post sorting More...
 
 setFilterMode ($a_mode=IL_FM_NEGATIVE)
 set filter mode More...
 
 getFilterMode ()
 get filter mode More...
 
 setUseStandardFrame ($a_val)
 Set use standard frame. More...
 
 getUseStandardFrame ()
 Get use standard explorer frame. More...
 
 getChildsOfNode ($a_parent_id)
 Get childs of node. More...
 
 setOutput ($a_parent_id, $a_depth=1, $a_obj_id=0, $a_highlighted_subtree=false)
 Creates output for explorer view in admin menue recursive method @access public. More...
 
 modifyChilds ($a_parent_id, $a_objects)
 
 showChilds ($a_parent_id)
 determines wether the childs of an object should be shown or not note: this standard implementation always returns true but it could be overwritten by derived classes (e.g. More...
 
 forceExpanded ($a_obj_id)
 force expansion of node More...
 
 getMaximumTreeDepth ()
 Get maximum tree depth. More...
 
 getOutput ()
 Creates output recursive method @access public. More...
 
 handleListEndTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list end tags ( and ) More...
 
 handleListStartTags (&$a_tpl_tree, $a_cur_depth, $a_item_depth)
 handle list start tags ( More...
 
 formatHeader (&$tpl, $a_obj_id, $a_option)
 Creates output for header (is empty here but can be overwritten in derived classes) More...
 
 formatObject (&$tpl, $a_node_id, $a_option, $a_obj_id=0)
 Creates output recursive method @access private. More...
 
 getImage ($a_name, $a_type="", $a_obj_id="")
 get image path (may be overwritten by derived classes) More...
 
 getImageAlt ($a_default_text, $a_type="", $a_obj_id="")
 get image alt text More...
 
 getNodeStyleClass ($a_id, $a_type)
 get style class for node More...
 
 buildLinkTarget ($a_node_id, $a_type)
 get link target (may be overwritten by derived classes) More...
 
 buildOnClick ($a_node_id, $a_type, $a_title)
 get onclick event handling (may be overwritten by derived classes) More...
 
 buildTitle ($a_title, $a_id, $a_type)
 standard implementation for title, may be overwritten by derived classes More...
 
 buildDescription ($a_desc, $a_id, $a_type)
 standard implementation for description, may be overwritten by derived classes More...
 
 buildSelect ($a_node_id, $a_type)
 standard implementation for adding an option select box between image and title More...
 
 buildFrameTarget ($a_type, $a_child=0, $a_obj_id=0)
 get frame target (may be overwritten by derived classes) More...
 
 createTarget ($a_type, $a_node_id, $a_highlighted_subtree=false, $a_append_anch=true)
 Creates Get Parameter @access private. More...
 
 setFrameTarget ($a_target)
 set target frame or not frame? More...
 
 createLines ($a_depth)
 Creates lines for explorer view @access private. More...
 
 is_in_array ($a_start, $a_depth)
 DESCRIPTION MISSING @access private. More...
 
 getIndex ($a_data)
 get index of format_options array from specific ref_id,parent_id @access private More...
 
 addFilter ($a_item)
 adds item to the filter @access public More...
 
 delFilter ($a_item)
 removes item from the filter @access public More...
 
 setExpand ($a_node_id)
 set the expand option this value is stored in a SESSION variable to save it different view (lo view, frm view,...) @access private More...
 
 forceExpandAll ($a_mode, $a_show_minus=true)
 force expandAll. More...
 
 setFiltered ($a_bool)
 active/deactivate the filter @access public More...
 
 checkFilter ($a_item)
 check if item is in filter @access private More...
 
 sortNodes ($a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array @access private More...
 

Data Fields

 $id
 
 $ilias
 
 $output
 
 $format_options
 
 $tree
 
 $target
 
 $target_get
 
 $params_get
 
 $expanded
 
 $order_column
 
 $order_direction = "asc"
 
 $expand_target
 
 $rbac_check
 
 $output_icons
 
 $expand_variable
 
 $is_clickable
 
 $post_sort
 
 $filtered = false
 
 $filter_mode
 
 $expand_all = false
 
 $root_id = null
 
 $use_standard_frame = false
 

Detailed Description

Class ilExplorer class for explorer view in admin frame.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 16 of file class.ilExplorer.php.

Member Function Documentation

◆ addFilter()

ilExplorer::addFilter (   $a_item)

adds item to the filter @access public

Parameters
stringobject type to add
Returns
boolean

Definition at line 1353 of file class.ilExplorer.php.

1354 {
1355 $ispresent = 0;
1356
1357 if (is_array($this->filter))
1358 {
1359 //run through filter
1360 foreach ($this->filter as $item)
1361 {
1362 if ($item == $a_item)
1363 {
1364 $is_present = 1;
1365
1366 return false;
1367 }
1368 }
1369 }
1370 else
1371 {
1372 $this->filter = array();
1373 }
1374 if ($is_present == 0)
1375 {
1376 $this->filter[] = $a_item;
1377 }
1378
1379 return true;
1380 }

Referenced by ilContainerSelectionExplorer\__construct(), ilECSNodeMappingLocalExplorer\__construct(), ilSurveySkillExplorer\__construct(), ilPasteIntoMultipleItemsExplorer\__construct(), ilWorkspaceExplorer\__construct(), ilExplorer(), ilLMMenuObjectSelector\ilLMMenuObjectSelector(), ilRepositoryCopySelector\ilRepositoryCopySelector(), ilRepositoryExplorer\ilRepositoryExplorer(), ilRepositoryLinkSelector\ilRepositoryLinkSelector(), ilRoleDesktopItemSelector\ilRoleDesktopItemSelector(), ilSearchRootSelector\ilSearchRootSelector(), and ilSolutionExplorer\ilSolutionExplorer().

+ Here is the caller graph for this function:

◆ buildDescription()

ilExplorer::buildDescription (   $a_desc,
  $a_id,
  $a_type 
)

standard implementation for description, may be overwritten by derived classes

Reimplemented in ilWorkspaceFolderExplorer.

Definition at line 1183 of file class.ilExplorer.php.

1184 {
1185 return "";
1186 }

Referenced by ilPasteIntoMultipleItemsExplorer\formatObject(), ilWorkspaceExplorer\formatObject(), formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), and ilECSNodeMappingLocalExplorer\formatObject().

+ Here is the caller graph for this function:

◆ buildFrameTarget()

ilExplorer::buildFrameTarget (   $a_type,
  $a_child = 0,
  $a_obj_id = 0 
)

◆ buildLinkTarget()

ilExplorer::buildLinkTarget (   $a_node_id,
  $a_type 
)

get link target (may be overwritten by derived classes)

Reimplemented in ilLMMenuObjectSelector, ilGlossarySelectorGUI, ilAsyncContainerSelectionExplorer, ilSurveySkillExplorer, ilSolutionExplorer, ilWorkspaceFolderExplorer, ilRoleDesktopItemSelector, ilAdministrationExplorer, ilFileSelectorGUI, ilObjectSelector, ilShopRepositoryExplorer, ilWorkspaceExplorer, ilRepositoryCopySelector, ilRepositoryExplorer, ilRepositoryLinkSelector, and ilSearchRootSelector.

Definition at line 1156 of file class.ilExplorer.php.

1157 {
1158 $target = (strpos($this->target, "?") === false)
1159 ? $this->target."?"
1160 : $this->target."&";
1161 return $target.$this->target_get."=".$a_node_id.$this->params_get;
1162 }

References $target.

Referenced by ilAICCExplorer\formatObject(), ilHACPExplorer\formatObject(), formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), and ilECSNodeMappingLocalExplorer\formatObject().

+ Here is the caller graph for this function:

◆ buildOnClick()

ilExplorer::buildOnClick (   $a_node_id,
  $a_type,
  $a_title 
)

get onclick event handling (may be overwritten by derived classes)

Reimplemented in ilAsyncContainerSelectionExplorer.

Definition at line 1167 of file class.ilExplorer.php.

1168 {
1169 return "";
1170 }

Referenced by ilPasteIntoMultipleItemsExplorer\formatObject(), ilWorkspaceExplorer\formatObject(), formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), and ilECSNodeMappingLocalExplorer\formatObject().

+ Here is the caller graph for this function:

◆ buildSelect()

ilExplorer::buildSelect (   $a_node_id,
  $a_type 
)

standard implementation for adding an option select box between image and title

Reimplemented in ilCopyWizardExplorer.

Definition at line 1191 of file class.ilExplorer.php.

1192 {
1193 return "";
1194 }

Referenced by formatObject().

+ Here is the caller graph for this function:

◆ buildTitle()

ilExplorer::buildTitle (   $a_title,
  $a_id,
  $a_type 
)

standard implementation for title, may be overwritten by derived classes

Reimplemented in ilSurveySkillExplorer, ilECSNodeMappingCmsExplorer, and ilECSNodeMappingLocalExplorer.

Definition at line 1175 of file class.ilExplorer.php.

1176 {
1177 return $a_title;
1178 }

Referenced by ilPasteIntoMultipleItemsExplorer\formatObject(), ilWorkspaceExplorer\formatObject(), and formatObject().

+ Here is the caller graph for this function:

◆ checkFilter()

ilExplorer::checkFilter (   $a_item)

check if item is in filter @access private

Parameters
string
Returns
integer

Definition at line 1482 of file class.ilExplorer.php.

1483 {
1484 if (is_array($this->filter))
1485 {
1486 if (in_array($a_item, $this->filter))
1487 {
1488 $ret = true;
1489 }
1490 else
1491 {
1492 $ret = false;
1493 }
1494 }
1495 else
1496 {
1497 $ret = false;
1498 }
1499
1500 if ($this->getFilterMode() == IL_FM_NEGATIVE )
1501 {
1502 return $ret;
1503 }
1504 else
1505 {
1506 return !$ret;
1507 }
1508 }
const IL_FM_NEGATIVE
getFilterMode()
get filter mode

References $ret, getFilterMode(), and IL_FM_NEGATIVE.

Referenced by ilAICCExplorer\setOutput(), and setOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkPermissions()

ilExplorer::checkPermissions (   $a_check)

check permissions via rbac

Parameters
boolean$a_checkcheck true/false

Definition at line 431 of file class.ilExplorer.php.

432 {
433 $this->rbac_check = $a_check;
434 }

Referenced by ilContainerSelectionExplorer\__construct(), ilSurveySkillExplorer\__construct(), ilAICCExplorer\__construct(), ilSCORMExplorer\__construct(), and ilHACPExplorer\ilHACPExplorer().

+ Here is the caller graph for this function:

◆ createLines()

ilExplorer::createLines (   $a_depth)

Creates lines for explorer view @access private.

Parameters
integer

Definition at line 1264 of file class.ilExplorer.php.

1265 {
1266 for ($i = 0; $i < count($this->format_options); ++$i)
1267 {
1268 if ($this->format_options[$i]["depth"] == $a_depth+1
1269 and !$this->format_options[$i]["container"]
1270 and $this->format_options[$i]["depth"] != 1)
1271 {
1272 $this->format_options[$i]["tab"]["$a_depth"] = "quer";
1273 }
1274
1275 if ($this->format_options[$i]["depth"] == $a_depth+2)
1276 {
1277 if ($this->is_in_array($i+1,$this->format_options[$i]["depth"]))
1278 {
1279 $this->format_options[$i]["tab"]["$a_depth"] = "winkel";
1280 }
1281 else
1282 {
1283 $this->format_options[$i]["tab"]["$a_depth"] = "ecke";
1284 }
1285 }
1286
1287 if ($this->format_options[$i]["depth"] > $a_depth+2)
1288 {
1289 if ($this->is_in_array($i+1,$a_depth+2))
1290 {
1291 $this->format_options[$i]["tab"]["$a_depth"] = "hoch";
1292 }
1293 }
1294 }
1295 }
is_in_array($a_start, $a_depth)
DESCRIPTION MISSING @access private.

References is_in_array().

Referenced by getOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createTarget()

ilExplorer::createTarget (   $a_type,
  $a_node_id,
  $a_highlighted_subtree = false,
  $a_append_anch = true 
)

Creates Get Parameter @access private.

Parameters
string
integer
Returns
string

Definition at line 1213 of file class.ilExplorer.php.

1214 {
1215 if (!isset($a_type) or !is_string($a_type) or !isset($a_node_id))
1216 {
1217 $this->ilias->raiseError(get_class($this)."::createTarget(): Missing parameter or wrong datatype! ".
1218 "type: ".$a_type." node_id:".$a_node_id,$this->ilias->error_obj->WARNING);
1219 }
1220
1221 // SET expand parameter:
1222 // positive if object is expanded
1223 // negative if object is compressed
1224 $a_node_id = $a_type == '+' ? $a_node_id : -(int) $a_node_id;
1225
1226 $sep = (is_int(strpos($this->expand_target, "?")))
1227 ? "&"
1228 : "?";
1229
1230 // in current tree flag
1231 $ict_str = ($a_highlighted_subtree || $this->highlighted == "")
1232 ? "&ict=1"
1233 : "";
1234 if ($this->getAsynchExpanding())
1235 {
1236 $ict_str.= "&cmdMode=asynch";
1237 }
1238 if ($a_append_anch)
1239 {
1240 return $this->expand_target.$sep.$this->expand_variable."=".$a_node_id.$this->params_get.$ict_str."#".abs($a_node_id);
1241 }
1242 else
1243 {
1244 return $this->expand_target.$sep.$this->expand_variable."=".$a_node_id.$this->params_get.$ict_str;
1245 }
1246 }
getAsynchExpanding()
Get asynch expanding.
redirection script todo: (a better solution should control the processing via a xml file)

References getAsynchExpanding().

Referenced by ilPasteIntoMultipleItemsExplorer\formatObject(), ilWorkspaceExplorer\formatObject(), formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), and ilECSNodeMappingLocalExplorer\formatObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delFilter()

ilExplorer::delFilter (   $a_item)

removes item from the filter @access public

Parameters
stringobject type to remove
Returns
boolean

Definition at line 1388 of file class.ilExplorer.php.

1389 {
1390 //check if a filter exists
1391 if (is_array($this->filter))
1392 {
1393 //build copy of the existing filter without the given item
1394 $tmp = array();
1395
1396 foreach ($this->filter as $item)
1397 {
1398 if ($item != $a_item)
1399 {
1400 $tmp[] = $item;
1401 }
1402 else
1403 {
1404 $deleted = 1;
1405 }
1406 }
1407
1408 $this->filter = $tmp;
1409 }
1410 else
1411 {
1412 return false;
1413 }
1414
1415 if ($deleted == 1)
1416 {
1417 return true;
1418 }
1419 else
1420 {
1421 return false;
1422 }
1423 }

◆ forceExpandAll()

ilExplorer::forceExpandAll (   $a_mode,
  $a_show_minus = true 
)

force expandAll.

if true all nodes are expanded regardless of the values in $expanded (default: false) @access public

Parameters
boolean

Definition at line 1458 of file class.ilExplorer.php.

1459 {
1460 $this->expand_all = (bool) $a_mode;
1461 $this->show_minus = $a_show_minus;
1462 }

◆ forceExpanded()

ilExplorer::forceExpanded (   $a_obj_id)

force expansion of node

Reimplemented in ilRepositoryExplorer, ilSurveySkillExplorer, ilAdministrationExplorer, and ilFileSelectorGUI.

Definition at line 767 of file class.ilExplorer.php.

768 {
769 return false;
770 }

Referenced by setOutput().

+ Here is the caller graph for this function:

◆ formatHeader()

ilExplorer::formatHeader ( $tpl,
  $a_obj_id,
  $a_option 
)

Creates output for header (is empty here but can be overwritten in derived classes)

@access public

Parameters
integerobj_id
integerarray options

Reimplemented in ilGlossarySelectorGUI, ilAdministrationExplorer, ilFileSelectorGUI, ilPasteIntoMultipleItemsExplorer, ilShopRepositoryExplorer, ilWorkspaceExplorer, ilRepositoryExplorer, ilECSNodeMappingCmsExplorer, and ilECSNodeMappingLocalExplorer.

Definition at line 971 of file class.ilExplorer.php.

972 {
973 }

Referenced by getOutput().

+ Here is the caller graph for this function:

◆ formatObject()

ilExplorer::formatObject ( $tpl,
  $a_node_id,
  $a_option,
  $a_obj_id = 0 
)

Creates output recursive method @access private.

Parameters
integer
array
Returns
string

Reimplemented in ilPasteIntoMultipleItemsExplorer, ilWorkspaceExplorer, ilECSNodeMappingCmsExplorer, and ilECSNodeMappingLocalExplorer.

Definition at line 983 of file class.ilExplorer.php.

984 {
985 global $lng;
986 if (!isset($a_node_id) or !is_array($a_option))
987 {
988 $this->ilias->raiseError(get_class($this)."::formatObject(): Missing parameter or wrong datatype! ".
989 "node_id: ".$a_node_id." options:".var_dump($a_option),$this->ilias->error_obj->WARNING);
990 }
991
992 $pic = false;
993 foreach ((array) $a_option["tab"] as $picture)
994 {
995 if ($picture == 'plus')
996 {
997 $tpl->setCurrentBlock("expander");
998 $tpl->setVariable("EXP_DESC", $lng->txt("collapsed"));
999 $tpl->setVariable("LINK_NAME", $a_node_id);
1000 if (!$this->getAsynchExpanding())
1001 {
1002 $target = $this->createTarget('+',$a_node_id, $a_option["highlighted_subtree"]);
1003 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
1004 }
1005 else
1006 {
1007 $target = $this->createTarget('+',$a_node_id, $a_option["highlighted_subtree"], false);
1008 $tpl->setVariable("ONCLICK_TARGET_EXPANDER", " onclick=\"return il.Explorer.refresh('tree_div', '".$target."');\"");
1009 $tpl->setVariable("LINK_TARGET_EXPANDER", "#");
1010 }
1011 $tpl->setVariable("IMGPATH", $this->getImage("browser/plus.png"));
1012 $tpl->parseCurrentBlock();
1013 $pic = true;
1014 }
1015
1016 if ($picture == 'forceexp')
1017 {
1018 $tpl->setCurrentBlock("expander");
1019 $tpl->setVariable("EXP_DESC", $lng->txt("expanded"));
1020 $target = $this->createTarget('+',$a_node_id);
1021 $tpl->setVariable("LINK_NAME", $a_node_id);
1022 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
1023 $tpl->setVariable("IMGPATH", $this->getImage("browser/forceexp.png"));
1024 $tpl->parseCurrentBlock();
1025 $pic = true;
1026 }
1027
1028 if ($picture == 'minus' && $this->show_minus)
1029 {
1030 $tpl->setCurrentBlock("expander");
1031 $tpl->setVariable("EXP_DESC", $lng->txt("expanded"));
1032 $tpl->setVariable("LINK_NAME", $a_node_id);
1033 if (!$this->getAsynchExpanding())
1034 {
1035 $target = $this->createTarget('-',$a_node_id, $a_option["highlighted_subtree"]);
1036 $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
1037 }
1038 else
1039 {
1040 $target = $this->createTarget('-',$a_node_id, $a_option["highlighted_subtree"], false);
1041 $tpl->setVariable("ONCLICK_TARGET_EXPANDER", " onclick=\"return il.Explorer.refresh('tree_div', '".$target."');\"");
1042 $tpl->setVariable("LINK_TARGET_EXPANDER", "#");
1043 }
1044 $tpl->setVariable("IMGPATH", $this->getImage("browser/minus.png"));
1045 $tpl->parseCurrentBlock();
1046 $pic = true;
1047 }
1048
1049 }
1050
1051 if (!$pic)
1052 {
1053 $tpl->setCurrentBlock("blank");
1054 $tpl->setVariable("BLANK_PATH", $this->getImage("browser/blank.png"));
1055 $tpl->parseCurrentBlock();
1056 }
1057
1058 if ($this->output_icons)
1059 {
1060 $tpl->setCurrentBlock("icon");
1061 $tpl->setVariable("ICON_IMAGE" , $this->getImage("icon_".$a_option["type"].".svg", $a_option["type"], $a_obj_id));
1062
1063 $tpl->setVariable("TARGET_ID" , "iconid_".$a_node_id);
1064 $this->iconList[] = "iconid_".$a_node_id;
1065 $tpl->setVariable("TXT_ALT_IMG",
1066 $this->getImageAlt($lng->txt("icon")." ".$lng->txt($a_option["desc"]), $a_option["type"], $a_obj_id));
1067 $tpl->parseCurrentBlock();
1068 }
1069
1070 if(strlen($sel = $this->buildSelect($a_node_id,$a_option['type'])))
1071 {
1072 $tpl->setCurrentBlock('select');
1073 $tpl->setVariable('OBJ_SEL',$sel);
1074 $tpl->parseCurrentBlock();
1075 }
1076
1077 if ($this->isClickable($a_option["type"], $a_node_id,$a_obj_id)) // output link
1078 {
1079 $tpl->setCurrentBlock("link");
1080 //$target = (strpos($this->target, "?") === false) ?
1081 // $this->target."?" : $this->target."&";
1082 //$tpl->setVariable("LINK_TARGET", $target.$this->target_get."=".$a_node_id.$this->params_get);
1083 $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["type"]));
1084
1085 $style_class = $this->getNodeStyleClass($a_node_id, $a_option["type"]);
1086
1087 if ($style_class != "")
1088 {
1089 $tpl->setVariable("A_CLASS", ' class="'.$style_class.'" ' );
1090 }
1091
1092 if (($onclick = $this->buildOnClick($a_node_id, $a_option["type"], $a_option["title"])) != "")
1093 {
1094 $tpl->setVariable("ONCLICK", "onClick=\"$onclick\"");
1095 }
1096
1097 //$tpl->setVariable("LINK_NAME", $a_node_id);
1098 $tpl->setVariable("TITLE", ilUtil::shortenText(
1099 $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
1100 $this->textwidth, true));
1101 $tpl->setVariable("DESC", ilUtil::shortenText(
1102 $this->buildDescription($a_option["description"], $a_node_id, $a_option["type"]), $this->textwidth, true));
1103 $frame_target = $this->buildFrameTarget($a_option["type"], $a_node_id, $a_option["obj_id"]);
1104 if ($frame_target != "")
1105 {
1106 $tpl->setVariable("TARGET", " target=\"".$frame_target."\"");
1107 }
1108 $tpl->parseCurrentBlock();
1109 }
1110 else // output text only
1111 {
1112 $tpl->setCurrentBlock("text");
1113 $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText(
1114 $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]), $this->textwidth, true));
1115 $tpl->setVariable("OBJ_DESC", ilUtil::shortenText(
1116 $this->buildDescription($a_option["desc"], $a_node_id, $a_option["type"]), $this->textwidth, true));
1117 $tpl->parseCurrentBlock();
1118 }
1119
1120 $tpl->setCurrentBlock("list_item");
1121 $tpl->parseCurrentBlock();
1122 $tpl->touchBlock("element");
1123 }
global $tpl
Definition: ilias.php:8
getNodeStyleClass($a_id, $a_type)
get style class for node
buildOnClick($a_node_id, $a_type, $a_title)
get onclick event handling (may be overwritten by derived classes)
buildSelect($a_node_id, $a_type)
standard implementation for adding an option select box between image and title
getImageAlt($a_default_text, $a_type="", $a_obj_id="")
get image alt text
getImage($a_name, $a_type="", $a_obj_id="")
get image path (may be overwritten by derived classes)
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
createTarget($a_type, $a_node_id, $a_highlighted_subtree=false, $a_append_anch=true)
Creates Get Parameter @access private.
isClickable($a_type, $a_ref_id=0)
check if links for certain object type are activated
buildTitle($a_title, $a_id, $a_type)
standard implementation for title, may be overwritten by derived classes
buildDescription($a_desc, $a_id, $a_type)
standard implementation for description, may be overwritten by derived classes
buildLinkTarget($a_node_id, $a_type)
get link target (may be overwritten by derived classes)
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
global $lng
Definition: privfeed.php:40

References $lng, $target, $tpl, buildDescription(), buildFrameTarget(), buildLinkTarget(), buildOnClick(), buildSelect(), buildTitle(), createTarget(), getAsynchExpanding(), getImage(), getImageAlt(), getNodeStyleClass(), isClickable(), and ilUtil\shortenText().

Referenced by getOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAsynchExpanding()

ilExplorer::getAsynchExpanding ( )

Get asynch expanding.

Returns
boolean

Definition at line 248 of file class.ilExplorer.php.

249 {
250 return $this->asnch_expanding;
251 }

Referenced by createTarget(), and formatObject().

+ Here is the caller graph for this function:

◆ getChildsOfNode()

ilExplorer::getChildsOfNode (   $a_parent_id)

Get childs of node.

Parameters
int$a_parent_idparent id
Returns
array childs

Definition at line 590 of file class.ilExplorer.php.

591 {
592 return $this->tree->getChilds($a_parent_id, $this->order_column);
593 }

Referenced by setOutput().

+ Here is the caller graph for this function:

◆ getFilterMode()

ilExplorer::getFilterMode ( )

get filter mode

Returns
int filter mode IL_FM_NEGATIVE | IL_FM_NEGATIVE

Definition at line 558 of file class.ilExplorer.php.

559 {
560 return $this->filter_mode;
561 }

References $filter_mode.

Referenced by checkFilter().

+ Here is the caller graph for this function:

◆ getId()

ilExplorer::getId ( )

Get id.

Returns
string id

Definition at line 228 of file class.ilExplorer.php.

229 {
230 return $this->id;
231 }

References $id.

Referenced by getOutput(), and ilAsyncContainerSelectionExplorer\initJs().

+ Here is the caller graph for this function:

◆ getImage()

ilExplorer::getImage (   $a_name,
  $a_type = "",
  $a_obj_id = "" 
)

get image path (may be overwritten by derived classes)

Reimplemented in ilSurveySkillExplorer, ilAdministrationExplorer, ilCopyWizardExplorer, and ilRepositoryExplorer.

Definition at line 1128 of file class.ilExplorer.php.

1129 {
1130 return ilUtil::getImagePath($a_name);
1131 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References ilUtil\getImagePath().

Referenced by formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), and ilECSNodeMappingLocalExplorer\formatObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImageAlt()

ilExplorer::getImageAlt (   $a_default_text,
  $a_type = "",
  $a_obj_id = "" 
)

get image alt text

Reimplemented in ilWorkspaceFolderExplorer.

Definition at line 1136 of file class.ilExplorer.php.

1137 {
1138 return $a_default_text;
1139 }

Referenced by formatObject().

+ Here is the caller graph for this function:

◆ getIndex()

ilExplorer::getIndex (   $a_data)

get index of format_options array from specific ref_id,parent_id @access private

Parameters
arrayobject data
Returns
integer index

Definition at line 1327 of file class.ilExplorer.php.

1328 {
1329 if(!is_array($this->format_options))
1330 {
1331 return -1;
1332 }
1333
1334 foreach ($this->format_options as $key => $value)
1335 {
1336 if (($value["child"] == $a_data["parent"]))
1337 {
1338 return $key;
1339 }
1340 }
1341
1342 return -1;
1343 // exit on error
1344 #$this->ilias->raiseError(get_class($this)."::getIndex(): Error in tree. No index found!",$this->ilias->error_obj->FATAL);
1345 }

Referenced by ilAICCExplorer\getParentIndex(), ilWorkspaceFolderExplorer\setOutput(), and setOutput().

+ Here is the caller graph for this function:

◆ getMaximumTreeDepth()

ilExplorer::getMaximumTreeDepth ( )

Get maximum tree depth.

Parameters

return

Definition at line 778 of file class.ilExplorer.php.

779 {
780 $this->tree->getMaximumDepth();
781 }

Referenced by getOutput().

+ Here is the caller graph for this function:

◆ getNodeStyleClass()

ilExplorer::getNodeStyleClass (   $a_id,
  $a_type 
)

get style class for node

Definition at line 1144 of file class.ilExplorer.php.

1145 {
1146 if ($a_id == $this->highlighted)
1147 {
1148 return "il_HighlightedNode";
1149 }
1150 return "";
1151 }

Referenced by ilWorkspaceFolderExplorer\formatHeader(), ilPasteIntoMultipleItemsExplorer\formatObject(), ilWorkspaceExplorer\formatObject(), formatObject(), ilECSNodeMappingCmsExplorer\formatObject(), and ilECSNodeMappingLocalExplorer\formatObject().

+ Here is the caller graph for this function:

◆ getOutput()

ilExplorer::getOutput ( )

Creates output recursive method @access public.

Returns
string

Reimplemented in ilAsyncContainerSelectionExplorer, and ilWorkspaceFolderExplorer.

Definition at line 790 of file class.ilExplorer.php.

791 {
792 global $ilBench, $tpl, $lng;
793
794 $ilBench->start("Explorer", "getOutput");
795
796 $this->format_options[0]["tab"] = array();
797
798 $depth = $this->getMaximumTreeDepth();
799
800 for ($i=0;$i<$depth;++$i)
801 {
802 $this->createLines($i);
803 }
804
805 include_once("./Services/YUI/classes/class.ilYuiUtil.php");
807 $tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
808
809 $tpl->addBlockFile("EXPLORER_TOP", "exp_top", "tpl.explorer_top.html");
810//echo "hh";
811 // set global body class
812// $tpl->setBodyClass("il_Explorer");
813
814 $tpl_tree = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
815
816 // updater
817 if (($_GET["ict"] || $_POST["collapseAll"] != "" || $_POST["expandAll"] != "") && $this->up_frame != "")
818 {
819 $tpl_tree->setCurrentBlock("updater");
820 $tpl_tree->setVariable("UPDATE_FRAME", $this->up_frame);
821 $tpl_tree->setVariable("UPDATE_SCRIPT", $this->up_script);
822 if (is_array($this->up_params))
823 {
824 $up_str = $lim = "";
825 foreach ($this->up_params as $p)
826 {
827 $up_str.= $lim."'".$p."'";
828 $lim = ",";
829 }
830 $tpl_tree->setVariable("UPDATE_PARAMS", $up_str);
831 }
832 $tpl_tree->parseCurrentBlock();
833 }
834
835 $cur_depth = -1;
836 foreach ($this->format_options as $key => $options)
837 {
838//echo "-".$options["depth"]."-";
839 if (!$options["visible"])
840 {
841 continue;
842 }
843
844 // end tags
845 $this->handleListEndTags($tpl_tree, $cur_depth, $options["depth"]);
846
847 // start tags
848 $this->handleListStartTags($tpl_tree, $cur_depth, $options["depth"]);
849
850 $cur_depth = $options["depth"];
851
852 if ($options["visible"] and $key != 0)
853 {
854 $this->formatObject($tpl_tree, $options["child"],$options,$options['obj_id']);
855 }
856 if ($key == 0)
857 {
858 $this->formatHeader($tpl_tree, $options["child"],$options);
859 }
860
861 }
862//if ($GLOBALS["ilUser"]->getLogin() == "alex") var_dump($this->format_options);
863 $this->handleListEndTags($tpl_tree, $cur_depth, -1);
864
865 $ilBench->stop("Explorer", "getOutput");
866
867 $tpl_tree->setVariable("TREE_LEAD", "");
868 if ($this->tree_lead != "")
869 {
870 $tpl_tree->setCurrentBlock("tree_lead");
871 $tpl_tree->setVariable("TREE_LEAD", $this->tree_lead);
872 $tpl_tree->parseCurrentBlock();
873 }
874 if ($this->getId() != "")
875 {
876 $tpl_tree->setVariable("TREE_ID", 'id="'.$this->getId().'_tree"');
877 }
878
879 $html = $tpl_tree->get();
880
881 if ($this->getUseStandardFrame())
882 {
883 $mtpl = new ilTemplate("tpl.main.html", true, true);
884 $mtpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
885 $mtpl->setVariable("BODY_CLASS", "il_Explorer");
886 $mtpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
887 if ($this->getTitle() != "")
888 {
889 $mtpl->setVariable("TXT_EXPLORER_HEADER", $this->getTitle());
890 }
891 if ($this->getId() != "")
892 {
893 $mtpl->setVariable("ID", 'id="'.$this->getId().'"');
894 }
895 $mtpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false));
896 $mtpl->setCurrentBlock("content");
897 $mtpl->setVariable("EXPLORER", $html);
898 $mtpl->setVariable("EXP_REFRESH", $lng->txt("refresh"));
899 $mtpl->parseCurrentBlock();
900 $html = $mtpl->get();
901 }
902
903 return $html;
904 }
$_GET["client_id"]
handleListEndTags(&$a_tpl_tree, $a_cur_depth, $a_item_depth)
handle list end tags ( and )
handleListStartTags(&$a_tpl_tree, $a_cur_depth, $a_item_depth)
handle list start tags (
getUseStandardFrame()
Get use standard explorer frame.
getTitle()
Get title.
formatObject(&$tpl, $a_node_id, $a_option, $a_obj_id=0)
Creates output recursive method @access private.
createLines($a_depth)
Creates lines for explorer view @access private.
formatHeader(&$tpl, $a_obj_id, $a_option)
Creates output for header (is empty here but can be overwritten in derived classes)
getMaximumTreeDepth()
Get maximum tree depth.
special template class to simplify handling of ITX/PEAR
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static initConnection()
Init YUI Connection module.
$_POST['username']
Definition: cron.php:12
$html
Definition: example_001.php:87
global $ilBench
Definition: ilias.php:18
if(!is_array($argv)) $options

References $_GET, $_POST, $html, $ilBench, $lng, $options, $tpl, createLines(), formatHeader(), formatObject(), getId(), ilUtil\getImagePath(), getMaximumTreeDepth(), ilUtil\getStyleSheetLocation(), getTitle(), getUseStandardFrame(), handleListEndTags(), handleListStartTags(), and ilYuiUtil\initConnection().

+ Here is the call graph for this function:

◆ getRoot()

ilExplorer::getRoot ( )

get root id

@access public

Parameters

Definition at line 324 of file class.ilExplorer.php.

325 {
326 return $this->root_id == null ?
327 $this->tree->getRootId() :
329 }

References $root_id.

Referenced by ilECSNodeMappingCmsExplorer\formatHeader(), setExpand(), and setOutput().

+ Here is the caller graph for this function:

◆ getTitle()

ilExplorer::getTitle ( )

Get title.

Returns
title

Definition at line 299 of file class.ilExplorer.php.

300 {
301 return $this->title;
302 }

Referenced by getOutput().

+ Here is the caller graph for this function:

◆ getTitleLength()

ilExplorer::getTitleLength ( )

Get max title length.

Returns

Definition at line 289 of file class.ilExplorer.php.

290 {
291 return $this->textwidth;
292 }

◆ getTreeLead()

ilExplorer::getTreeLead ( )

Get tree leading content.

Returns
string tree leading content

Definition at line 506 of file class.ilExplorer.php.

507 {
508 return $this->tree_lead;
509 }

◆ getUseStandardFrame()

ilExplorer::getUseStandardFrame ( )

Get use standard explorer frame.

Returns
boolean use standard explorer frame

Definition at line 579 of file class.ilExplorer.php.

580 {
582 }

References $use_standard_frame.

Referenced by getOutput().

+ Here is the caller graph for this function:

◆ handleListEndTags()

ilExplorer::handleListEndTags ( $a_tpl_tree,
  $a_cur_depth,
  $a_item_depth 
)

handle list end tags ( and )

Definition at line 911 of file class.ilExplorer.php.

912 {
913 if ($a_item_depth < $a_cur_depth)
914 {
915 // </li></ul> for ending lists
916 for ($i = 0; $i < ($a_cur_depth - $a_item_depth); $i++)
917 {
918 $a_tpl_tree->touchBlock("end_list_item");
919 $a_tpl_tree->touchBlock("element");
920
921 $a_tpl_tree->touchBlock("end_list");
922 $a_tpl_tree->touchBlock("element");
923 }
924 }
925 else if ($a_item_depth == $a_cur_depth)
926 {
927 // </li> for ending list items
928 $a_tpl_tree->touchBlock("end_list_item");
929 $a_tpl_tree->touchBlock("element");
930 }
931 }

Referenced by getOutput().

+ Here is the caller graph for this function:

◆ handleListStartTags()

ilExplorer::handleListStartTags ( $a_tpl_tree,
  $a_cur_depth,
  $a_item_depth 
)

handle list start tags (

)

Definition at line 936 of file class.ilExplorer.php.

937 {
938 // start tags
939 if ($a_item_depth > $a_cur_depth)
940 {
941 // <ul><li> for new lists
942 if ($a_item_depth > 1)
943 {
944 $a_tpl_tree->touchBlock("start_list");
945 }
946 else
947 {
948 $a_tpl_tree->touchBlock("start_list_no_indent");
949 }
950 $a_tpl_tree->touchBlock("element");
951
952 $a_tpl_tree->touchBlock("start_list_item");
953 $a_tpl_tree->touchBlock("element");
954 }
955 else
956 {
957 // <li> items
958 $a_tpl_tree->touchBlock("start_list_item");
959 $a_tpl_tree->touchBlock("element");
960 }
961 }

Referenced by getOutput().

+ Here is the caller graph for this function:

◆ highlightNode()

ilExplorer::highlightNode (   $a_id)

set highlighted node

Definition at line 421 of file class.ilExplorer.php.

422 {
423 $this->highlighted = $a_id;
424 }

◆ ilExplorer()

ilExplorer::ilExplorer (   $a_target)

Constructor @access public.

Parameters
stringscriptname

Definition at line 168 of file class.ilExplorer.php.

169 {
170 global $ilias, $objDefinition;
171
172 if (!isset($a_target) or !is_string($a_target))
173 {
174 $this->ilias->raiseError(get_class($this)."::Constructor(): No target given!",$this->ilias->error_obj->WARNING);
175 }
176
177 // autofilter object types in devmode
178 $devtypes = $objDefinition->getDevModeAll();
179
180 if (count($devtypes > 0))
181 {
182 // activate filter if objects found in devmode
183 $this->setFiltered(true);
184
185 foreach ($devtypes as $type)
186 {
187 $this->addFilter($type);
188 }
189 }
190
191 $this->ilias =& $ilias;
192 $this->output = array();
193 $this->expanded = array();
194 $this->target = $a_target;
195 $this->target_get = 'ref_id';
196 $this->frame_target = "content";
197 $this->order_column = "title";
198 $this->tree = new ilTree(ROOT_FOLDER_ID);
199 $this->tree->initLangCode();
200 $this->expand_target = $_SERVER["PATH_INFO"];
201 $this->rbac_check = true;
202 $this->output_icons = true;
203 $this->expand_variable = "expand";
204 $this->setTitleLength(50);
205 $this->post_sort=true;
207 $this->highlighted = "";
208 $this->show_minus = true;
209 $this->counter = 0;
210 $this->asnch_expanding = false;
211 }
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
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']

References $_SERVER, $ilias, addFilter(), IL_FM_NEGATIVE, setFiltered(), setFilterMode(), and setTitleLength().

+ Here is the call graph for this function:

◆ initItemCounter()

ilExplorer::initItemCounter (   $a_number)

Init item counter.

@access public

Parameters
intnumber

Definition at line 260 of file class.ilExplorer.php.

261 {
262 $this->counter = $a_number;
263 }

Referenced by ilCopyWizardExplorer\__construct().

+ Here is the caller graph for this function:

◆ is_in_array()

ilExplorer::is_in_array (   $a_start,
  $a_depth 
)

DESCRIPTION MISSING @access private.

Parameters
integer
integer
Returns
boolean

Definition at line 1304 of file class.ilExplorer.php.

1305 {
1306 for ($i=$a_start;$i<count($this->format_options);++$i)
1307 {
1308 if ($this->format_options[$i]["depth"] < $a_depth)
1309 {
1310 break;
1311 }
1312
1313 if ($this->format_options[$i]["depth"] == $a_depth)
1314 {
1315 return true;
1316 }
1317 }
1318 return false;
1319 }

Referenced by createLines().

+ Here is the caller graph for this function:

◆ isClickable()

ilExplorer::isClickable (   $a_type,
  $a_ref_id = 0 
)

check if links for certain object type are activated

Parameters
string$a_typeobject type
Returns
boolean true if linking is activated

Reimplemented in ilContainerSelectionExplorer, ilAICCExplorer, ilSurveySkillExplorer, ilLMMenuObjectSelector, ilGlossarySelectorGUI, ilSolutionExplorer, ilRoleDesktopItemSelector, ilAdministrationExplorer, ilFileSelectorGUI, ilObjectSelector, ilRepositoryCopySelector, ilRepositoryLinkSelector, ilCopyWizardExplorer, and ilSearchRootSelector.

Definition at line 518 of file class.ilExplorer.php.

519 {
520 // in this standard implementation
521 // only the type determines, wether an object should be clickable or not
522 // but this method can be overwritten and make $exp->setFilterMode(IL_FM_NEGATIVE);use of the ref id
523 // (this happens e.g. in class ilRepositoryExplorerGUI)
524 if ($this->is_clickable[$a_type] == "n")
525 {
526 return false;
527 }
528 else
529 {
530 return true;
531 }
532 }

Referenced by formatObject().

+ Here is the caller graph for this function:

◆ isVisible()

ilExplorer::isVisible (   $a_ref_id,
  $a_type 
)

Reimplemented in ilSCORMExplorer, ilAdministrationExplorer, ilContainerSelectionExplorer, ilWorkspaceExplorer, and ilRepositoryExplorer.

Definition at line 475 of file class.ilExplorer.php.

476 {
477 global $rbacsystem, $ilBench;
478
479 if (!$this->rbac_check)
480 {
481 return true;
482 }
483
484 $ilBench->start("Explorer", "setOutput_isVisible");
485 $visible = $rbacsystem->checkAccess('visible',$a_ref_id);
486 $ilBench->stop("Explorer", "setOutput_isVisible");
487
488 return $visible;
489 }

References $ilBench.

Referenced by setOutput().

+ Here is the caller graph for this function:

◆ modifyChilds()

ilExplorer::modifyChilds (   $a_parent_id,
  $a_objects 
)

Reimplemented in ilAdministrationExplorer.

Definition at line 749 of file class.ilExplorer.php.

750 {
751 return $a_objects;
752 }

Referenced by setOutput().

+ Here is the caller graph for this function:

◆ outputIcons()

ilExplorer::outputIcons (   $a_icons)

output icons

Parameters
boolean$a_iconsoutput icons true/false

Definition at line 451 of file class.ilExplorer.php.

452 {
453 $this->output_icons = $a_icons;
454 }

Referenced by ilAICCExplorer\__construct(), ilSCORMExplorer\__construct(), and ilHACPExplorer\ilHACPExplorer().

+ Here is the caller graph for this function:

◆ setAsynchExpanding()

ilExplorer::setAsynchExpanding (   $a_val)

Set asynch expanding.

Parameters
boolean

Definition at line 238 of file class.ilExplorer.php.

239 {
240 $this->asnch_expanding = $a_val;
241 }

◆ setClickable()

ilExplorer::setClickable (   $a_type,
  $a_clickable 
)

(de-)activates links for a certain object type

Parameters
string$a_typeobject type
boolean$a_clickabletrue/false

Definition at line 463 of file class.ilExplorer.php.

464 {
465 if($a_clickable)
466 {
467 $this->is_clickable[$a_type] = "";
468 }
469 else
470 {
471 $this->is_clickable[$a_type] = "n";
472 }
473 }

◆ setExpand()

ilExplorer::setExpand (   $a_node_id)

set the expand option this value is stored in a SESSION variable to save it different view (lo view, frm view,...) @access private

Parameters
stringpipe-separated integer

Reimplemented in ilWorkspaceFolderExplorer.

Definition at line 1431 of file class.ilExplorer.php.

1432 {
1433 // IF ISN'T SET CREATE SESSION VARIABLE
1434 if(!is_array($_SESSION[$this->expand_variable]))
1435 {
1436 $_SESSION[$this->expand_variable] = array($this->getRoot());
1437 }
1438 // IF $_GET["expand"] is positive => expand this node
1439 if ($a_node_id > 0 && !in_array($a_node_id,$_SESSION[$this->expand_variable]))
1440 {
1441 array_push($_SESSION[$this->expand_variable],$a_node_id);
1442 }
1443 // IF $_GET["expand"] is negative => compress this node
1444 if ($a_node_id < 0)
1445 {
1446 $key = array_keys($_SESSION[$this->expand_variable],-(int) $a_node_id);
1447 unset($_SESSION[$this->expand_variable][$key[0]]);
1448 }
1449 $this->expanded = $_SESSION[$this->expand_variable];
1450 }
$_SESSION["AccountId"]
getRoot()
get root id

References $_SESSION, $expand_variable, and getRoot().

Referenced by ilAICCExplorer\makeObjectNodeExpandable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setExpandTarget()

ilExplorer::setExpandTarget (   $a_exp_target)

target script for expand icons

Parameters
string$a_exp_targetscript name of target script(may include parameters) initially set to $_SERVER["PATH_INFO"]

Definition at line 400 of file class.ilExplorer.php.

401 {
402 $this->expand_target = $a_exp_target;
403 }

◆ setFiltered()

◆ setFilterMode()

◆ setFrameTarget()

ilExplorer::setFrameTarget (   $a_target)

set target frame or not frame?

Parameters
string@access public

Definition at line 1254 of file class.ilExplorer.php.

1255 {
1256 $this->frame_target = $a_target;
1257 }

Referenced by ilFileSelectorGUI\__construct().

+ Here is the caller graph for this function:

◆ setFrameUpdater()

ilExplorer::setFrameUpdater (   $a_up_frame,
  $a_up_script,
  $a_params = "" 
)

Set Explorer Updater.

Parameters
object$a_treeTree Object

Definition at line 410 of file class.ilExplorer.php.

411 {
412 $this->up_frame = $a_up_frame;
413 $this->up_script = $a_up_script;
414 $this->up_params = $a_params;
415 }

◆ setId()

ilExplorer::setId (   $a_val)

Set id.

Parameters
string$a_valid

Definition at line 218 of file class.ilExplorer.php.

219 {
220 $this->id = $a_val;
221 }

Referenced by ilPasteIntoMultipleItemsExplorer\__construct().

+ Here is the caller graph for this function:

◆ setOrderColumn()

ilExplorer::setOrderColumn (   $a_column)

set the order column @access public

Parameters
stringname of order column

Definition at line 336 of file class.ilExplorer.php.

337 {
338 $this->order_column = $a_column;
339 }

Referenced by ilECSNodeMappingCmsExplorer\__construct(), ilECSNodeMappingLocalExplorer\__construct(), ilSurveySkillExplorer\__construct(), ilAICCExplorer\__construct(), ilSCORMExplorer\__construct(), and ilHACPExplorer\ilHACPExplorer().

+ Here is the caller graph for this function:

◆ setOrderDirection()

ilExplorer::setOrderDirection (   $a_direction)

set the order direction @access public

Parameters
stringname of order column

Definition at line 346 of file class.ilExplorer.php.

347 {
348 if ($a_direction == "desc")
349 {
350 $this->order_direction = $a_direction;
351 }
352 else
353 {
354 $this->order_direction = "asc";
355 }
356 }

◆ setOutput()

ilExplorer::setOutput (   $a_parent_id,
  $a_depth = 1,
  $a_obj_id = 0,
  $a_highlighted_subtree = false 
)

Creates output for explorer view in admin menue recursive method @access public.

Parameters
integerparent_node_id where to start from (default=0, 'root')
integerdepth level where to start (default=1)
Returns
string

Definition at line 604 of file class.ilExplorer.php.

605 {
606 global $rbacadmin, $rbacsystem, $ilBench;
607
608#echo 'ParentId: '.$a_parent_id.' depth: '.$a_depth.' obj_id: '.$a_obj_id;
609
610 if (!isset($a_parent_id))
611 {
612 $this->ilias->raiseError(get_class($this)."::setOutput(): No node_id given!",$this->ilias->error_obj->WARNING);
613 }
614
615 if ($this->showChilds($a_parent_id,$a_obj_id))
616 {
617 $objects = $this->getChildsOfNode($a_parent_id);
618 }
619 else
620 {
621 $objects = array();
622 }
623
624 $objects = $this->modifyChilds($a_parent_id, $objects);
625
626 // force expansion (of single nodes)
627 if ($this->forceExpanded($a_parent_id) && !in_array($a_parent_id, $this->expanded))
628 {
629 $this->expanded[] = $a_parent_id;
630 }
631
632 if (count($objects) > 0)
633 {
634 // Maybe call a lexical sort function for the child objects
635 $tab = ++$a_depth - 2;
636 if ($this->post_sort)
637 {
638 $objects = $this->sortNodes($objects,$a_obj_id);
639 }
640 $skip_rest = false;
641 foreach ($objects as $key => $object)
642 {
643 // skip childs, if parent is not expanded
644 if (!$this->forceExpanded($object["child"]) && $skip_rest)
645 {
646 continue;
647 }
648//echo "<br>-".$object["child"]."-".$this->forceExpanded($object["child"])."-";
649 //ask for FILTER
650 if ($this->filtered == false or $this->checkFilter($object["type"]) == false)
651 {
652 if ($this->isVisible($object['child'],$object['type']))
653 {
654 $ilBench->start("Explorer", "setOutput_setFormatOptions");
655 #echo 'CHILD getIndex() '.$object['child'].' parent: '.$this->getRoot();
656 if ($object["child"] != $this->getRoot())
657 {
658 $parent_index = $this->getIndex($object);
659 }
660 $this->format_options["$this->counter"]["parent"] = $object["parent"];
661 $this->format_options["$this->counter"]["child"] = $object["child"];
662 $this->format_options["$this->counter"]["title"] = $object["title"];
663 $this->format_options["$this->counter"]["type"] = $object["type"];
664 $this->format_options["$this->counter"]["obj_id"] = $object["obj_id"];
665 $this->format_options["$this->counter"]["desc"] = "obj_".$object["type"];
666 $this->format_options["$this->counter"]["depth"] = $tab;
667 $this->format_options["$this->counter"]["container"] = false;
668 $this->format_options["$this->counter"]["visible"] = true;
669 $this->format_options["$this->counter"]["highlighted_subtree"] = $a_highlighted_subtree;
670
671 // Create prefix array
672 for ($i = 0; $i < $tab; ++$i)
673 {
674 $this->format_options["$this->counter"]["tab"][] = 'blank';
675 }
676
677 // fix explorer (sometimes explorer disappears)
678 if ($parent_index == 0)
679 {
680 if (!$this->expand_all and !in_array($object["parent"], $this->expanded))
681 {
682 $this->expanded[] = $object["parent"];
683 }
684 }
685
686 // only if parent is expanded and visible, object is visible
687 if ($object["child"] != $this->getRoot() and ((!$this->expand_all and !in_array($object["parent"],$this->expanded))
688 or !$this->format_options["$parent_index"]["visible"]))
689 {
690 if (!$this->forceExpanded($object["child"]))
691 {
692 // if parent is not expanded, and one child is
693 // visible we don't need more information and
694 // can skip the rest of the childs
695 if ($this->format_options["$this->counter"]["visible"])
696 {
697//echo "-setSkipping";
698 $skip_rest = true;
699 }
700 $this->format_options["$this->counter"]["visible"] = false;
701 }
702 }
703
704 // if object exists parent is container
705 if ($object["child"] != $this->getRoot())
706 {
707 $this->format_options["$parent_index"]["container"] = true;
708
709 if ($this->expand_all or in_array($object["parent"],$this->expanded))
710 {
711 //echo "<br>-".$object["child"]."-".$this->forceExpanded($object["child"])."-";
712 if ($this->forceExpanded($object["parent"]))
713 {
714 $this->format_options["$parent_index"]["tab"][($tab-2)] = 'forceexp';
715 }
716 else
717 {
718 $this->format_options["$parent_index"]["tab"][($tab-2)] = 'minus';
719 }
720 }
721 else
722 {
723 $this->format_options["$parent_index"]["tab"][($tab-2)] = 'plus';
724 }
725 }
726 //echo "-"."$parent_index"."-";
727 //var_dump($this->format_options["$parent_index"]);
728 ++$this->counter;
729 $ilBench->stop("Explorer", "setOutput_setFormatOptions");
730
731 // stop recursion if 2. level beyond expanded nodes is reached
732 if ($this->expand_all or in_array($object["parent"],$this->expanded) or ($object["parent"] == 0)
733 or $this->forceExpanded($object["child"]))
734 {
735 $highlighted_subtree = ($a_highlighted_subtree ||
736 ($object["child"] == $this->highlighted))
737 ? true
738 : false;
739
740 // recursive
741 $this->setOutput($object["child"],$a_depth,$object['obj_id'], $highlighted_subtree);
742 }
743 } //if
744 } //if FILTER
745 } //foreach
746 } //if
747 } //function
showChilds($a_parent_id)
determines wether the childs of an object should be shown or not note: this standard implementation a...
sortNodes($a_nodes, $a_parent_obj_id)
sort nodes and put adm object to the end of sorted array @access private
checkFilter($a_item)
check if item is in filter @access private
setOutput($a_parent_id, $a_depth=1, $a_obj_id=0, $a_highlighted_subtree=false)
Creates output for explorer view in admin menue recursive method @access public.
getIndex($a_data)
get index of format_options array from specific ref_id,parent_id @access private
modifyChilds($a_parent_id, $a_objects)
getChildsOfNode($a_parent_id)
Get childs of node.
isVisible($a_ref_id, $a_type)
forceExpanded($a_obj_id)
force expansion of node

References $ilBench, $tab, checkFilter(), forceExpanded(), getChildsOfNode(), getIndex(), getRoot(), isVisible(), modifyChilds(), setOutput(), showChilds(), and sortNodes().

Referenced by setOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setParamsGet()

ilExplorer::setParamsGet (   $a_params_get)

set additional params to be passed in Get-string @access public

Parameters
array

Definition at line 378 of file class.ilExplorer.php.

379 {
380 if (!isset($a_params_get) or !is_array($a_params_get))
381 {
382 $this->ilias->raiseError(get_class($this)."::setTargetGet(): No target given!",$this->ilias->error_obj->WARNING);
383 }
384
385 foreach ($a_params_get as $key => $val)
386 {
387 $str .= "&".$key."=".$val;
388 }
389
390 $this->params_get = $str;
391 }

◆ setPostSort()

ilExplorer::setPostSort (   $a_sort)

process post sorting

Parameters
boolean$a_sorttrue / false

Definition at line 538 of file class.ilExplorer.php.

539 {
540 $this->post_sort = $a_sort;
541 }

Referenced by ilSurveySkillExplorer\__construct().

+ Here is the caller graph for this function:

◆ setRoot()

ilExplorer::setRoot (   $a_root_id)

Set root node.

@access public

Parameters
intref id of root node

Definition at line 311 of file class.ilExplorer.php.

312 {
313 #$this->tree = new ilTree(ROOT_FOLDER_ID,$a_root_id);
314 $this->root_id = $a_root_id;
315 }

Referenced by ilECSNodeMappingLocalExplorer\__construct().

+ Here is the caller graph for this function:

◆ setSessionExpandVariable()

◆ setTargetGet()

ilExplorer::setTargetGet (   $a_target_get)

set the varname in Get-string @access public

Parameters
stringvarname containing Ids to be used in GET-string

Definition at line 363 of file class.ilExplorer.php.

364 {
365 if (!isset($a_target_get) or !is_string($a_target_get))
366 {
367 $this->ilias->raiseError(get_class($this)."::setTargetGet(): No target given!",$this->ilias->error_obj->WARNING);
368 }
369
370 $this->target_get = $a_target_get;
371 }

◆ setTitle()

ilExplorer::setTitle (   $a_val)

Set title.

Parameters
title

Definition at line 270 of file class.ilExplorer.php.

271 {
272 $this->title = $a_val;
273 }

Referenced by ilAdministrationExplorer\ilAdministrationExplorer(), and ilRepositoryExplorer\ilRepositoryExplorer().

+ Here is the caller graph for this function:

◆ setTitleLength()

ilExplorer::setTitleLength (   $a_length)

◆ setTreeLead()

ilExplorer::setTreeLead (   $a_val)

Set tree leading content.

Parameters
string$a_valtree leading content

Definition at line 496 of file class.ilExplorer.php.

497 {
498 $this->tree_lead = $a_val;
499 }

◆ setUseStandardFrame()

ilExplorer::setUseStandardFrame (   $a_val)

Set use standard frame.

If true, the standard explorer frame (like in the repository) is put around the tree.

Parameters
booleanuse standard explorer frame

Definition at line 569 of file class.ilExplorer.php.

570 {
571 $this->use_standard_frame = $a_val;
572 }

◆ showChilds()

ilExplorer::showChilds (   $a_parent_id)

determines wether the childs of an object should be shown or not note: this standard implementation always returns true but it could be overwritten by derived classes (e.g.

ilRepositoryExplorerGUI)

Reimplemented in ilLMMenuObjectSelector, ilGlossarySelectorGUI, ilSolutionExplorer, ilRoleDesktopItemSelector, ilFileSelectorGUI, ilObjectSelector, ilRepositoryCopySelector, ilRepositoryLinkSelector, and ilSearchRootSelector.

Definition at line 759 of file class.ilExplorer.php.

760 {
761 return true;
762 }

Referenced by ilSCORMExplorer\createOutputArray(), ilAICCExplorer\setOutput(), and setOutput().

+ Here is the caller graph for this function:

◆ sortNodes()

ilExplorer::sortNodes (   $a_nodes,
  $a_parent_obj_id 
)

sort nodes and put adm object to the end of sorted array @access private

Parameters
arraynode list as returned by iltree::getChilds();
Returns
array sorted nodes

Reimplemented in ilWorkspaceExplorer, and ilRepositoryExplorer.

Definition at line 1516 of file class.ilExplorer.php.

1517 {
1518 foreach ($a_nodes as $key => $node)
1519 {
1520 if ($node["type"] == "adm")
1521 {
1522 $match = $key;
1523 $adm_node = $node;
1524 break;
1525 }
1526 }
1527
1528 // cut off adm node
1529 isset($match) ? array_splice($a_nodes,$match,1) : "";
1530
1531 $a_nodes = ilUtil::sortArray($a_nodes,$this->order_column,$this->order_direction);
1532
1533 // append adm node to end of list
1534 isset ($match) ? array_push($a_nodes,$adm_node) : "";
1535
1536 return $a_nodes;
1537 }
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray

References ilUtil\sortArray().

Referenced by setOutput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $expand_all

ilExplorer::$expand_all = false

Definition at line 152 of file class.ilExplorer.php.

◆ $expand_target

ilExplorer::$expand_target

Definition at line 95 of file class.ilExplorer.php.

◆ $expand_variable

ilExplorer::$expand_variable

Definition at line 117 of file class.ilExplorer.php.

Referenced by ilWorkspaceFolderExplorer\setExpand(), and setExpand().

◆ $expanded

ilExplorer::$expanded

Definition at line 74 of file class.ilExplorer.php.

◆ $filter_mode

ilExplorer::$filter_mode

Definition at line 145 of file class.ilExplorer.php.

Referenced by getFilterMode().

◆ $filtered

ilExplorer::$filtered = false

Definition at line 138 of file class.ilExplorer.php.

◆ $format_options

ilExplorer::$format_options

Definition at line 39 of file class.ilExplorer.php.

◆ $id

ilExplorer::$id

Definition at line 18 of file class.ilExplorer.php.

Referenced by ilAsyncContainerSelectionExplorer\addOnLoadCode(), and getId().

◆ $ilias

◆ $is_clickable

ilExplorer::$is_clickable

Definition at line 124 of file class.ilExplorer.php.

◆ $order_column

ilExplorer::$order_column

Definition at line 81 of file class.ilExplorer.php.

◆ $order_direction

ilExplorer::$order_direction = "asc"

Definition at line 88 of file class.ilExplorer.php.

◆ $output

ilExplorer::$output

Definition at line 32 of file class.ilExplorer.php.

Referenced by ilSCORMExplorer\getOutput().

◆ $output_icons

ilExplorer::$output_icons

Definition at line 110 of file class.ilExplorer.php.

◆ $params_get

ilExplorer::$params_get

Definition at line 67 of file class.ilExplorer.php.

◆ $post_sort

ilExplorer::$post_sort

Definition at line 131 of file class.ilExplorer.php.

◆ $rbac_check

ilExplorer::$rbac_check

Definition at line 102 of file class.ilExplorer.php.

◆ $root_id

ilExplorer::$root_id = null

Definition at line 159 of file class.ilExplorer.php.

Referenced by getRoot().

◆ $target

◆ $target_get

ilExplorer::$target_get

Definition at line 60 of file class.ilExplorer.php.

◆ $tree

◆ $use_standard_frame

ilExplorer::$use_standard_frame = false

Definition at line 161 of file class.ilExplorer.php.

Referenced by getUseStandardFrame().


The documentation for this class was generated from the following file: