ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilExplorer Class Reference

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

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

Public Member Functions

 __construct ($a_target)
 Constructor 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 public More...
 
 setOrderDirection ($a_direction)
 set the order direction public More...
 
 setTargetGet ($a_target_get)
 set the varname in Get-string public More...
 
 setParamsGet ($a_params_get)
 set additional params to be passed in Get-string 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 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 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 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 private. More...
 
 setFrameTarget ($a_target)
 set target frame or not frame? More...
 
 createLines ($a_depth)
 Creates lines for explorer view private. More...
 
 is_in_array ($a_start, $a_depth)
 DESCRIPTION MISSING private. More...
 
 getIndex ($a_data)
 get index of format_options array from specific ref_id,parent_id private More...
 
 addFilter ($a_item)
 adds item to the filter public More...
 
 delFilter ($a_item)
 removes item from the filter 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,...) private More...
 
 forceExpandAll ($a_mode, $a_show_minus=true)
 force expandAll. More...
 
 setFiltered ($a_bool)
 active/deactivate the filter public More...
 
 checkFilter ($a_item)
 check if item is in filter private More...
 
 sortNodes ($a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array private More...
 

Data Fields

 $id
 
 $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
 

Protected Attributes

 $obj_definition
 
 $error
 
 $rbacsystem
 
 $tpl
 
 $lng
 

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.

Constructor & Destructor Documentation

◆ __construct()

ilExplorer::__construct (   $a_target)

Constructor public.

Parameters
stringscriptname

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

References $_SERVER, $DIC, $ilErr, $type, addFilter(), array, IL_FM_NEGATIVE, setFiltered(), setFilterMode(), and setTitleLength().

187  {
188  global $DIC;
189 
190  $this->obj_definition = $DIC["objDefinition"];
191  $this->error = $DIC["ilErr"];
192  $this->rbacsystem = $DIC->rbac()->system();
193  $this->tpl = $DIC["tpl"];
194  $this->lng = $DIC->language();
195  $objDefinition = $DIC["objDefinition"];
196  $ilErr = $DIC["ilErr"];
197 
198  if (!isset($a_target) or !is_string($a_target)) {
199  $ilErr->raiseError(get_class($this) . "::Constructor(): No target given!", $ilErr->WARNING);
200  }
201 
202  // autofilter object types in devmode
203  $devtypes = $objDefinition->getDevModeAll();
204 
205  if (count($devtypes) > 0) {
206  // activate filter if objects found in devmode
207  $this->setFiltered(true);
208 
209  foreach ($devtypes as $type) {
210  $this->addFilter($type);
211  }
212  }
213 
214  $this->ilias = $DIC["ilias"];
215  $this->output = array();
216  $this->expanded = array();
217  $this->target = $a_target;
218  $this->target_get = 'ref_id';
219  $this->frame_target = "content";
220  $this->order_column = "title";
221  $this->tree = new ilTree(ROOT_FOLDER_ID);
222  $this->tree->initLangCode();
223  $this->expand_target = $_SERVER["PATH_INFO"];
224  $this->rbac_check = true;
225  $this->output_icons = true;
226  $this->expand_variable = "expand";
227  $this->setTitleLength(50);
228  $this->post_sort=true;
230  $this->highlighted = "";
231  $this->show_minus = true;
232  $this->counter = 0;
233  $this->asnch_expanding = false;
234  }
global $ilErr
Definition: raiseError.php:16
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
setFilterMode($a_mode=IL_FM_NEGATIVE)
set filter mode
$type
global $DIC
Definition: saml.php:7
setTitleLength($a_length)
Set max title length.
setFiltered($a_bool)
active/deactivate the filter public
redirection script todo: (a better solution should control the processing via a xml file) ...
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
addFilter($a_item)
adds item to the filter public
const IL_FM_NEGATIVE
+ Here is the call graph for this function:

Member Function Documentation

◆ addFilter()

ilExplorer::addFilter (   $a_item)

adds item to the filter public

Parameters
stringobject type to add
Returns
boolean

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

References array.

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

1282  {
1283  $ispresent = 0;
1284 
1285  if (is_array($this->filter)) {
1286  //run through filter
1287  foreach ($this->filter as $item) {
1288  if ($item == $a_item) {
1289  $is_present = 1;
1290 
1291  return false;
1292  }
1293  }
1294  } else {
1295  $this->filter = array();
1296  }
1297  if ($is_present == 0) {
1298  $this->filter[] = $a_item;
1299  }
1300 
1301  return true;
1302  }
Create styles array
The data for the language used.
+ 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

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

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

1131  {
1132  return "";
1133  }
+ Here is the caller graph for this function:

◆ buildFrameTarget()

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

get frame target (may be overwritten by derived classes)

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

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

1148  {
1149  return $this->frame_target;
1150  }
+ Here is the caller graph for this function:

◆ buildLinkTarget()

ilExplorer::buildLinkTarget (   $a_node_id,
  $a_type 
)

get link target (may be overwritten by derived classes)

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

References $params_get, and $target.

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

1104  {
1105  $target = (strpos($this->target, "?") === false)
1106  ? $this->target . "?"
1107  : $this->target . "&";
1108  return $target . $this->target_get . "=" . $a_node_id . $this->params_get;
1109  }
+ 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)

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

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

1115  {
1116  return "";
1117  }
+ 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

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

Referenced by formatObject().

1139  {
1140  return "";
1141  }
+ 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

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

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

1123  {
1124  return $a_title;
1125  }
+ Here is the caller graph for this function:

◆ checkFilter()

ilExplorer::checkFilter (   $a_item)

check if item is in filter private

Parameters
string
Returns
integer

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

References $ret, getFilterMode(), and IL_FM_NEGATIVE.

Referenced by setOutput().

1392  {
1393  if (is_array($this->filter)) {
1394  if (in_array($a_item, $this->filter)) {
1395  $ret = true;
1396  } else {
1397  $ret = false;
1398  }
1399  } else {
1400  $ret = false;
1401  }
1402 
1403  if ($this->getFilterMode() == IL_FM_NEGATIVE) {
1404  return $ret;
1405  } else {
1406  return !$ret;
1407  }
1408  }
getFilterMode()
get filter mode
$ret
Definition: parser.php:6
const IL_FM_NEGATIVE
+ 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 452 of file class.ilExplorer.php.

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

453  {
454  $this->rbac_check = $a_check;
455  }
+ Here is the caller graph for this function:

◆ createLines()

ilExplorer::createLines (   $a_depth)

Creates lines for explorer view private.

Parameters
integer

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

References $i, and is_in_array().

Referenced by getOutput().

1209  {
1210  for ($i = 0; $i < count($this->format_options); ++$i) {
1211  if ($this->format_options[$i]["depth"] == $a_depth+1
1212  and !$this->format_options[$i]["container"]
1213  and $this->format_options[$i]["depth"] != 1) {
1214  $this->format_options[$i]["tab"]["$a_depth"] = "quer";
1215  }
1216 
1217  if ($this->format_options[$i]["depth"] == $a_depth+2) {
1218  if ($this->is_in_array($i+1, $this->format_options[$i]["depth"])) {
1219  $this->format_options[$i]["tab"]["$a_depth"] = "winkel";
1220  } else {
1221  $this->format_options[$i]["tab"]["$a_depth"] = "ecke";
1222  }
1223  }
1224 
1225  if ($this->format_options[$i]["depth"] > $a_depth+2) {
1226  if ($this->is_in_array($i+1, $a_depth+2)) {
1227  $this->format_options[$i]["tab"]["$a_depth"] = "hoch";
1228  }
1229  }
1230  }
1231  }
is_in_array($a_start, $a_depth)
DESCRIPTION MISSING private.
$i
Definition: disco.tpl.php:19
+ 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 private.

Parameters
string
integer
Returns
string

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

References $a_type, $error, $ilErr, and getAsynchExpanding().

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

1161  {
1162  $ilErr = $this->error;
1163 
1164  if (!isset($a_type) or !is_string($a_type) or !isset($a_node_id)) {
1165  $ilErr->raiseError(get_class($this) . "::createTarget(): Missing parameter or wrong datatype! " .
1166  "type: " . $a_type . " node_id:" . $a_node_id, $ilErr->WARNING);
1167  }
1168 
1169  // SET expand parameter:
1170  // positive if object is expanded
1171  // negative if object is compressed
1172  $a_node_id = $a_type == '+' ? $a_node_id : -(int) $a_node_id;
1173 
1174  $sep = (is_int(strpos($this->expand_target, "?")))
1175  ? "&"
1176  : "?";
1177 
1178  // in current tree flag
1179  $ict_str = ($a_highlighted_subtree || $this->highlighted == "")
1180  ? "&ict=1"
1181  : "";
1182  if ($this->getAsynchExpanding()) {
1183  $ict_str.= "&cmdMode=asynch";
1184  }
1185  if ($a_append_anch) {
1186  return $this->expand_target . $sep . $this->expand_variable . "=" . $a_node_id . $this->params_get . $ict_str . "#" . abs($a_node_id);
1187  } else {
1188  return $this->expand_target . $sep . $this->expand_variable . "=" . $a_node_id . $this->params_get . $ict_str;
1189  }
1190  }
global $ilErr
Definition: raiseError.php:16
getAsynchExpanding()
Get asynch expanding.
$a_type
Definition: workflow.php:92
+ 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 public

Parameters
stringobject type to remove
Returns
boolean

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

References array.

1311  {
1312  //check if a filter exists
1313  if (is_array($this->filter)) {
1314  //build copy of the existing filter without the given item
1315  $tmp = array();
1316 
1317  foreach ($this->filter as $item) {
1318  if ($item != $a_item) {
1319  $tmp[] = $item;
1320  } else {
1321  $deleted = 1;
1322  }
1323  }
1324 
1325  $this->filter = $tmp;
1326  } else {
1327  return false;
1328  }
1329 
1330  if ($deleted == 1) {
1331  return true;
1332  } else {
1333  return false;
1334  }
1335  }
Create styles array
The data for the language used.

◆ 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) public

Parameters
boolean

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

1368  {
1369  $this->expand_all = (bool) $a_mode;
1370  $this->show_minus = $a_show_minus;
1371  }

◆ forceExpanded()

ilExplorer::forceExpanded (   $a_obj_id)

force expansion of node

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

Referenced by setOutput().

750  {
751  return false;
752  }
+ 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)

public

Parameters
integerobj_id
integerarray options

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

Referenced by getOutput().

926  {
927  }
+ 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 private.

Parameters
integer
array
Returns
string

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

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

Referenced by getOutput().

938  {
939  $lng = $this->lng;
941 
942  if (!isset($a_node_id) or !is_array($a_option)) {
943  $ilErr->raiseError(get_class($this) . "::formatObject(): Missing parameter or wrong datatype! " .
944  "node_id: " . $a_node_id . " options:" . var_dump($a_option), $ilErr->WARNING);
945  }
946 
947  $pic = false;
948  foreach ((array) $a_option["tab"] as $picture) {
949  if ($picture == 'plus') {
950  $tpl->setCurrentBlock("expander");
951  $tpl->setVariable("EXP_DESC", $lng->txt("collapsed"));
952  $tpl->setVariable("LINK_NAME", $a_node_id);
953  if (!$this->getAsynchExpanding()) {
954  $target = $this->createTarget('+', $a_node_id, $a_option["highlighted_subtree"]);
955  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
956  } else {
957  $target = $this->createTarget('+', $a_node_id, $a_option["highlighted_subtree"], false);
958  $tpl->setVariable("ONCLICK_TARGET_EXPANDER", " onclick=\"return il.Explorer.refresh('tree_div', '" . $target . "');\"");
959  $tpl->setVariable("LINK_TARGET_EXPANDER", "#");
960  }
961  $tpl->setVariable("IMGPATH", $this->getImage("browser/plus.png"));
962  $tpl->parseCurrentBlock();
963  $pic = true;
964  }
965 
966  if ($picture == 'forceexp') {
967  $tpl->setCurrentBlock("expander");
968  $tpl->setVariable("EXP_DESC", $lng->txt("expanded"));
969  $target = $this->createTarget('+', $a_node_id);
970  $tpl->setVariable("LINK_NAME", $a_node_id);
971  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
972  $tpl->setVariable("IMGPATH", $this->getImage("browser/forceexp.png"));
973  $tpl->parseCurrentBlock();
974  $pic = true;
975  }
976 
977  if ($picture == 'minus' && $this->show_minus) {
978  $tpl->setCurrentBlock("expander");
979  $tpl->setVariable("EXP_DESC", $lng->txt("expanded"));
980  $tpl->setVariable("LINK_NAME", $a_node_id);
981  if (!$this->getAsynchExpanding()) {
982  $target = $this->createTarget('-', $a_node_id, $a_option["highlighted_subtree"]);
983  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
984  } else {
985  $target = $this->createTarget('-', $a_node_id, $a_option["highlighted_subtree"], false);
986  $tpl->setVariable("ONCLICK_TARGET_EXPANDER", " onclick=\"return il.Explorer.refresh('tree_div', '" . $target . "');\"");
987  $tpl->setVariable("LINK_TARGET_EXPANDER", "#");
988  }
989  $tpl->setVariable("IMGPATH", $this->getImage("browser/minus.png"));
990  $tpl->parseCurrentBlock();
991  $pic = true;
992  }
993  }
994 
995  if (!$pic) {
996  $tpl->setCurrentBlock("blank");
997  $tpl->setVariable("BLANK_PATH", $this->getImage("browser/blank.png"));
998  $tpl->parseCurrentBlock();
999  }
1000 
1001  if ($this->output_icons) {
1002  $tpl->setCurrentBlock("icon");
1003  $tpl->setVariable("ICON_IMAGE", $this->getImage("icon_" . $a_option["type"] . ".svg", $a_option["type"], $a_obj_id));
1004 
1005  $tpl->setVariable("TARGET_ID", "iconid_" . $a_node_id);
1006  $this->iconList[] = "iconid_" . $a_node_id;
1007  $tpl->setVariable(
1008  "TXT_ALT_IMG",
1009  $this->getImageAlt($lng->txt("icon") . " " . $lng->txt($a_option["desc"]), $a_option["type"], $a_obj_id)
1010  );
1011  $tpl->parseCurrentBlock();
1012  }
1013 
1014  if (strlen($sel = $this->buildSelect($a_node_id, $a_option['type']))) {
1015  $tpl->setCurrentBlock('select');
1016  $tpl->setVariable('OBJ_SEL', $sel);
1017  $tpl->parseCurrentBlock();
1018  }
1019 
1020  if ($this->isClickable($a_option["type"], $a_node_id, $a_obj_id)) { // output link
1021  $tpl->setCurrentBlock("link");
1022  //$target = (strpos($this->target, "?") === false) ?
1023  // $this->target."?" : $this->target."&";
1024  //$tpl->setVariable("LINK_TARGET", $target.$this->target_get."=".$a_node_id.$this->params_get);
1025  $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["type"]));
1026 
1027  $style_class = $this->getNodeStyleClass($a_node_id, $a_option["type"]);
1028 
1029  if ($style_class != "") {
1030  $tpl->setVariable("A_CLASS", ' class="' . $style_class . '" ');
1031  }
1032 
1033  if (($onclick = $this->buildOnClick($a_node_id, $a_option["type"], $a_option["title"])) != "") {
1034  $tpl->setVariable("ONCLICK", "onClick=\"$onclick\"");
1035  }
1036 
1037  //$tpl->setVariable("LINK_NAME", $a_node_id);
1038  $tpl->setVariable("TITLE", ilUtil::shortenText(
1039  $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
1040  $this->textwidth,
1041  true
1042  ));
1043  $tpl->setVariable("DESC", ilUtil::shortenText(
1044  $this->buildDescription($a_option["description"], $a_node_id, $a_option["type"]),
1045  $this->textwidth,
1046  true
1047  ));
1048  $frame_target = $this->buildFrameTarget($a_option["type"], $a_node_id, $a_option["obj_id"]);
1049  if ($frame_target != "") {
1050  $tpl->setVariable("TARGET", " target=\"" . $frame_target . "\"");
1051  }
1052  $tpl->parseCurrentBlock();
1053  } else { // output text only
1054  $tpl->setCurrentBlock("text");
1055  $tpl->setVariable("OBJ_TITLE", ilUtil::shortenText(
1056  $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
1057  $this->textwidth,
1058  true
1059  ));
1060  $tpl->setVariable("OBJ_DESC", ilUtil::shortenText(
1061  $this->buildDescription($a_option["desc"], $a_node_id, $a_option["type"]),
1062  $this->textwidth,
1063  true
1064  ));
1065  $tpl->parseCurrentBlock();
1066  }
1067 
1068  $tpl->setCurrentBlock("list_item");
1069  $tpl->parseCurrentBlock();
1070  $tpl->touchBlock("element");
1071  }
global $ilErr
Definition: raiseError.php:16
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
get frame target (may be overwritten by derived classes)
getNodeStyleClass($a_id, $a_type)
get style class for node
buildLinkTarget($a_node_id, $a_type)
get link target (may be overwritten by derived classes)
buildSelect($a_node_id, $a_type)
standard implementation for adding an option select box between image and title
getAsynchExpanding()
Get asynch expanding.
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)
Create styles array
The data for the language used.
buildTitle($a_title, $a_id, $a_type)
standard implementation for title, may be overwritten by derived classes
getImage($a_name, $a_type="", $a_obj_id="")
get image path (may be overwritten by derived classes)
isClickable($a_type, $a_ref_id=0)
check if links for certain object type are activated
getImageAlt($a_default_text, $a_type="", $a_obj_id="")
get image alt text
buildDescription($a_desc, $a_id, $a_type)
standard implementation for description, may be overwritten by derived classes
+ 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 271 of file class.ilExplorer.php.

Referenced by createTarget(), and formatObject().

272  {
273  return $this->asnch_expanding;
274  }
+ 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 602 of file class.ilExplorer.php.

Referenced by setOutput().

603  {
604  return $this->tree->getChilds($a_parent_id, $this->order_column);
605  }
+ 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 570 of file class.ilExplorer.php.

References $filter_mode.

Referenced by checkFilter().

571  {
572  return $this->filter_mode;
573  }
+ Here is the caller graph for this function:

◆ getId()

ilExplorer::getId ( )

Get id.

Returns
string id

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

References $id.

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

252  {
253  return $this->id;
254  }
+ 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)

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

References ilUtil\getImagePath().

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

1077  {
1078  return ilUtil::getImagePath($a_name);
1079  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
+ 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

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

Referenced by formatObject().

1085  {
1086  return $a_default_text;
1087  }
+ 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 private

Parameters
arrayobject data
Returns
integer index

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

References $key.

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

1261  {
1262  if (!is_array($this->format_options)) {
1263  return -1;
1264  }
1265 
1266  foreach ($this->format_options as $key => $value) {
1267  if (($value["child"] == $a_data["parent"])) {
1268  return $key;
1269  }
1270  }
1271 
1272  return -1;
1273  }
$key
Definition: croninfo.php:18
+ Here is the caller graph for this function:

◆ getMaximumTreeDepth()

ilExplorer::getMaximumTreeDepth ( )

Get maximum tree depth.

Parameters

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

Referenced by getOutput().

761  {
762  $this->tree->getMaximumDepth();
763  }
+ Here is the caller graph for this function:

◆ getNodeStyleClass()

ilExplorer::getNodeStyleClass (   $a_id,
  $a_type 
)

get style class for node

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

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

1093  {
1094  if ($a_id == $this->highlighted) {
1095  return "il_HighlightedNode";
1096  }
1097  return "";
1098  }
+ Here is the caller graph for this function:

◆ getOutput()

ilExplorer::getOutput ( )

Creates output recursive method public.

Returns
string

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

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

773  {
774  $tpl = $this->tpl;
775  $lng = $this->lng;
776 
777  $this->format_options[0]["tab"] = array();
778 
779  $depth = $this->getMaximumTreeDepth();
780 
781  for ($i=0;$i<$depth;++$i) {
782  $this->createLines($i);
783  }
784 
785  include_once("./Services/YUI/classes/class.ilYuiUtil.php");
787  $tpl->addJavaScript("./Services/UIComponent/Explorer/js/ilExplorer.js");
788 
789  //echo "hh";
790  // set global body class
791  // $tpl->setBodyClass("il_Explorer");
792 
793  $tpl_tree = new ilTemplate("tpl.tree.html", true, true, "Services/UIComponent/Explorer");
794 
795  // updater
796  if (($_GET["ict"] || $_POST["collapseAll"] != "" || $_POST["expandAll"] != "") && $this->up_frame != "") {
797  $tpl_tree->setCurrentBlock("updater");
798  $tpl_tree->setVariable("UPDATE_FRAME", $this->up_frame);
799  $tpl_tree->setVariable("UPDATE_SCRIPT", $this->up_script);
800  if (is_array($this->up_params)) {
801  $up_str = $lim = "";
802  foreach ($this->up_params as $p) {
803  $up_str.= $lim . "'" . $p . "'";
804  $lim = ",";
805  }
806  $tpl_tree->setVariable("UPDATE_PARAMS", $up_str);
807  }
808  $tpl_tree->parseCurrentBlock();
809  }
810 
811  $cur_depth = -1;
812  foreach ($this->format_options as $key => $options) {
813  //echo "-".$options["depth"]."-";
814  if (!$options["visible"]) {
815  continue;
816  }
817 
818  // end tags
819  $this->handleListEndTags($tpl_tree, $cur_depth, $options["depth"]);
820 
821  // start tags
822  $this->handleListStartTags($tpl_tree, $cur_depth, $options["depth"]);
823 
824  $cur_depth = $options["depth"];
825 
826  if ($options["visible"] and $key != 0) {
827  $this->formatObject($tpl_tree, $options["child"], $options, $options['obj_id']);
828  }
829  if ($key == 0) {
830  $this->formatHeader($tpl_tree, $options["child"], $options);
831  }
832  }
833 
834  $this->handleListEndTags($tpl_tree, $cur_depth, -1);
835 
836  $tpl_tree->setVariable("TREE_LEAD", "");
837  if ($this->tree_lead != "") {
838  $tpl_tree->setCurrentBlock("tree_lead");
839  $tpl_tree->setVariable("TREE_LEAD", $this->tree_lead);
840  $tpl_tree->parseCurrentBlock();
841  }
842  if ($this->getId() != "") {
843  $tpl_tree->setVariable("TREE_ID", 'id="' . $this->getId() . '_tree"');
844  }
845 
846  $html = $tpl_tree->get();
847 
848  if ($this->getUseStandardFrame()) {
849  $mtpl = new ilTemplate("tpl.main.html", true, true);
850  $mtpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
851  $mtpl->setVariable("BODY_CLASS", "il_Explorer");
852  $mtpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
853  if ($this->getTitle() != "") {
854  $mtpl->setVariable("TXT_EXPLORER_HEADER", $this->getTitle());
855  }
856  if ($this->getId() != "") {
857  $mtpl->setVariable("ID", 'id="' . $this->getId() . '"');
858  }
859  $mtpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false));
860  $mtpl->setCurrentBlock("content");
861  $mtpl->setVariable("EXPLORER", $html);
862  $mtpl->setVariable("EXP_REFRESH", $lng->txt("refresh"));
863  $mtpl->parseCurrentBlock();
864  $html = $mtpl->get();
865  }
866 
867  return $html;
868  }
formatObject($tpl, $a_node_id, $a_option, $a_obj_id=0)
Creates output recursive method private.
formatHeader($tpl, $a_obj_id, $a_option)
Creates output for header (is empty here but can be overwritten in derived classes) ...
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
static initConnection(ilTemplate $a_main_tpl=null)
Init YUI Connection module.
getUseStandardFrame()
Get use standard explorer frame.
getId()
Get id.
handleListEndTags(&$a_tpl_tree, $a_cur_depth, $a_item_depth)
handle list end tags ( and )
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
getMaximumTreeDepth()
Get maximum tree depth.
handleListStartTags(&$a_tpl_tree, $a_cur_depth, $a_item_depth)
handle list start tags (
$i
Definition: disco.tpl.php:19
getTitle()
Get title.
$key
Definition: croninfo.php:18
$_POST["username"]
$html
Definition: example_001.php:87
createLines($a_depth)
Creates lines for explorer view private.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:

◆ getRoot()

ilExplorer::getRoot ( )

get root id

public

Parameters

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

References $root_id.

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

348  {
349  return $this->root_id == null ?
350  $this->tree->getRootId() :
352  }
+ Here is the caller graph for this function:

◆ getTitle()

ilExplorer::getTitle ( )

Get title.

Returns
title

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

References $title.

Referenced by getOutput().

323  {
324  return $this->title;
325  }
+ Here is the caller graph for this function:

◆ getTitleLength()

ilExplorer::getTitleLength ( )

Get max title length.

Returns

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

313  {
314  return $this->textwidth;
315  }

◆ getTreeLead()

ilExplorer::getTreeLead ( )

Get tree leading content.

Returns
string tree leading content

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

522  {
523  return $this->tree_lead;
524  }

◆ getUseStandardFrame()

ilExplorer::getUseStandardFrame ( )

Get use standard explorer frame.

Returns
boolean use standard explorer frame

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

References $use_standard_frame.

Referenced by getOutput().

592  {
594  }
+ 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 875 of file class.ilExplorer.php.

References $i.

Referenced by getOutput().

876  {
877  if ($a_item_depth < $a_cur_depth) {
878  // </li></ul> for ending lists
879  for ($i = 0; $i < ($a_cur_depth - $a_item_depth); $i++) {
880  $a_tpl_tree->touchBlock("end_list_item");
881  $a_tpl_tree->touchBlock("element");
882 
883  $a_tpl_tree->touchBlock("end_list");
884  $a_tpl_tree->touchBlock("element");
885  }
886  } elseif ($a_item_depth == $a_cur_depth) {
887  // </li> for ending list items
888  $a_tpl_tree->touchBlock("end_list_item");
889  $a_tpl_tree->touchBlock("element");
890  }
891  }
$i
Definition: disco.tpl.php:19
+ 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 896 of file class.ilExplorer.php.

Referenced by getOutput().

897  {
898  // start tags
899  if ($a_item_depth > $a_cur_depth) {
900  // <ul><li> for new lists
901  if ($a_item_depth > 1) {
902  $a_tpl_tree->touchBlock("start_list");
903  } else {
904  $a_tpl_tree->touchBlock("start_list_no_indent");
905  }
906  $a_tpl_tree->touchBlock("element");
907 
908  $a_tpl_tree->touchBlock("start_list_item");
909  $a_tpl_tree->touchBlock("element");
910  } else {
911  // <li> items
912  $a_tpl_tree->touchBlock("start_list_item");
913  $a_tpl_tree->touchBlock("element");
914  }
915  }
+ Here is the caller graph for this function:

◆ highlightNode()

ilExplorer::highlightNode (   $a_id)

set highlighted node

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

443  {
444  $this->highlighted = $a_id;
445  }

◆ initItemCounter()

ilExplorer::initItemCounter (   $a_number)

Init item counter.

public

Parameters
intnumber

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

284  {
285  $this->counter = $a_number;
286  }

◆ is_in_array()

ilExplorer::is_in_array (   $a_start,
  $a_depth 
)

DESCRIPTION MISSING private.

Parameters
integer
integer
Returns
boolean

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

References $i.

Referenced by createLines().

1241  {
1242  for ($i=$a_start;$i<count($this->format_options);++$i) {
1243  if ($this->format_options[$i]["depth"] < $a_depth) {
1244  break;
1245  }
1246 
1247  if ($this->format_options[$i]["depth"] == $a_depth) {
1248  return true;
1249  }
1250  }
1251  return false;
1252  }
$i
Definition: disco.tpl.php:19
+ 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

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

References $a_type.

Referenced by formatObject().

534  {
535  // in this standard implementation
536  // only the type determines, wether an object should be clickable or not
537  // but this method can be overwritten and make $exp->setFilterMode(IL_FM_NEGATIVE);use of the ref id
538  // (this happens e.g. in class ilRepositoryExplorerGUI)
539  if ($this->is_clickable[$a_type] == "n") {
540  return false;
541  } else {
542  return true;
543  }
544  }
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

◆ isVisible()

ilExplorer::isVisible (   $a_ref_id,
  $a_type 
)

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

References $rbacsystem.

Referenced by setOutput().

494  {
496 
497  if (!$this->rbac_check) {
498  return true;
499  }
500 
501  $visible = $rbacsystem->checkAccess('visible', $a_ref_id);
502 
503  return $visible;
504  }
+ Here is the caller graph for this function:

◆ modifyChilds()

ilExplorer::modifyChilds (   $a_parent_id,
  $a_objects 
)

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

Referenced by setOutput().

732  {
733  return $a_objects;
734  }
+ 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 472 of file class.ilExplorer.php.

Referenced by ilSCORMExplorer\__construct().

473  {
474  $this->output_icons = $a_icons;
475  }
+ Here is the caller graph for this function:

◆ setAsynchExpanding()

ilExplorer::setAsynchExpanding (   $a_val)

Set asynch expanding.

Parameters
boolean

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

262  {
263  $this->asnch_expanding = $a_val;
264  }

◆ 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 484 of file class.ilExplorer.php.

References $a_type.

485  {
486  if ($a_clickable) {
487  $this->is_clickable[$a_type] = "";
488  } else {
489  $this->is_clickable[$a_type] = "n";
490  }
491  }
$a_type
Definition: workflow.php:92

◆ 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,...) private

Parameters
stringpipe-separated integer

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

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

Referenced by assQuestionGUI\outSolutionExplorer(), ilBasicSkillGUI\selectLevelTrigger(), ilObjContentObjectGUI\showEntrySelector(), ilObjGlossaryGUI\showGlossarySelector(), and ilObjContentObjectGUI\showLMGlossarySelector().

1344  {
1345  // IF ISN'T SET CREATE SESSION VARIABLE
1346  if (!is_array($_SESSION[$this->expand_variable])) {
1348  }
1349  // IF $_GET["expand"] is positive => expand this node
1350  if ($a_node_id > 0 && !in_array($a_node_id, $_SESSION[$this->expand_variable])) {
1351  array_push($_SESSION[$this->expand_variable], $a_node_id);
1352  }
1353  // IF $_GET["expand"] is negative => compress this node
1354  if ($a_node_id < 0) {
1355  $key = array_keys($_SESSION[$this->expand_variable], -(int) $a_node_id);
1356  unset($_SESSION[$this->expand_variable][$key[0]]);
1357  }
1358  $this->expanded = $_SESSION[$this->expand_variable];
1359  }
$_SESSION["AccountId"]
getRoot()
get root id
Create styles array
The data for the language used.
$key
Definition: croninfo.php:18
+ 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 421 of file class.ilExplorer.php.

422  {
423  $this->expand_target = $a_exp_target;
424  }

◆ setFiltered()

ilExplorer::setFiltered (   $a_bool)

active/deactivate the filter public

Parameters
boolean
Returns
boolean

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

Referenced by ilECSNodeMappingLocalExplorer\__construct(), ilSolutionExplorer\__construct(), ilRoleDesktopItemSelector\__construct(), ilWorkspaceExplorer\__construct(), ilPasteIntoMultipleItemsExplorer\__construct(), ilContainerSelectionExplorer\__construct(), ilSearchRootSelector\__construct(), ilRepositoryExplorer\__construct(), and __construct().

1380  {
1381  $this->filtered = $a_bool;
1382  return true;
1383  }
+ Here is the caller graph for this function:

◆ setFilterMode()

ilExplorer::setFilterMode (   $a_mode = IL_FM_NEGATIVE)

◆ setFrameTarget()

ilExplorer::setFrameTarget (   $a_target)

set target frame or not frame?

Parameters
stringpublic

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

1199  {
1200  $this->frame_target = $a_target;
1201  }

◆ setFrameUpdater()

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

Set Explorer Updater.

Parameters
object$a_treeTree Object

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

432  {
433  $this->up_frame = $a_up_frame;
434  $this->up_script = $a_up_script;
435  $this->up_params = $a_params;
436  }

◆ setId()

ilExplorer::setId (   $a_val)

Set id.

Parameters
string$a_valid

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

Referenced by ilPasteIntoMultipleItemsExplorer\__construct().

242  {
243  $this->id = $a_val;
244  }
+ Here is the caller graph for this function:

◆ setOrderColumn()

ilExplorer::setOrderColumn (   $a_column)

set the order column public

Parameters
stringname of order column

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

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

360  {
361  $this->order_column = $a_column;
362  }
+ Here is the caller graph for this function:

◆ setOrderDirection()

ilExplorer::setOrderDirection (   $a_direction)

set the order direction public

Parameters
stringname of order column

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

370  {
371  if ($a_direction == "desc") {
372  $this->order_direction = $a_direction;
373  } else {
374  $this->order_direction = "asc";
375  }
376  }

◆ 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 public.

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

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

References $counter, $error, $i, $ilErr, $key, $tab, array, checkFilter(), forceExpanded(), getChildsOfNode(), getIndex(), getRoot(), isVisible(), modifyChilds(), showChilds(), and sortNodes().

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

◆ setParamsGet()

ilExplorer::setParamsGet (   $a_params_get)

set additional params to be passed in Get-string public

Parameters
array

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

References $error, $ilErr, and $key.

400  {
402 
403  if (!isset($a_params_get) or !is_array($a_params_get)) {
404  $ilErr->raiseError(get_class($this) . "::setTargetGet(): No target given!", $ilErr->WARNING);
405  }
406  $str = "";
407  foreach ($a_params_get as $key => $val) {
408  $str .= "&" . $key . "=" . $val;
409  }
410 
411  $this->params_get = $str;
412  }
global $ilErr
Definition: raiseError.php:16
$key
Definition: croninfo.php:18

◆ setPostSort()

ilExplorer::setPostSort (   $a_sort)

process post sorting

Parameters
boolean$a_sorttrue / false

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

Referenced by ilSurveySkillExplorer\__construct().

551  {
552  $this->post_sort = $a_sort;
553  }
+ Here is the caller graph for this function:

◆ setRoot()

ilExplorer::setRoot (   $a_root_id)

Set root node.

public

Parameters
intref id of root node

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

Referenced by ilECSNodeMappingLocalExplorer\__construct().

335  {
336  #$this->tree = new ilTree(ROOT_FOLDER_ID,$a_root_id);
337  $this->root_id = $a_root_id;
338  }
+ Here is the caller graph for this function:

◆ setSessionExpandVariable()

ilExplorer::setSessionExpandVariable (   $a_var_name = "expand")

◆ setTargetGet()

ilExplorer::setTargetGet (   $a_target_get)

set the varname in Get-string public

Parameters
stringvarname containing Ids to be used in GET-string

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

References $error, and $ilErr.

Referenced by ilSAHSPresentationGUI\explorer(), and ilSCORMPresentationGUI\explorer().

384  {
386 
387  if (!isset($a_target_get) or !is_string($a_target_get)) {
388  $ilErr->raiseError(get_class($this) . "::setTargetGet(): No target given!", $ilErr->WARNING);
389  }
390 
391  $this->target_get = $a_target_get;
392  }
global $ilErr
Definition: raiseError.php:16
+ Here is the caller graph for this function:

◆ setTitle()

ilExplorer::setTitle (   $a_val)

Set title.

Parameters
title

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

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

294  {
295  $this->title = $a_val;
296  }
+ Here is the caller graph for this function:

◆ setTitleLength()

ilExplorer::setTitleLength (   $a_length)

Set max title length.

Parameters
object$a_length
Returns

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

Referenced by ilECSNodeMappingCmsExplorer\__construct(), ilRoleDesktopItemSelector\__construct(), ilSurveySkillExplorer\__construct(), ilContainerSelectionExplorer\__construct(), ilSearchRootSelector\__construct(), and __construct().

304  {
305  $this->textwidth = $a_length;
306  }
+ Here is the caller graph for this function:

◆ setTreeLead()

ilExplorer::setTreeLead (   $a_val)

Set tree leading content.

Parameters
string$a_valtree leading content

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

512  {
513  $this->tree_lead = $a_val;
514  }

◆ 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 581 of file class.ilExplorer.php.

582  {
583  $this->use_standard_frame = $a_val;
584  }

◆ 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)

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

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

742  {
743  return true;
744  }
+ 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 private

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

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

References $key, and ilUtil\sortArray().

Referenced by setOutput().

1417  {
1418  foreach ($a_nodes as $key => $node) {
1419  if ($node["type"] == "adm") {
1420  $match = $key;
1421  $adm_node = $node;
1422  break;
1423  }
1424  }
1425 
1426  // cut off adm node
1427  isset($match) ? array_splice($a_nodes, $match, 1) : "";
1428 
1429  $a_nodes = ilUtil::sortArray($a_nodes, $this->order_column, $this->order_direction);
1430 
1431  // append adm node to end of list
1432  isset($match) ? array_push($a_nodes, $adm_node) : "";
1433 
1434  return $a_nodes;
1435  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $error

ilExplorer::$error
protected

◆ $expand_all

ilExplorer::$expand_all = false

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

◆ $expand_target

ilExplorer::$expand_target

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

◆ $expand_variable

ilExplorer::$expand_variable

◆ $expanded

ilExplorer::$expanded

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

◆ $filter_mode

ilExplorer::$filter_mode

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

Referenced by getFilterMode().

◆ $filtered

ilExplorer::$filtered = false

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

◆ $format_options

ilExplorer::$format_options

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

◆ $id

ilExplorer::$id

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

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

◆ $is_clickable

ilExplorer::$is_clickable

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

◆ $lng

◆ $obj_definition

ilExplorer::$obj_definition
protected

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

◆ $order_column

ilExplorer::$order_column

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

◆ $order_direction

ilExplorer::$order_direction = "asc"

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

◆ $output

ilExplorer::$output

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

Referenced by ilSCORMExplorer\getOutput().

◆ $output_icons

ilExplorer::$output_icons

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

◆ $params_get

ilExplorer::$params_get

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

Referenced by buildLinkTarget().

◆ $post_sort

ilExplorer::$post_sort

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

◆ $rbac_check

ilExplorer::$rbac_check

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

◆ $rbacsystem

◆ $root_id

ilExplorer::$root_id = null

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

Referenced by getRoot().

◆ $target

◆ $target_get

ilExplorer::$target_get

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

◆ $tpl

◆ $tree

◆ $use_standard_frame

ilExplorer::$use_standard_frame = false

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

Referenced by getUseStandardFrame().


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