ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilExplorer Class Reference

class for explorer view in admin frame More...

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

Public Member Functions

 setId (string $a_val)
 
 getId ()
 
 setAsynchExpanding (bool $a_val)
 
 getAsynchExpanding ()
 
 initItemCounter (int $a_number)
 
 setTitle (string $a_val)
 
 setTitleLength (int $a_length)
 
 getTitleLength ()
 
 getTitle ()
 
 setRoot ($a_root_id)
 
 getRoot ()
 
 setOrderColumn (string $a_column)
 
 setOrderDirection (string $a_direction)
 
 setTargetGet (string $a_target_get)
 
 setParamsGet (array $a_params_get)
 
 setExpandTarget (string $a_exp_target)
 target script for expand icons More...
 
 setFrameUpdater (string $a_up_frame, string $a_up_script, string $a_params="")
 
 highlightNode (string $a_id)
 
 checkPermissions (bool $a_check)
 
 setSessionExpandVariable (string $a_var_name="expand")
 
 outputIcons (bool $a_icons)
 
 setClickable (string $a_type, bool $a_clickable)
 
 isVisible ( $a_ref_id, string $a_type)
 
 setTreeLead (string $a_val)
 
 getTreeLead ()
 
 isClickable (string $type, int $ref_id=0)
 
 setPostSort (bool $a_sort)
 
 setFilterMode (int $a_mode=IL_FM_NEGATIVE)
 
 getFilterMode ()
 
 setUseStandardFrame (bool $a_val)
 Set use standard frame. More...
 
 getUseStandardFrame ()
 
 getChildsOfNode ($a_parent_id)
 
 setOutput ( $a_parent_id, int $a_depth=1, int $a_obj_id=0, bool $a_highlighted_subtree=false)
 Creates output for explorer view in admin menue recursive method. More...
 
 modifyChilds ( $a_parent_id, array $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 ()
 
 getOutput ()
 
 handleListEndTags (ilTemplate $a_tpl_tree, int $a_cur_depth, int $a_item_depth)
 handle list end tags ( and ) More...
 
 handleListStartTags (ilTemplate $a_tpl_tree, int $a_cur_depth, int $a_item_depth)
 handle list start tags ( More...
 
 formatHeader (ilTemplate $tpl, $a_obj_id, array $a_option)
 
 formatObject (ilTemplate $tpl, $a_node_id, array $a_option, $a_obj_id=0)
 
 getImage (string $a_name, string $a_type="", $a_obj_id="")
 
 getImageAlt (string $a_default_text, string $a_type="", $a_obj_id="")
 
 getNodeStyleClass ( $a_id, string $a_type)
 
 buildLinkTarget ( $a_node_id, string $a_type)
 
 buildOnClick ( $a_node_id, string $a_type, string $a_title)
 
 buildTitle (string $a_title, $a_id, string $a_type)
 
 buildDescription (string $a_desc, $a_id, string $a_type)
 
 buildSelect ($a_node_id, string $a_type)
 standard implementation for adding an option select box between image and title More...
 
 buildFrameTarget (string $a_type, $a_child=0, $a_obj_id=0)
 
 createTarget (string $a_type, $a_node_id, bool $a_highlighted_subtree=false, bool $a_append_anch=true)
 
 setFrameTarget (string $a_target)
 
 createLines (int $a_depth)
 
 is_in_array (int $a_start, int $a_depth)
 
 getIndex (array $a_data)
 
 addFilter (string $a_item)
 
 delFilter (string $a_item)
 
 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,...) More...
 
 forceExpandAll (bool $a_mode, bool $a_show_minus=true)
 force expandAll. More...
 
 setFiltered (bool $a_bool)
 
 checkFilter (string $a_item)
 
 sortNodes (array $a_nodes, $a_parent_obj_id)
 sort nodes and put adm object to the end of sorted array More...
 

Data Fields

string $id = ""
 
string $output = ""
 
array $format_options = []
 
ilTree $tree
 
string $target = ""
 
string $target_get = ""
 
string $params_get = ""
 
array $expanded = []
 
string $order_column = ""
 
string $order_direction = "asc"
 
string $expand_target = null
 
bool $rbac_check = false
 
bool $output_icons = false
 
string $expand_variable = ""
 
array $is_clickable = []
 
bool $post_sort = false
 
bool $filtered = false
 
bool $filter_mode
 
bool $expand_all = false
 
 $root_id = null
 
bool $use_standard_frame = false
 

Protected Member Functions

 requestStr (string $key)
 

Protected Attributes

ilObjectDefinition $obj_definition
 
ilErrorHandling $error
 
ilRbacSystem $rbacsystem
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
 $filter = []
 
string $highlighted = ""
 
bool $show_minus = true
 
int $counter = 0
 
bool $asnch_expanding = false
 
int $textwidth = 0
 
string $title = ""
 
string $up_frame = ""
 
string $a_up_script = ""
 
string $up_params = ""
 
string $frame_target = ""
 
string $up_script = ""
 
string $tree_lead = ""
 
array $iconList = []
 
ILIAS Refinery Factory $refinery
 
ILIAS HTTP Wrapper WrapperFactory $wrapper
 

Detailed Description

class for explorer view in admin frame

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Deprecated:
10

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

Member Function Documentation

◆ addFilter()

ilExplorer::addFilter ( string  $a_item)

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

References ILIAS\Repository\filter().

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

1000  : bool
1001  {
1002  if (is_array($this->filter)) {
1003  //run through filter
1004  foreach ($this->filter as $item) {
1005  if ($item === $a_item) {
1006  return false;
1007  }
1008  }
1009  } else {
1010  $this->filter = array();
1011  }
1012  $this->filter[] = $a_item;
1013 
1014  return true;
1015  }
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildDescription()

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

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

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

881  : string {
882  return "";
883  }
+ Here is the caller graph for this function:

◆ buildFrameTarget()

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

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

References $frame_target.

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

897  : string {
898  return $this->frame_target;
899  }
string $frame_target
+ Here is the caller graph for this function:

◆ buildLinkTarget()

ilExplorer::buildLinkTarget (   $a_node_id,
string  $a_type 
)

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

References $params_get.

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

854  : string {
855  $target = (strpos($this->target, "?") === false)
856  ? $this->target . "?"
857  : $this->target . "&";
858  return $target . $this->target_get . "=" . $a_node_id . $this->params_get;
859  }
string $params_get
+ Here is the caller graph for this function:

◆ buildOnClick()

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

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

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

865  : string {
866  return "";
867  }
+ Here is the caller graph for this function:

◆ buildSelect()

ilExplorer::buildSelect (   $a_node_id,
string  $a_type 
)

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

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

Referenced by formatObject().

888  : string
889  {
890  return "";
891  }
+ Here is the caller graph for this function:

◆ buildTitle()

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

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

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

873  : string {
874  return $a_title;
875  }
+ Here is the caller graph for this function:

◆ checkFilter()

ilExplorer::checkFilter ( string  $a_item)

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

References ILIAS\Repository\filter(), getFilterMode(), and IL_FM_NEGATIVE.

Referenced by setOutput().

1085  : bool
1086  {
1087  if (is_array($this->filter)) {
1088  if (in_array($a_item, $this->filter)) {
1089  $ret = true;
1090  } else {
1091  $ret = false;
1092  }
1093  } else {
1094  $ret = false;
1095  }
1096 
1097  if ($this->getFilterMode() === IL_FM_NEGATIVE) {
1098  return $ret;
1099  } else {
1100  return !$ret;
1101  }
1102  }
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
const IL_FM_NEGATIVE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkPermissions()

ilExplorer::checkPermissions ( bool  $a_check)

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

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

266  : void
267  {
268  $this->rbac_check = $a_check;
269  }
+ Here is the caller graph for this function:

◆ createLines()

ilExplorer::createLines ( int  $a_depth)

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

References is_in_array().

Referenced by getOutput().

943  : void
944  {
945  for ($i = 0, $iMax = count($this->format_options); $i < $iMax; ++$i) {
946  if ($this->format_options[$i]["depth"] == $a_depth + 1
947  and !$this->format_options[$i]["container"]
948  and $this->format_options[$i]["depth"] != 1) {
949  $this->format_options[$i]["tab"][(string) $a_depth] = "quer";
950  }
951 
952  if ($this->format_options[$i]["depth"] == $a_depth + 2) {
953  if ($this->is_in_array($i + 1, $this->format_options[$i]["depth"])) {
954  $this->format_options[$i]["tab"][(string) $a_depth] = "winkel";
955  } else {
956  $this->format_options[$i]["tab"][(string) $a_depth] = "ecke";
957  }
958  }
959 
960  if ($this->format_options[$i]["depth"] > $a_depth + 2) {
961  if ($this->is_in_array($i + 1, $a_depth + 2)) {
962  $this->format_options[$i]["tab"][(string) $a_depth] = "hoch";
963  }
964  }
965  }
966  }
is_in_array(int $a_start, int $a_depth)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createTarget()

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

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

References $error, $ilErr, getAsynchExpanding(), and ILIAS\Repository\int().

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

907  : string {
909 
910  if (!isset($a_type) or !is_string($a_type) or !isset($a_node_id)) {
911  $ilErr->raiseError(get_class($this) . "::createTarget(): Missing parameter or wrong datatype! " .
912  "type: " . $a_type . " node_id:" . $a_node_id, $ilErr->WARNING);
913  }
914 
915  // SET expand parameter:
916  // positive if object is expanded
917  // negative if object is compressed
918  $a_node_id = $a_type === '+' ? $a_node_id : -(int) $a_node_id;
919 
920  $sep = (is_int(strpos($this->expand_target, "?")))
921  ? "&"
922  : "?";
923 
924  // in current tree flag
925  $ict_str = ($a_highlighted_subtree || $this->highlighted === "")
926  ? "&ict=1"
927  : "";
928  if ($this->getAsynchExpanding()) {
929  $ict_str .= "&cmdMode=asynch";
930  }
931  if ($a_append_anch) {
932  return $this->expand_target . $sep . $this->expand_variable . "=" . $a_node_id . $this->params_get . $ict_str . "#" . abs($a_node_id);
933  } else {
934  return $this->expand_target . $sep . $this->expand_variable . "=" . $a_node_id . $this->params_get . $ict_str;
935  }
936  }
$ilErr
Definition: raiseError.php:33
ilErrorHandling $error
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delFilter()

ilExplorer::delFilter ( string  $a_item)

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

References ILIAS\Repository\filter().

1017  : bool
1018  {
1019  $deleted = 0;
1020  //check if a filter exists
1021  if (is_array($this->filter)) {
1022  //build copy of the existing filter without the given item
1023  $tmp = array();
1024 
1025  foreach ($this->filter as $item) {
1026  if ($item !== $a_item) {
1027  $tmp[] = $item;
1028  } else {
1029  $deleted = 1;
1030  }
1031  }
1032 
1033  $this->filter = $tmp;
1034  } else {
1035  return false;
1036  }
1037 
1038  return $deleted === 1;
1039  }
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
+ Here is the call graph for this function:

◆ forceExpandAll()

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

force expandAll.

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

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

1074  : void {
1075  $this->expand_all = $a_mode;
1076  $this->show_minus = $a_show_minus;
1077  }

◆ forceExpanded()

ilExplorer::forceExpanded (   $a_obj_id)

force expansion of node

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

Referenced by setOutput().

509  : bool
510  {
511  return false;
512  }
+ Here is the caller graph for this function:

◆ formatHeader()

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

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

Referenced by getOutput().

671  : void {
672  }
+ Here is the caller graph for this function:

◆ formatObject()

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

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

References $error, $ilErr, $lng, buildDescription(), buildFrameTarget(), buildLinkTarget(), buildOnClick(), buildSelect(), buildTitle(), createTarget(), getAsynchExpanding(), getImage(), getImageAlt(), getNodeStyleClass(), isClickable(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), ilStr\shortenTextExtended(), ilTemplate\touchBlock(), and ilLanguage\txt().

Referenced by getOutput().

679  : void {
680  $lng = $this->lng;
682 
683  if (!isset($a_node_id) or !is_array($a_option)) {
684  $ilErr->raiseError(get_class($this) . "::formatObject(): Missing parameter or wrong datatype! " .
685  "node_id: " . $a_node_id . " options:" . var_export($a_option, true), $ilErr->WARNING);
686  }
687 
688  $pic = false;
689  foreach ((array) $a_option["tab"] as $picture) {
690  if ($picture === 'plus') {
691  $tpl->setCurrentBlock("expander");
692  $tpl->setVariable("EXP_DESC", $lng->txt("collapsed"));
693  $tpl->setVariable("LINK_NAME", $a_node_id);
694  if (!$this->getAsynchExpanding()) {
695  $target = $this->createTarget('+', $a_node_id, $a_option["highlighted_subtree"]);
696  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
697  } else {
698  $target = $this->createTarget('+', $a_node_id, $a_option["highlighted_subtree"], false);
699  $tpl->setVariable("ONCLICK_TARGET_EXPANDER", " onclick=\"return il.Explorer.refresh('tree_div', '" . $target . "');\"");
700  $tpl->setVariable("LINK_TARGET_EXPANDER", "#");
701  }
702  $tpl->setVariable("IMGPATH", $this->getImage("browser/plus.png"));
703  $tpl->parseCurrentBlock();
704  $pic = true;
705  }
706 
707  if ($picture === 'forceexp') {
708  $tpl->setCurrentBlock("expander");
709  $tpl->setVariable("EXP_DESC", $lng->txt("expanded"));
710  $target = $this->createTarget('+', $a_node_id);
711  $tpl->setVariable("LINK_NAME", $a_node_id);
712  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
713  $tpl->setVariable("IMGPATH", $this->getImage("browser/forceexp.png"));
714  $tpl->parseCurrentBlock();
715  $pic = true;
716  }
717 
718  if ($picture === 'minus' && $this->show_minus) {
719  $tpl->setCurrentBlock("expander");
720  $tpl->setVariable("EXP_DESC", $lng->txt("expanded"));
721  $tpl->setVariable("LINK_NAME", $a_node_id);
722  if (!$this->getAsynchExpanding()) {
723  $target = $this->createTarget('-', $a_node_id, $a_option["highlighted_subtree"]);
724  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
725  } else {
726  $target = $this->createTarget('-', $a_node_id, $a_option["highlighted_subtree"], false);
727  $tpl->setVariable("ONCLICK_TARGET_EXPANDER", " onclick=\"return il.Explorer.refresh('tree_div', '" . $target . "');\"");
728  $tpl->setVariable("LINK_TARGET_EXPANDER", "#");
729  }
730  $tpl->setVariable("IMGPATH", $this->getImage("browser/minus.png"));
731  $tpl->parseCurrentBlock();
732  $pic = true;
733  }
734  }
735 
736  if (!$pic) {
737  $tpl->setCurrentBlock("blank");
738  $tpl->setVariable("BLANK_PATH", $this->getImage("browser/blank.png"));
739  $tpl->parseCurrentBlock();
740  }
741 
742  if ($this->output_icons) {
743  $tpl->setCurrentBlock("icon");
744  $tpl->setVariable("ICON_IMAGE", $this->getImage("standard/icon_" . $a_option["type"] . ".svg", $a_option["type"], $a_obj_id));
745 
746  $tpl->setVariable("TARGET_ID", "iconid_" . $a_node_id);
747  $this->iconList[] = "iconid_" . $a_node_id;
748  $tpl->setVariable(
749  "TXT_ALT_IMG",
750  $this->getImageAlt($lng->txt("icon") . " " . $lng->txt($a_option["desc"]), $a_option["type"], $a_obj_id)
751  );
752  $tpl->parseCurrentBlock();
753  }
754 
755  if (($sel = $this->buildSelect($a_node_id, $a_option['type'])) !== '') {
756  $tpl->setCurrentBlock('select');
757  $tpl->setVariable('OBJ_SEL', $sel);
758  $tpl->parseCurrentBlock();
759  }
760 
761  if ($this->isClickable($a_option["type"], $a_node_id)) { // output link
762  $tpl->setCurrentBlock("link");
763  //$target = (strpos($this->target, "?") === false) ?
764  // $this->target."?" : $this->target."&";
765  //$tpl->setVariable("LINK_TARGET", $target.$this->target_get."=".$a_node_id.$this->params_get);
766  $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["type"]));
767 
768  $style_class = $this->getNodeStyleClass($a_node_id, $a_option["type"]);
769 
770  if ($style_class !== "") {
771  $tpl->setVariable("A_CLASS", ' class="' . $style_class . '" ');
772  }
773 
774  if (($onclick = $this->buildOnClick($a_node_id, $a_option["type"], $a_option["title"])) != "") {
775  $tpl->setVariable("ONCLICK", "onClick=\"$onclick\"");
776  }
777 
778  //$tpl->setVariable("LINK_NAME", $a_node_id);
779  $tpl->setVariable(
780  "TITLE",
782  $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
783  $this->textwidth,
784  true
785  )
786  );
787  $tpl->setVariable(
788  "DESC",
790  $this->buildDescription($a_option["description"] ?? "", $a_node_id, $a_option["type"]),
791  $this->textwidth,
792  true
793  )
794  );
795  $frame_target = $this->buildFrameTarget($a_option["type"], $a_node_id, $a_option["obj_id"]);
796  if ($frame_target !== "") {
797  $tpl->setVariable("TARGET", " target=\"" . $frame_target . "\"");
798  }
799  } else { // output text only
800  $tpl->setCurrentBlock("text");
801  $tpl->setVariable(
802  "OBJ_TITLE",
804  $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
805  $this->textwidth,
806  true
807  )
808  );
809  $tpl->setVariable(
810  "OBJ_DESC",
812  $this->buildDescription($a_option["desc"], $a_node_id, $a_option["type"]),
813  $this->textwidth,
814  true
815  )
816  );
817  }
818  $tpl->parseCurrentBlock();
819 
820  $tpl->setCurrentBlock("list_item");
821  $tpl->parseCurrentBlock();
822  $tpl->touchBlock("element");
823  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
buildDescription(string $a_desc, $a_id, string $a_type)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
buildTitle(string $a_title, $a_id, string $a_type)
ilLanguage $lng
buildSelect($a_node_id, string $a_type)
standard implementation for adding an option select box between image and title
$ilErr
Definition: raiseError.php:33
getImageAlt(string $a_default_text, string $a_type="", $a_obj_id="")
touchBlock(string $block)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
isClickable(string $type, int $ref_id=0)
string $frame_target
buildFrameTarget(string $a_type, $a_child=0, $a_obj_id=0)
getNodeStyleClass( $a_id, string $a_type)
getImage(string $a_name, string $a_type="", $a_obj_id="")
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
ilErrorHandling $error
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
createTarget(string $a_type, $a_node_id, bool $a_highlighted_subtree=false, bool $a_append_anch=true)
buildLinkTarget( $a_node_id, string $a_type)
buildOnClick( $a_node_id, string $a_type, string $a_title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAsynchExpanding()

ilExplorer::getAsynchExpanding ( )

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

References $asnch_expanding.

Referenced by createTarget(), and formatObject().

155  : bool
156  {
157  return $this->asnch_expanding;
158  }
+ Here is the caller graph for this function:

◆ getChildsOfNode()

ilExplorer::getChildsOfNode (   $a_parent_id)

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

Referenced by setOutput().

360  : array
361  {
362  return $this->tree->getChilds($a_parent_id, $this->order_column);
363  }
+ Here is the caller graph for this function:

◆ getFilterMode()

ilExplorer::getFilterMode ( )
Returns
int filter mode IL_FM_NEGATIVE | IL_FM_NEGATIVE

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

References $filter_mode.

Referenced by checkFilter().

341  : int
342  {
343  return $this->filter_mode;
344  }
+ Here is the caller graph for this function:

◆ getId()

ilExplorer::getId ( )

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

References $id.

Referenced by getOutput().

145  : string
146  {
147  return $this->id;
148  }
+ Here is the caller graph for this function:

◆ getImage()

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

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

References ilUtil\getImagePath().

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

829  : string {
830  return ilUtil::getImagePath($a_name);
831  }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $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 ( string  $a_default_text,
string  $a_type = "",
  $a_obj_id = "" 
)

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

Referenced by formatObject().

837  : string {
838  return $a_default_text;
839  }
+ Here is the caller graph for this function:

◆ getIndex()

ilExplorer::getIndex ( array  $a_data)

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

Referenced by setOutput().

985  : int
986  {
987  if (!is_array($this->format_options)) {
988  return -1;
989  }
990 
991  foreach ($this->format_options as $key => $value) {
992  if (($value["child"] == $a_data["parent"])) {
993  return $key;
994  }
995  }
996 
997  return -1;
998  }
+ Here is the caller graph for this function:

◆ getMaximumTreeDepth()

ilExplorer::getMaximumTreeDepth ( )

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

Referenced by getOutput().

514  : int
515  {
516  $this->tree->getMaximumDepth();
517  return 0; // seems to not return the value...
518  }
+ Here is the caller graph for this function:

◆ getNodeStyleClass()

ilExplorer::getNodeStyleClass (   $a_id,
string  $a_type 
)

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

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

844  : string {
845  if ($a_id == $this->highlighted) {
846  return "il_HighlightedNode";
847  }
848  return "";
849  }
+ Here is the caller graph for this function:

◆ getOutput()

ilExplorer::getOutput ( )

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

References $lng, $tpl, ILIAS\UICore\GlobalTemplate\addJavaScript(), createLines(), formatHeader(), formatObject(), getId(), ilUtil\getImagePath(), getMaximumTreeDepth(), ilUtil\getStyleSheetLocation(), getTitle(), getUseStandardFrame(), handleListEndTags(), handleListStartTags(), ilYuiUtil\initConnection(), requestStr(), and ilLanguage\txt().

521  : string
522  {
523  $tpl = $this->tpl;
524  $lng = $this->lng;
525 
526  $this->format_options[0]["tab"] = array();
527 
528  $depth = $this->getMaximumTreeDepth();
529 
530  for ($i = 0;$i < $depth;++$i) {
531  $this->createLines($i);
532  }
533 
535  $tpl->addJavaScript("assets/js/ilExplorer.js");
536 
537  //echo "hh";
538  // set global body class
539  // $tpl->setBodyClass("il_Explorer");
540 
541  $tpl_tree = new ilTemplate("tpl.tree.html", true, true, "components/ILIAS/UIComponent/Explorer");
542 
543  // updater
544  if (($this->requestStr("ict") !== "" ||
545  $this->requestStr("collapseAll") !== "" ||
546  $this->requestStr("expandAll") !== "") && $this->up_frame !== "") {
547  $tpl_tree->setCurrentBlock("updater");
548  $tpl_tree->setVariable("UPDATE_FRAME", $this->up_frame);
549  $tpl_tree->setVariable("UPDATE_SCRIPT", $this->up_script);
550  if (is_array($this->up_params)) {
551  $up_str = $lim = "";
552  foreach ($this->up_params as $p) {
553  $up_str .= $lim . "'" . $p . "'";
554  $lim = ",";
555  }
556  $tpl_tree->setVariable("UPDATE_PARAMS", $up_str);
557  }
558  $tpl_tree->parseCurrentBlock();
559  }
560  $cur_depth = -1;
561  foreach ($this->format_options as $key => $options) {
562  //echo "-".$options["depth"]."-";
563  if (!($options["visible"] ?? false)) {
564  continue;
565  }
566 
567  // end tags
568  $this->handleListEndTags($tpl_tree, $cur_depth, $options["depth"]);
569 
570  // start tags
571  $this->handleListStartTags($tpl_tree, $cur_depth, $options["depth"]);
572 
573  $cur_depth = $options["depth"];
574 
575  if ($options["visible"] and $key != 0) {
576  $this->formatObject($tpl_tree, $options["child"], $options, $options['obj_id']);
577  }
578  if ($key == 0) {
579  $this->formatHeader($tpl_tree, $options["child"], $options);
580  }
581  }
582 
583  $this->handleListEndTags($tpl_tree, $cur_depth, -1);
584 
585  $tpl_tree->setVariable("TREE_LEAD", "");
586  if ($this->tree_lead !== "") {
587  $tpl_tree->setCurrentBlock("tree_lead");
588  $tpl_tree->setVariable("TREE_LEAD", $this->tree_lead);
589  $tpl_tree->parseCurrentBlock();
590  }
591  if ($this->getId() !== "") {
592  $tpl_tree->setVariable("TREE_ID", 'id="' . $this->getId() . '_tree"');
593  }
594 
595  $html = $tpl_tree->get();
596 
597  if ($this->getUseStandardFrame()) {
598  $mtpl = new ilGlobalTemplate("tpl.main.html", true, true);
599  $mtpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
600  $mtpl->setVariable("BODY_CLASS", "il_Explorer");
601  $mtpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
602  if ($this->getTitle() !== "") {
603  $mtpl->setVariable("TXT_EXPLORER_HEADER", $this->getTitle());
604  }
605  if ($this->getId() !== "") {
606  $mtpl->setVariable("ID", 'id="' . $this->getId() . '"');
607  }
608  $mtpl->setVariable("IMG_SPACE", ilUtil::getImagePath("media/spacer.png", false));
609  $mtpl->setCurrentBlock("content");
610  $mtpl->setVariable("EXPLORER", $html);
611  $mtpl->setVariable("EXP_REFRESH", $lng->txt("refresh"));
612  $mtpl->parseCurrentBlock();
613  $html = $mtpl->get();
614  }
615 
616  return $html;
617  }
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
createLines(int $a_depth)
handleListEndTags(ilTemplate $a_tpl_tree, int $a_cur_depth, int $a_item_depth)
handle list end tags ( and )
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
special template class to simplify handling of ITX/PEAR
ilLanguage $lng
handleListStartTags(ilTemplate $a_tpl_tree, int $a_cur_depth, int $a_item_depth)
handle list start tags (
ilGlobalTemplateInterface $tpl
formatHeader(ilTemplate $tpl, $a_obj_id, array $a_option)
formatObject(ilTemplate $tpl, $a_node_id, array $a_option, $a_obj_id=0)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
requestStr(string $key)
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
static initConnection(?ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI Connection module.
+ Here is the call graph for this function:

◆ getRoot()

ilExplorer::getRoot ( )

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

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

191  : ?int
192  {
193  return $this->root_id ?? $this->tree->getRootId();
194  }
+ Here is the caller graph for this function:

◆ getTitle()

ilExplorer::getTitle ( )

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

References $title.

Referenced by getOutput().

180  : string
181  {
182  return $this->title;
183  }
+ Here is the caller graph for this function:

◆ getTitleLength()

ilExplorer::getTitleLength ( )

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

References $textwidth.

175  : int
176  {
177  return $this->textwidth;
178  }

◆ getTreeLead()

ilExplorer::getTreeLead ( )

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

References $tree_lead.

311  : string
312  {
313  return $this->tree_lead;
314  }

◆ getUseStandardFrame()

ilExplorer::getUseStandardFrame ( )

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

References $use_standard_frame.

Referenced by getOutput().

355  : bool
356  {
358  }
bool $use_standard_frame
+ Here is the caller graph for this function:

◆ handleListEndTags()

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

handle list end tags ( and )

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

References ilTemplate\touchBlock().

Referenced by getOutput().

628  : void {
629  if ($a_item_depth < $a_cur_depth) {
630  // </li></ul> for ending lists
631  for ($i = 0; $i < ($a_cur_depth - $a_item_depth); $i++) {
632  $a_tpl_tree->touchBlock("end_list_item");
633  $a_tpl_tree->touchBlock("element");
634 
635  $a_tpl_tree->touchBlock("end_list");
636  $a_tpl_tree->touchBlock("element");
637  }
638  } elseif ($a_item_depth == $a_cur_depth) {
639  // </li> for ending list items
640  $a_tpl_tree->touchBlock("end_list_item");
641  $a_tpl_tree->touchBlock("element");
642  }
643  }
touchBlock(string $block)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleListStartTags()

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

handle list start tags (

)

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

References ilTemplate\touchBlock().

Referenced by getOutput().

652  : void {
653  // start tags
654  if ($a_item_depth > $a_cur_depth) {
655  // <ul><li> for new lists
656  if ($a_item_depth > 1) {
657  $a_tpl_tree->touchBlock("start_list");
658  } else {
659  $a_tpl_tree->touchBlock("start_list_no_indent");
660  }
661  $a_tpl_tree->touchBlock("element");
662  }
663  $a_tpl_tree->touchBlock("start_list_item");
664  $a_tpl_tree->touchBlock("element");
665  }
touchBlock(string $block)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ highlightNode()

ilExplorer::highlightNode ( string  $a_id)

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

261  : void
262  {
263  $this->highlighted = $a_id;
264  }

◆ initItemCounter()

ilExplorer::initItemCounter ( int  $a_number)

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

160  : void
161  {
162  $this->counter = $a_number;
163  }

◆ is_in_array()

ilExplorer::is_in_array ( int  $a_start,
int  $a_depth 
)

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

Referenced by createLines().

971  : bool {
972  for ($i = $a_start, $iMax = count($this->format_options); $i < $iMax; ++$i) {
973  if ($this->format_options[$i]["depth"] < $a_depth) {
974  break;
975  }
976 
977  if ($this->format_options[$i]["depth"] == $a_depth) {
978  return true;
979  }
980  }
981  return false;
982  }
+ Here is the caller graph for this function:

◆ isClickable()

ilExplorer::isClickable ( string  $type,
int  $ref_id = 0 
)

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

Referenced by formatObject().

320  : bool {
321  // in this standard implementation
322  // only the type determines, wether an object should be clickable or not
323  // but this method can be overwritten and make $exp->setFilterMode(IL_FM_NEGATIVE);use of the ref id
324  // (this happens e.g. in class ilRepositoryExplorerGUI)
325  return $this->is_clickable[$type] !== "n";
326  }
+ Here is the caller graph for this function:

◆ isVisible()

ilExplorer::isVisible (   $a_ref_id,
string  $a_type 
)

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

References $rbacsystem, and ilRbacSystem\checkAccess().

Referenced by setOutput().

293  : bool {
295 
296  if (!$this->rbac_check) {
297  return true;
298  }
299 
300  $visible = $rbacsystem->checkAccess('visible', $a_ref_id);
301 
302  return $visible;
303  }
ilRbacSystem $rbacsystem
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modifyChilds()

ilExplorer::modifyChilds (   $a_parent_id,
array  $a_objects 
)

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

Referenced by setOutput().

492  : array {
493  return $a_objects;
494  }
+ Here is the caller graph for this function:

◆ outputIcons()

ilExplorer::outputIcons ( bool  $a_icons)

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

Referenced by ilSCORMExplorer\__construct().

276  : void
277  {
278  $this->output_icons = $a_icons;
279  }
+ Here is the caller graph for this function:

◆ requestStr()

ilExplorer::requestStr ( string  $key)
protected

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

References ILIAS\Repository\refinery().

Referenced by getOutput().

128  : string
129  {
130  $str = $this->refinery->kindlyTo()->string();
131  if ($this->wrapper->post()->has($key)) {
132  return $this->wrapper->post()->retrieve($key, $str);
133  }
134  if ($this->wrapper->query()->has($key)) {
135  return $this->wrapper->query()->retrieve($key, $str);
136  }
137  return "";
138  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAsynchExpanding()

ilExplorer::setAsynchExpanding ( bool  $a_val)

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

150  : void
151  {
152  $this->asnch_expanding = $a_val;
153  }

◆ setClickable()

ilExplorer::setClickable ( string  $a_type,
bool  $a_clickable 
)

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

281  : void
282  {
283  if ($a_clickable) {
284  $this->is_clickable[$a_type] = "";
285  } else {
286  $this->is_clickable[$a_type] = "n";
287  }
288  }

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

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

References ilSession\get(), getRoot(), and ilSession\set().

Referenced by assQuestionGUI\outSolutionExplorer(), ilSearchRootSelector\setPathOpen(), ilObjGlossaryGUI\showGlossarySelector(), and ilObjContentObjectGUI\showLMGlossarySelector().

1045  : void
1046  {
1047  // IF ISN'T SET CREATE SESSION VARIABLE
1048  if (!is_array(ilSession::get($this->expand_variable))) {
1049  ilSession::set($this->expand_variable, [$this->getRoot()]);
1050  }
1051  if ($a_node_id > 0 && !in_array($a_node_id, ilSession::get($this->expand_variable))) {
1052  $exp = ilSession::get($this->expand_variable);
1053  $exp[] = $a_node_id;
1054  ilSession::set($this->expand_variable, $exp);
1055  }
1056  if ($a_node_id < 0) {
1057  $key = array_keys(ilSession::get($this->expand_variable), -(int) $a_node_id);
1058  $exp = ilSession::get($this->expand_variable);
1059  if (isset($key[0]) && isset($exp[$key[0]])) {
1060  unset($exp[$key[0]]);
1061  }
1062  ilSession::set($this->expand_variable, $exp);
1063  }
1064  $this->expanded = (array) ilSession::get($this->expand_variable);
1065  }
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setExpandTarget()

ilExplorer::setExpandTarget ( string  $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 245 of file class.ilExplorer.php.

245  : void
246  {
247  $this->expand_target = $a_exp_target;
248  }

◆ setFiltered()

ilExplorer::setFiltered ( bool  $a_bool)

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

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

1079  : bool
1080  {
1081  $this->filtered = $a_bool;
1082  return true;
1083  }
+ Here is the caller graph for this function:

◆ setFilterMode()

ilExplorer::setFilterMode ( int  $a_mode = IL_FM_NEGATIVE)

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

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

333  : void
334  {
335  $this->filter_mode = $a_mode;
336  }
+ Here is the caller graph for this function:

◆ setFrameTarget()

ilExplorer::setFrameTarget ( string  $a_target)

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

938  : void
939  {
940  $this->frame_target = $a_target;
941  }

◆ setFrameUpdater()

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

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

References $a_up_script.

254  : void {
255  $this->up_frame = $a_up_frame;
256  $this->up_script = $a_up_script;
257  $this->up_params = $a_params;
258  }
string $a_up_script

◆ setId()

ilExplorer::setId ( string  $a_val)

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

Referenced by ilPasteIntoMultipleItemsExplorer\__construct().

140  : void
141  {
142  $this->id = $a_val;
143  }
+ Here is the caller graph for this function:

◆ setOrderColumn()

ilExplorer::setOrderColumn ( string  $a_column)

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

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

196  : void
197  {
198  $this->order_column = $a_column;
199  }
+ Here is the caller graph for this function:

◆ setOrderDirection()

ilExplorer::setOrderDirection ( string  $a_direction)

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

201  : void
202  {
203  if ($a_direction === "desc") {
204  $this->order_direction = $a_direction;
205  } else {
206  $this->order_direction = "asc";
207  }
208  }

◆ setOutput()

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

Creates output for explorer view in admin menue recursive method.

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

References $counter, $error, $highlighted, $ilErr, checkFilter(), forceExpanded(), getChildsOfNode(), getIndex(), getRoot(), isVisible(), modifyChilds(), showChilds(), and sortNodes().

375  : void {
377 
378  $parent_index = 0;
379 
380  if (!isset($a_parent_id)) {
381  $ilErr->raiseError(get_class($this) . "::setOutput(): No node_id given!", $ilErr->WARNING);
382  }
383 
384  if ($this->showChilds($a_parent_id)) {
385  $objects = $this->getChildsOfNode($a_parent_id);
386  } else {
387  $objects = array();
388  }
389 
390  $objects = $this->modifyChilds($a_parent_id, $objects);
391 
392  // force expansion (of single nodes)
393  if ($this->forceExpanded($a_parent_id) && !in_array($a_parent_id, $this->expanded)) {
394  $this->expanded[] = $a_parent_id;
395  }
396 
397  if (count($objects) > 0) {
398  // Maybe call a lexical sort function for the child objects
399  $tab = ++$a_depth - 2;
400  if ($this->post_sort) {
401  $objects = $this->sortNodes($objects, $a_obj_id);
402  }
403  $skip_rest = false;
404  foreach ($objects as $key => $object) {
405  // skip childs, if parent is not expanded
406  if (!$this->forceExpanded($object["child"]) && $skip_rest) {
407  continue;
408  }
409  //echo "<br>-".$object["child"]."-".$this->forceExpanded($object["child"])."-";
410  //ask for FILTER
411  if ($this->filtered === false || $this->checkFilter($object["type"]) === false) {
412  if ($this->isVisible($object['child'], $object['type'])) {
413  #echo 'CHILD getIndex() '.$object['child'].' parent: '.$this->getRoot();
414  if ($object["child"] != $this->getRoot()) {
415  $parent_index = $this->getIndex($object);
416  }
417  $this->format_options[(string) $this->counter]["parent"] = $object["parent"];
418  $this->format_options[(string) $this->counter]["child"] = $object["child"];
419  $this->format_options[(string) $this->counter]["title"] = $object["title"];
420  $this->format_options[(string) $this->counter]["type"] = $object["type"];
421  $this->format_options[(string) $this->counter]["obj_id"] = $object["obj_id"];
422  $this->format_options[(string) $this->counter]["desc"] = "obj_" . $object["type"];
423  $this->format_options[(string) $this->counter]["depth"] = $tab;
424  $this->format_options[(string) $this->counter]["container"] = false;
425  $this->format_options[(string) $this->counter]["visible"] = true;
426  $this->format_options[(string) $this->counter]["highlighted_subtree"] = $a_highlighted_subtree;
427 
428  // Create prefix array
429  for ($i = 0; $i < $tab; ++$i) {
430  $this->format_options[(string) $this->counter]["tab"][] = 'blank';
431  }
432 
433  // fix explorer (sometimes explorer disappears)
434  if ($parent_index === 0) {
435  if (!$this->expand_all && !in_array($object["parent"], $this->expanded)) {
436  $this->expanded[] = $object["parent"];
437  }
438  }
439 
440  // only if parent is expanded and visible, object is visible
441  if ($object["child"] != $this->getRoot() && ((!$this->expand_all && !in_array($object["parent"], $this->expanded))
442  or !$this->format_options[(string) $parent_index]["visible"])) {
443  if (!$this->forceExpanded($object["child"])) {
444  // if parent is not expanded, and one child is
445  // visible we don't need more information and
446  // can skip the rest of the childs
447  if ($this->format_options[(string) $this->counter]["visible"]) {
448  //echo "-setSkipping";
449  $skip_rest = true;
450  }
451  $this->format_options[(string) $this->counter]["visible"] = false;
452  }
453  }
454 
455  // if object exists parent is container
456  if ($object["child"] != $this->getRoot()) {
457  $this->format_options[(string) $parent_index]["container"] = true;
458 
459  if ($this->expand_all || in_array($object["parent"], $this->expanded)) {
460  //echo "<br>-".$object["child"]."-".$this->forceExpanded($object["child"])."-";
461  if ($this->forceExpanded($object["parent"])) {
462  $this->format_options[(string) $parent_index]["tab"][($tab - 2)] = 'forceexp';
463  } else {
464  $this->format_options[(string) $parent_index]["tab"][($tab - 2)] = 'minus';
465  }
466  } else {
467  $this->format_options[(string) $parent_index]["tab"][($tab - 2)] = 'plus';
468  }
469  }
470  //echo "-"."$parent_index"."-";
471  //var_dump($this->format_options["$parent_index"]);
472  ++$this->counter;
473 
474  // stop recursion if 2. level beyond expanded nodes is reached
475  if ($this->expand_all || in_array($object["parent"], $this->expanded) or ($object["parent"] == 0)
476  or $this->forceExpanded($object["child"])) {
477  $highlighted_subtree = $a_highlighted_subtree ||
478  ($object["child"] == $this->highlighted);
479 
480  // recursive
481  $this->setOutput($object["child"], $a_depth, $object['obj_id'], $highlighted_subtree);
482  }
483  } //if
484  } //if FILTER
485  } //foreach
486  } //if
487  } //function
setOutput( $a_parent_id, int $a_depth=1, int $a_obj_id=0, bool $a_highlighted_subtree=false)
Creates output for explorer view in admin menue recursive method.
sortNodes(array $a_nodes, $a_parent_obj_id)
sort nodes and put adm object to the end of sorted array
checkFilter(string $a_item)
getChildsOfNode($a_parent_id)
$ilErr
Definition: raiseError.php:33
forceExpanded($a_obj_id)
force expansion of node
showChilds($a_parent_id)
determines wether the childs of an object should be shown or not note: this standard implementation a...
isVisible( $a_ref_id, string $a_type)
getIndex(array $a_data)
ilErrorHandling $error
string $highlighted
modifyChilds( $a_parent_id, array $a_objects)
+ Here is the call graph for this function:

◆ setParamsGet()

ilExplorer::setParamsGet ( array  $a_params_get)

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

References $error, and $ilErr.

Referenced by ilECSNodeMappingLocalExplorer\formatObject().

224  : void
225  {
227 
228  if (!isset($a_params_get) or !is_array($a_params_get)) {
229  $ilErr->raiseError(get_class($this) . "::setTargetGet(): No target given!", $ilErr->WARNING);
230  }
231  $str = "";
232  foreach ($a_params_get as $key => $val) {
233  $str .= "&" . $key . "=" . $val;
234  }
235 
236  $this->params_get = $str;
237  }
$ilErr
Definition: raiseError.php:33
ilErrorHandling $error
+ Here is the caller graph for this function:

◆ setPostSort()

ilExplorer::setPostSort ( bool  $a_sort)

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

328  : void
329  {
330  $this->post_sort = $a_sort;
331  }

◆ setRoot()

ilExplorer::setRoot (   $a_root_id)

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

Referenced by ilECSNodeMappingLocalExplorer\__construct().

185  : void
186  {
187  #$this->tree = new ilTree(ROOT_FOLDER_ID,$a_root_id);
188  $this->root_id = $a_root_id;
189  }
+ Here is the caller graph for this function:

◆ setSessionExpandVariable()

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

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

Referenced by ilContainerSelectionExplorer\__construct(), ilPasteIntoMultipleItemsExplorer\__construct(), ilSearchRootSelector\__construct(), and ilSolutionExplorer\__construct().

271  : void
272  {
273  $this->expand_variable = $a_var_name;
274  }
+ Here is the caller graph for this function:

◆ setTargetGet()

ilExplorer::setTargetGet ( string  $a_target_get)
Parameters
string$a_target_getvarname containing Ids to be used in GET-string

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

References $error, and $ilErr.

Referenced by ilSCORMPresentationGUI\explorer().

213  : void
214  {
216 
217  if (!isset($a_target_get) or !is_string($a_target_get)) {
218  $ilErr->raiseError(get_class($this) . "::setTargetGet(): No target given!", $ilErr->WARNING);
219  }
220 
221  $this->target_get = $a_target_get;
222  }
$ilErr
Definition: raiseError.php:33
ilErrorHandling $error
+ Here is the caller graph for this function:

◆ setTitle()

ilExplorer::setTitle ( string  $a_val)

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

165  : void
166  {
167  $this->title = $a_val;
168  }

◆ setTitleLength()

ilExplorer::setTitleLength ( int  $a_length)

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

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

170  : void
171  {
172  $this->textwidth = $a_length;
173  }
+ Here is the caller graph for this function:

◆ setTreeLead()

ilExplorer::setTreeLead ( string  $a_val)

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

306  : void
307  {
308  $this->tree_lead = $a_val;
309  }

◆ setUseStandardFrame()

ilExplorer::setUseStandardFrame ( bool  $a_val)

Set use standard frame.

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

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

350  : void
351  {
352  $this->use_standard_frame = $a_val;
353  }

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

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

501  : bool
502  {
503  return true;
504  }
+ Here is the caller graph for this function:

◆ sortNodes()

ilExplorer::sortNodes ( array  $a_nodes,
  $a_parent_obj_id 
)

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

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

References null, and ilArrayUtil\sortArray().

Referenced by setOutput().

1107  : array
1108  {
1109  $adm_node = null;
1110  foreach ($a_nodes as $key => $node) {
1111  if ($node["type"] === "adm") {
1112  $match = $key;
1113  $adm_node = $node;
1114  break;
1115  }
1116  }
1117 
1118  // cut off adm node
1119  if (isset($match)) {
1120  array_splice($a_nodes, $match, 1);
1121  }
1122 
1123  $a_nodes = ilArrayUtil::sortArray($a_nodes, $this->order_column, $this->order_direction);
1124 
1125  // append adm node to end of list
1126  if (isset($match)) {
1127  $a_nodes[] = $adm_node;
1128  }
1129 
1130  return $a_nodes;
1131  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $a_up_script

string ilExplorer::$a_up_script = ""
protected

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

Referenced by setFrameUpdater().

◆ $asnch_expanding

bool ilExplorer::$asnch_expanding = false
protected

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

Referenced by getAsynchExpanding().

◆ $counter

int ilExplorer::$counter = 0
protected

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

Referenced by setOutput().

◆ $error

ilErrorHandling ilExplorer::$error
protected

◆ $expand_all

bool ilExplorer::$expand_all = false

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

◆ $expand_target

string ilExplorer::$expand_target = null

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

◆ $expand_variable

string ilExplorer::$expand_variable = ""

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

◆ $expanded

array ilExplorer::$expanded = []

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

◆ $filter

ilExplorer::$filter = []
protected

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

◆ $filter_mode

bool ilExplorer::$filter_mode

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

Referenced by getFilterMode().

◆ $filtered

bool ilExplorer::$filtered = false

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

◆ $format_options

array ilExplorer::$format_options = []

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

◆ $frame_target

◆ $highlighted

string ilExplorer::$highlighted = ""
protected

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

Referenced by setOutput().

◆ $iconList

array ilExplorer::$iconList = []
protected

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

◆ $id

string ilExplorer::$id = ""

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

Referenced by getId(), and ilSearchRootSelector\setPathOpen().

◆ $is_clickable

array ilExplorer::$is_clickable = []

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

◆ $lng

◆ $obj_definition

ilObjectDefinition ilExplorer::$obj_definition
protected

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

Referenced by ilRepositoryExplorer\sortNodes().

◆ $order_column

string ilExplorer::$order_column = ""

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

◆ $order_direction

string ilExplorer::$order_direction = "asc"

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

◆ $output

string ilExplorer::$output = ""

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

◆ $output_icons

bool ilExplorer::$output_icons = false

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

◆ $params_get

string ilExplorer::$params_get = ""

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

Referenced by buildLinkTarget().

◆ $post_sort

bool ilExplorer::$post_sort = false

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

◆ $rbac_check

bool ilExplorer::$rbac_check = false

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

◆ $rbacsystem

◆ $refinery

ILIAS Refinery Factory ilExplorer::$refinery
protected

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

◆ $root_id

ilExplorer::$root_id = null

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

◆ $show_minus

bool ilExplorer::$show_minus = true
protected

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

◆ $target

◆ $target_get

string ilExplorer::$target_get = ""

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

◆ $textwidth

int ilExplorer::$textwidth = 0
protected

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

Referenced by getTitleLength().

◆ $title

◆ $tpl

◆ $tree

◆ $tree_lead

string ilExplorer::$tree_lead = ""
protected

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

Referenced by getTreeLead().

◆ $up_frame

string ilExplorer::$up_frame = ""
protected

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

◆ $up_params

string ilExplorer::$up_params = ""
protected

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

◆ $up_script

string ilExplorer::$up_script = ""
protected

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

◆ $use_standard_frame

bool ilExplorer::$use_standard_frame = false

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

Referenced by getUseStandardFrame().

◆ $wrapper

ILIAS HTTP Wrapper WrapperFactory ilExplorer::$wrapper
protected

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


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