ILIAS  release_8 Revision v8.23
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:

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

Member Function Documentation

◆ addFilter()

ilExplorer::addFilter ( string  $a_item)

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

References ILIAS\UI\examples\Symbol\Glyph\Filter\filter().

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

999  : bool
1000  {
1001  if (is_array($this->filter)) {
1002  //run through filter
1003  foreach ($this->filter as $item) {
1004  if ($item === $a_item) {
1005  return false;
1006  }
1007  }
1008  } else {
1009  $this->filter = array();
1010  }
1011  $this->filter[] = $a_item;
1012 
1013  return true;
1014  }
+ 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 876 of file class.ilExplorer.php.

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

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

◆ buildFrameTarget()

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

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

References $frame_target.

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

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

◆ buildLinkTarget()

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

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

References $params_get.

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

853  : string {
854  $target = (strpos($this->target, "?") === false)
855  ? $this->target . "?"
856  : $this->target . "&";
857  return $target . $this->target_get . "=" . $a_node_id . $this->params_get;
858  }
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 860 of file class.ilExplorer.php.

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

864  : string {
865  return "";
866  }
+ 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 887 of file class.ilExplorer.php.

Referenced by formatObject().

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

◆ buildTitle()

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

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

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

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

◆ checkFilter()

ilExplorer::checkFilter ( string  $a_item)

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

References ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), getFilterMode(), and IL_FM_NEGATIVE.

Referenced by setOutput().

1084  : bool
1085  {
1086  if (is_array($this->filter)) {
1087  if (in_array($a_item, $this->filter)) {
1088  $ret = true;
1089  } else {
1090  $ret = false;
1091  }
1092  } else {
1093  $ret = false;
1094  }
1095 
1096  if ($this->getFilterMode() === IL_FM_NEGATIVE) {
1097  return $ret;
1098  } else {
1099  return !$ret;
1100  }
1101  }
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 265 of file class.ilExplorer.php.

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

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

◆ createLines()

ilExplorer::createLines ( int  $a_depth)

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

References $i, and is_in_array().

Referenced by getOutput().

942  : void
943  {
944  for ($i = 0, $iMax = count($this->format_options); $i < $iMax; ++$i) {
945  if ($this->format_options[$i]["depth"] == $a_depth + 1
946  and !$this->format_options[$i]["container"]
947  and $this->format_options[$i]["depth"] != 1) {
948  $this->format_options[$i]["tab"][(string) $a_depth] = "quer";
949  }
950 
951  if ($this->format_options[$i]["depth"] == $a_depth + 2) {
952  if ($this->is_in_array($i + 1, $this->format_options[$i]["depth"])) {
953  $this->format_options[$i]["tab"][(string) $a_depth] = "winkel";
954  } else {
955  $this->format_options[$i]["tab"][(string) $a_depth] = "ecke";
956  }
957  }
958 
959  if ($this->format_options[$i]["depth"] > $a_depth + 2) {
960  if ($this->is_in_array($i + 1, $a_depth + 2)) {
961  $this->format_options[$i]["tab"][(string) $a_depth] = "hoch";
962  }
963  }
964  }
965  }
is_in_array(int $a_start, int $a_depth)
$i
Definition: metadata.php:41
+ 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 901 of file class.ilExplorer.php.

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

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

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

References ILIAS\UI\examples\Symbol\Glyph\Filter\filter().

1016  : bool
1017  {
1018  $deleted = 0;
1019  //check if a filter exists
1020  if (is_array($this->filter)) {
1021  //build copy of the existing filter without the given item
1022  $tmp = array();
1023 
1024  foreach ($this->filter as $item) {
1025  if ($item !== $a_item) {
1026  $tmp[] = $item;
1027  } else {
1028  $deleted = 1;
1029  }
1030  }
1031 
1032  $this->filter = $tmp;
1033  } else {
1034  return false;
1035  }
1036 
1037  return $deleted === 1;
1038  }
+ 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 1070 of file class.ilExplorer.php.

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

◆ forceExpanded()

ilExplorer::forceExpanded (   $a_obj_id)

force expansion of node

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

Referenced by setOutput().

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

◆ formatHeader()

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

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

Referenced by getOutput().

670  : void {
671  }
+ 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 673 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().

678  : void {
679  $lng = $this->lng;
681 
682  if (!isset($a_node_id) or !is_array($a_option)) {
683  $ilErr->raiseError(get_class($this) . "::formatObject(): Missing parameter or wrong datatype! " .
684  "node_id: " . $a_node_id . " options:" . var_export($a_option, true), $ilErr->WARNING);
685  }
686 
687  $pic = false;
688  foreach ((array) $a_option["tab"] as $picture) {
689  if ($picture === 'plus') {
690  $tpl->setCurrentBlock("expander");
691  $tpl->setVariable("EXP_DESC", $lng->txt("collapsed"));
692  $tpl->setVariable("LINK_NAME", $a_node_id);
693  if (!$this->getAsynchExpanding()) {
694  $target = $this->createTarget('+', $a_node_id, $a_option["highlighted_subtree"]);
695  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
696  } else {
697  $target = $this->createTarget('+', $a_node_id, $a_option["highlighted_subtree"], false);
698  $tpl->setVariable("ONCLICK_TARGET_EXPANDER", " onclick=\"return il.Explorer.refresh('tree_div', '" . $target . "');\"");
699  $tpl->setVariable("LINK_TARGET_EXPANDER", "#");
700  }
701  $tpl->setVariable("IMGPATH", $this->getImage("browser/plus.png"));
702  $tpl->parseCurrentBlock();
703  $pic = true;
704  }
705 
706  if ($picture === 'forceexp') {
707  $tpl->setCurrentBlock("expander");
708  $tpl->setVariable("EXP_DESC", $lng->txt("expanded"));
709  $target = $this->createTarget('+', $a_node_id);
710  $tpl->setVariable("LINK_NAME", $a_node_id);
711  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
712  $tpl->setVariable("IMGPATH", $this->getImage("browser/forceexp.png"));
713  $tpl->parseCurrentBlock();
714  $pic = true;
715  }
716 
717  if ($picture === 'minus' && $this->show_minus) {
718  $tpl->setCurrentBlock("expander");
719  $tpl->setVariable("EXP_DESC", $lng->txt("expanded"));
720  $tpl->setVariable("LINK_NAME", $a_node_id);
721  if (!$this->getAsynchExpanding()) {
722  $target = $this->createTarget('-', $a_node_id, $a_option["highlighted_subtree"]);
723  $tpl->setVariable("LINK_TARGET_EXPANDER", $target);
724  } else {
725  $target = $this->createTarget('-', $a_node_id, $a_option["highlighted_subtree"], false);
726  $tpl->setVariable("ONCLICK_TARGET_EXPANDER", " onclick=\"return il.Explorer.refresh('tree_div', '" . $target . "');\"");
727  $tpl->setVariable("LINK_TARGET_EXPANDER", "#");
728  }
729  $tpl->setVariable("IMGPATH", $this->getImage("browser/minus.png"));
730  $tpl->parseCurrentBlock();
731  $pic = true;
732  }
733  }
734 
735  if (!$pic) {
736  $tpl->setCurrentBlock("blank");
737  $tpl->setVariable("BLANK_PATH", $this->getImage("browser/blank.png"));
738  $tpl->parseCurrentBlock();
739  }
740 
741  if ($this->output_icons) {
742  $tpl->setCurrentBlock("icon");
743  $tpl->setVariable("ICON_IMAGE", $this->getImage("icon_" . $a_option["type"] . ".svg", $a_option["type"], $a_obj_id));
744 
745  $tpl->setVariable("TARGET_ID", "iconid_" . $a_node_id);
746  $this->iconList[] = "iconid_" . $a_node_id;
747  $tpl->setVariable(
748  "TXT_ALT_IMG",
749  $this->getImageAlt($lng->txt("icon") . " " . $lng->txt($a_option["desc"]), $a_option["type"], $a_obj_id)
750  );
751  $tpl->parseCurrentBlock();
752  }
753 
754  if (($sel = $this->buildSelect($a_node_id, $a_option['type'])) !== '') {
755  $tpl->setCurrentBlock('select');
756  $tpl->setVariable('OBJ_SEL', $sel);
757  $tpl->parseCurrentBlock();
758  }
759 
760  if ($this->isClickable($a_option["type"], $a_node_id)) { // output link
761  $tpl->setCurrentBlock("link");
762  //$target = (strpos($this->target, "?") === false) ?
763  // $this->target."?" : $this->target."&";
764  //$tpl->setVariable("LINK_TARGET", $target.$this->target_get."=".$a_node_id.$this->params_get);
765  $tpl->setVariable("LINK_TARGET", $this->buildLinkTarget($a_node_id, $a_option["type"]));
766 
767  $style_class = $this->getNodeStyleClass($a_node_id, $a_option["type"]);
768 
769  if ($style_class !== "") {
770  $tpl->setVariable("A_CLASS", ' class="' . $style_class . '" ');
771  }
772 
773  if (($onclick = $this->buildOnClick($a_node_id, $a_option["type"], $a_option["title"])) != "") {
774  $tpl->setVariable("ONCLICK", "onClick=\"$onclick\"");
775  }
776 
777  //$tpl->setVariable("LINK_NAME", $a_node_id);
778  $tpl->setVariable(
779  "TITLE",
781  $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
782  $this->textwidth,
783  true
784  )
785  );
786  $tpl->setVariable(
787  "DESC",
789  $this->buildDescription($a_option["description"] ?? "", $a_node_id, $a_option["type"]),
790  $this->textwidth,
791  true
792  )
793  );
794  $frame_target = $this->buildFrameTarget($a_option["type"], $a_node_id, $a_option["obj_id"]);
795  if ($frame_target !== "") {
796  $tpl->setVariable("TARGET", " target=\"" . $frame_target . "\"");
797  }
798  } else { // output text only
799  $tpl->setCurrentBlock("text");
800  $tpl->setVariable(
801  "OBJ_TITLE",
803  $this->buildTitle($a_option["title"], $a_node_id, $a_option["type"]),
804  $this->textwidth,
805  true
806  )
807  );
808  $tpl->setVariable(
809  "OBJ_DESC",
811  $this->buildDescription($a_option["desc"], $a_node_id, $a_option["type"]),
812  $this->textwidth,
813  true
814  )
815  );
816  }
817  $tpl->parseCurrentBlock();
818 
819  $tpl->setCurrentBlock("list_item");
820  $tpl->parseCurrentBlock();
821  $tpl->touchBlock("element");
822  }
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:17
getImageAlt(string $a_default_text, string $a_type="", $a_obj_id="")
touchBlock(string $block)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
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 154 of file class.ilExplorer.php.

References $asnch_expanding.

Referenced by createTarget(), and formatObject().

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

◆ getChildsOfNode()

ilExplorer::getChildsOfNode (   $a_parent_id)

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

Referenced by setOutput().

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

◆ getFilterMode()

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

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

References $filter_mode.

Referenced by checkFilter().

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

◆ getId()

ilExplorer::getId ( )

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

References $id.

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

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

◆ getImage()

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

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

References ilUtil\getImagePath().

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

828  : string {
829  return ilUtil::getImagePath($a_name);
830  }
static getImagePath(string $img, 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 832 of file class.ilExplorer.php.

Referenced by formatObject().

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

◆ getIndex()

ilExplorer::getIndex ( array  $a_data)

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

References ILIAS\LTI\ToolProvider\$key.

Referenced by setOutput().

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

◆ getMaximumTreeDepth()

ilExplorer::getMaximumTreeDepth ( )

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

Referenced by getOutput().

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

◆ getNodeStyleClass()

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

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

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

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

◆ getOutput()

ilExplorer::getOutput ( )

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

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

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

◆ getRoot()

ilExplorer::getRoot ( )

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

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

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

◆ getTitle()

ilExplorer::getTitle ( )

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

References $title.

Referenced by getOutput().

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

◆ getTitleLength()

ilExplorer::getTitleLength ( )

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

References $textwidth.

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

◆ getTreeLead()

ilExplorer::getTreeLead ( )

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

References $tree_lead.

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

◆ getUseStandardFrame()

ilExplorer::getUseStandardFrame ( )

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

References $use_standard_frame.

Referenced by getOutput().

354  : bool
355  {
357  }
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 623 of file class.ilExplorer.php.

References $i, and ilTemplate\touchBlock().

Referenced by getOutput().

627  : void {
628  if ($a_item_depth < $a_cur_depth) {
629  // </li></ul> for ending lists
630  for ($i = 0; $i < ($a_cur_depth - $a_item_depth); $i++) {
631  $a_tpl_tree->touchBlock("end_list_item");
632  $a_tpl_tree->touchBlock("element");
633 
634  $a_tpl_tree->touchBlock("end_list");
635  $a_tpl_tree->touchBlock("element");
636  }
637  } elseif ($a_item_depth == $a_cur_depth) {
638  // </li> for ending list items
639  $a_tpl_tree->touchBlock("end_list_item");
640  $a_tpl_tree->touchBlock("element");
641  }
642  }
touchBlock(string $block)
$i
Definition: metadata.php:41
+ 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 647 of file class.ilExplorer.php.

References ilTemplate\touchBlock().

Referenced by getOutput().

651  : void {
652  // start tags
653  if ($a_item_depth > $a_cur_depth) {
654  // <ul><li> for new lists
655  if ($a_item_depth > 1) {
656  $a_tpl_tree->touchBlock("start_list");
657  } else {
658  $a_tpl_tree->touchBlock("start_list_no_indent");
659  }
660  $a_tpl_tree->touchBlock("element");
661  }
662  $a_tpl_tree->touchBlock("start_list_item");
663  $a_tpl_tree->touchBlock("element");
664  }
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 260 of file class.ilExplorer.php.

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

◆ initItemCounter()

ilExplorer::initItemCounter ( int  $a_number)

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

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

◆ is_in_array()

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

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

References $i.

Referenced by createLines().

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

◆ isClickable()

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

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

References $type.

Referenced by formatObject().

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

◆ isVisible()

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

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

References $rbacsystem, and ilRbacSystem\checkAccess().

Referenced by setOutput().

292  : bool {
294 
295  if (!$this->rbac_check) {
296  return true;
297  }
298 
299  $visible = $rbacsystem->checkAccess('visible', $a_ref_id);
300 
301  return $visible;
302  }
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 488 of file class.ilExplorer.php.

Referenced by setOutput().

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

◆ outputIcons()

ilExplorer::outputIcons ( bool  $a_icons)

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

Referenced by ilSCORMExplorer\__construct().

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

◆ requestStr()

ilExplorer::requestStr ( string  $key)
protected

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

References ILIAS\Repository\refinery().

Referenced by getOutput().

127  : string
128  {
129  $str = $this->refinery->kindlyTo()->string();
130  if ($this->wrapper->post()->has($key)) {
131  return $this->wrapper->post()->retrieve($key, $str);
132  }
133  if ($this->wrapper->query()->has($key)) {
134  return $this->wrapper->query()->retrieve($key, $str);
135  }
136  return "";
137  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ 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 149 of file class.ilExplorer.php.

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

◆ setClickable()

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

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

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

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

References ILIAS\LTI\ToolProvider\$key, ilSession\get(), getRoot(), and ilSession\set().

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

1044  : void
1045  {
1046  // IF ISN'T SET CREATE SESSION VARIABLE
1047  if (!is_array(ilSession::get($this->expand_variable))) {
1048  ilSession::set($this->expand_variable, [$this->getRoot()]);
1049  }
1050  if ($a_node_id > 0 && !in_array($a_node_id, ilSession::get($this->expand_variable))) {
1051  $exp = ilSession::get($this->expand_variable);
1052  $exp[] = $a_node_id;
1053  ilSession::set($this->expand_variable, $exp);
1054  }
1055  if ($a_node_id < 0) {
1056  $key = array_keys(ilSession::get($this->expand_variable), -(int) $a_node_id);
1057  $exp = ilSession::get($this->expand_variable);
1058  if (isset($key[0]) && isset($exp[$key[0]])) {
1059  unset($exp[$key[0]]);
1060  }
1061  ilSession::set($this->expand_variable, $exp);
1062  }
1063  $this->expanded = (array) ilSession::get($this->expand_variable);
1064  }
static get(string $a_var)
string $key
Consumer key/client ID value.
Definition: System.php:193
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 244 of file class.ilExplorer.php.

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

◆ setFiltered()

ilExplorer::setFiltered ( bool  $a_bool)

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

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

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

◆ setFilterMode()

ilExplorer::setFilterMode ( int  $a_mode = IL_FM_NEGATIVE)

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

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

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

◆ setFrameTarget()

ilExplorer::setFrameTarget ( string  $a_target)

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

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

◆ setFrameUpdater()

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

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

References $a_up_script.

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

◆ setId()

ilExplorer::setId ( string  $a_val)

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

Referenced by ilPasteIntoMultipleItemsExplorer\__construct(), and ilObjStudyProgrammeTreeGUI\getContainerSelectionExplorer().

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

◆ setOrderColumn()

ilExplorer::setOrderColumn ( string  $a_column)

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

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

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

◆ setOrderDirection()

ilExplorer::setOrderDirection ( string  $a_direction)

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

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

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

References $counter, $error, $highlighted, $i, $ilErr, ILIAS\LTI\ToolProvider\$key, checkFilter(), forceExpanded(), getChildsOfNode(), getIndex(), getRoot(), isVisible(), modifyChilds(), showChilds(), and sortNodes().

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

References $error, $ilErr, and ILIAS\LTI\ToolProvider\$key.

Referenced by ilECSNodeMappingLocalExplorer\formatObject().

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

◆ setPostSort()

ilExplorer::setPostSort ( bool  $a_sort)

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

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

◆ setRoot()

ilExplorer::setRoot (   $a_root_id)

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

Referenced by ilECSNodeMappingLocalExplorer\__construct().

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

◆ setSessionExpandVariable()

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

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

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

270  : void
271  {
272  $this->expand_variable = $a_var_name;
273  }
+ 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 212 of file class.ilExplorer.php.

References $error, and $ilErr.

Referenced by ilSCORMPresentationGUI\explorer().

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

◆ setTitle()

ilExplorer::setTitle ( string  $a_val)

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

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

◆ setTitleLength()

ilExplorer::setTitleLength ( int  $a_length)

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

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

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

◆ setTreeLead()

ilExplorer::setTreeLead ( string  $a_val)

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

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

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

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

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

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

500  : bool
501  {
502  return true;
503  }
+ 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 1106 of file class.ilExplorer.php.

References ILIAS\LTI\ToolProvider\$key, and ilArrayUtil\sortArray().

Referenced by setOutput().

1106  : array
1107  {
1108  $adm_node = null;
1109  foreach ($a_nodes as $key => $node) {
1110  if ($node["type"] === "adm") {
1111  $match = $key;
1112  $adm_node = $node;
1113  break;
1114  }
1115  }
1116 
1117  // cut off adm node
1118  if (isset($match)) {
1119  array_splice($a_nodes, $match, 1);
1120  }
1121 
1122  $a_nodes = ilArrayUtil::sortArray($a_nodes, $this->order_column, $this->order_direction);
1123 
1124  // append adm node to end of list
1125  if (isset($match)) {
1126  $a_nodes[] = $adm_node;
1127  }
1128 
1129  return $a_nodes;
1130  }
string $key
Consumer key/client ID value.
Definition: System.php:193
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 66 of file class.ilExplorer.php.

Referenced by setFrameUpdater().

◆ $asnch_expanding

bool ilExplorer::$asnch_expanding = false
protected

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

Referenced by getAsynchExpanding().

◆ $counter

int ilExplorer::$counter = 0
protected

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

Referenced by setOutput().

◆ $error

ilErrorHandling ilExplorer::$error
protected

◆ $expand_all

bool ilExplorer::$expand_all = false

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

◆ $expand_target

string ilExplorer::$expand_target = null

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

◆ $expand_variable

string ilExplorer::$expand_variable = ""

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

◆ $expanded

array ilExplorer::$expanded = []

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

◆ $filter

ilExplorer::$filter = []
protected

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

◆ $filter_mode

bool ilExplorer::$filter_mode

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

Referenced by getFilterMode().

◆ $filtered

bool ilExplorer::$filtered = false

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

◆ $format_options

array ilExplorer::$format_options = []

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

◆ $frame_target

◆ $highlighted

string ilExplorer::$highlighted = ""
protected

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

Referenced by setOutput().

◆ $iconList

array ilExplorer::$iconList = []
protected

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

◆ $id

string ilExplorer::$id = ""

◆ $is_clickable

array ilExplorer::$is_clickable = []

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

◆ $lng

◆ $obj_definition

ilObjectDefinition ilExplorer::$obj_definition
protected

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

Referenced by ilRepositoryExplorer\sortNodes().

◆ $order_column

string ilExplorer::$order_column = ""

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

◆ $order_direction

string ilExplorer::$order_direction = "asc"

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

◆ $output

string ilExplorer::$output = ""

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

◆ $output_icons

bool ilExplorer::$output_icons = false

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

◆ $params_get

string ilExplorer::$params_get = ""

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

Referenced by buildLinkTarget().

◆ $post_sort

bool ilExplorer::$post_sort = false

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

◆ $rbac_check

bool ilExplorer::$rbac_check = false

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

◆ $rbacsystem

◆ $refinery

ILIAS Refinery Factory ilExplorer::$refinery
protected

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

Referenced by ilAsyncContainerSelectionExplorer\__construct().

◆ $root_id

ilExplorer::$root_id = null

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

◆ $show_minus

bool ilExplorer::$show_minus = true
protected

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

◆ $target

◆ $target_get

string ilExplorer::$target_get = ""

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

◆ $textwidth

int ilExplorer::$textwidth = 0
protected

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

Referenced by getTitleLength().

◆ $title

◆ $tpl

◆ $tree

◆ $tree_lead

string ilExplorer::$tree_lead = ""
protected

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

Referenced by getTreeLead().

◆ $up_frame

string ilExplorer::$up_frame = ""
protected

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

◆ $up_params

string ilExplorer::$up_params = ""
protected

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

◆ $up_script

string ilExplorer::$up_script = ""
protected

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

◆ $use_standard_frame

bool ilExplorer::$use_standard_frame = false

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

Referenced by getUseStandardFrame().

◆ $wrapper

ILIAS HTTP Wrapper WrapperFactory ilExplorer::$wrapper
protected

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


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