ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilIntLinkRepItemExplorerGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilIntLinkRepItemExplorerGUI:
+ Collaboration diagram for ilIntLinkRepItemExplorerGUI:

Public Member Functions

 __construct ( $a_parent_obj, string $a_parent_cmd)
 
 setSetLinkTargetScript (string $a_script)
 Set "set link target" script. More...
 
 getSetLinkTargetScript ()
 Get "set link target" script. More...
 
 getNodeHref ($a_node)
 
 getNodeOnClick ($a_node)
 get onclick event handling More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 isNodeVisible ($a_node)
 Is node visible? More...
 
 getNodeIcon ($a_node)
 Get node icon path. More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
- Public Member Functions inherited from ilRepositorySelectorExplorerGUI
 setNodeContentModifier (Closure $a_val)
 
 getNodeContentModifier ()
 
 getNodeContent ($a_node)
 Get content of a node. More...
 
 getNodeIcon ($a_node)
 Get node icon path. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 isNodeVisible ($a_node)
 Is node visible? More...
 
 sortChilds (array $a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 setClickablePermission (string $rbac_perm)
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 setHighlightedNode (string $a_value)
 
 getHighlightedNode ()
 
 setClickableTypes (array $a_types)
 
 getClickableTypes ()
 
 setSelectableTypes (array $a_types)
 
 getSelectableTypes ()
 
 getHTML ($new=false)
 Get HTML. More...
 
- Public Member Functions inherited from ilTreeExplorerGUI
 __construct (string $a_expl_id, $a_parent_obj, string $a_parent_cmd, ilTree $a_tree, string $a_node_parameter_name="node_id")
 
 getTree ()
 
 setOrderField (string $a_val, bool $a_numeric=false)
 
 getOrderField ()
 
 setTypeWhiteList (array $a_val)
 Set type white list. More...
 
 getTypeWhiteList ()
 Get type white list. More...
 
 setTypeBlackList (array $a_val)
 Set type black list. More...
 
 getTypeBlackList ()
 Get type black list. More...
 
 setPreloadChilds (bool $a_val)
 
 getPreloadChilds ()
 
 getSuccessorNode ( $a_node_id, string $a_type="")
 Get successor node (currently only(!) based on lft/rgt tree values) More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 getNodeId ($a_node)
 Get id for node. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getRootNode ()
 Get root node. More...
 
 setRootId ($a_root)
 
 setPathOpen ($a_id)
 Set node path to be opened. More...
 
 getHTML ($new=false)
 Get HTML. More...
 
 getChildren ($record, $environment=null)
 Get a list of records (that list can also be empty). More...
 
 build (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record, $environment=null)
 
 getTreeLabel ()
 
 getTreeComponent ()
 
 toggleExplorerNodeState ()
 Should be called by an ilCtrl-enabled command class if a tree node toggle action should be processed. More...
 
- Public Member Functions inherited from ilExplorerBaseGUI
 setChildLimit (int $a_val)
 
 getChildLimit ()
 
 setSearchTerm (string $a_val)
 
 getSearchTerm ()
 
 setMainTemplate (?ilGlobalTemplateInterface $a_main_tpl=null)
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get children of node. More...
 
 getNodeContent ($a_node)
 Get content of a node. More...
 
 getNodeId ($a_node)
 Get id of a node. More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 nodeHasVisibleChilds ($a_node)
 Node has children Please note that this standard method may not be optimal depending on what a derived class does in isNodeVisible. More...
 
 sortChilds (array $a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getNodeIcon ($a_node)
 Get node icon path. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt attribute. More...
 
 getNodeTarget ($a_node)
 Get node target (frame) attribute. More...
 
 getNodeOnClick ($a_node)
 Get node onclick attribute. More...
 
 isNodeVisible ($a_node)
 Is node visible? More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 getId ()
 Get id of explorer element. More...
 
 setSkipRootNode (bool $a_val)
 
 getSkipRootNode ()
 
 setAjax (bool $a_val)
 
 getAjax ()
 
 setSecondaryHighlightedNodes (array $a_val)
 Set secondary (background) highlighted nodes. More...
 
 getSecondaryHighlightedNodes ()
 Get secondary (background) highlighted nodes. More...
 
 setNodeOpen ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setSelectMode (string $a_postvar, bool $a_multi=false)
 Set select mode (to deactivate, pass an empty string as postvar) More...
 
 setNodeSelected ($a_id)
 Set node to be opened (additional custom opened node, not standard expand behaviour) More...
 
 setOfflineMode (bool $a_val)
 
 getOfflineMode ()
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 
 renderNode ($a_node, ilTemplate $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, ilTemplate $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId (string $a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart (ilTemplate $tpl, $a_node)
 List item start. More...
 
 listItemEnd (ilTemplate $tpl)
 
 listStart (ilTemplate $tpl)
 
 listEnd (ilTemplate $tpl)
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled (bool $nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd (bool $enable_dnd)
 
- Public Member Functions inherited from ILIAS\UI\Component\Tree\TreeRecursion
 getChildren ( $record, $environment=null)
 Get a list of records (that list can also be empty). More...
 
 build (Node\Factory $factory, $record, $environment=null)
 Build and return a Node. More...
 

Protected Member Functions

 getRefIdFromNodeId (string $node_id)
 
 getAnchorFromNodeId (string $node_id)
 
- Protected Member Functions inherited from ilRepositorySelectorExplorerGUI
 getContextHighlightNode ()
 
 isNodeIncludedInTree (array $node)
 
 isNodeSelectable ($a_node)
 Is node selectable? More...
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 
 matches ($node)
 Does a node match a search term (or is search term empty) More...
 
 getRootId ()
 
 createNode (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record)
 Creates at tree node, can be overwritten in derivatives if another node type should be used. More...
 
 getNodeStateToggleCmdClasses ($record)
 Should return an array of ilCtrl-enabled command classes which should be used to build the URL for the expand/collapse actions applied on a tree node. More...
 
 render ()
 
- Protected Member Functions inherited from ilExplorerBaseGUI
 isNodeSelectable ($a_node)
 Is node selectable? More...
 
 getNodeToggleOnClick ($a_node)
 Get onclick attribute for node toggling. More...
 
 getSelectOnClick ($a_node)
 Get onclick attribute for selecting radio/checkbox. More...
 
 isNodeOpen ($node_id)
 Get all open nodes. More...
 
 getJSTreePlugins ()
 
 isNodeRequested (string $a_node_id)
 

Protected Attributes

string $link_target_script
 
- Protected Attributes inherited from ilRepositorySelectorExplorerGUI
ilObjectDefinition $obj_definition
 
array $type_grps = []
 
array $session_materials = []
 
string $highlighted_node = ""
 
int $context_highlight_node = null
 
bool $context_highlight_node_determined = false
 
array $clickable_types = []
 
array $selectable_types = []
 
ilAccessHandler $access
 
Closure $nc_modifier = null
 
string $selection_gui = null
 
string $selection_par
 
string $selection_cmd
 
StandardGUIRequest $request
 
int $cur_ref_id
 
- Protected Attributes inherited from ilTreeExplorerGUI
ilLanguage $lng
 
Psr Http Message ServerRequestInterface $httpRequest
 
ilTree $tree = null
 
string $tree_label = ""
 
string $order_field = ""
 
bool $order_field_numeric = false
 
array $type_white_list = array()
 
array $type_black_list = array()
 
array $childs = array()
 
bool $preloaded = false
 
bool $preload_childs = false
 
array $root_node_data = null
 
array $all_childs = array()
 
 $root_id = 0
 
ILIAS DI UIServices $ui
 
- Protected Attributes inherited from ilExplorerBaseGUI
string $node_parameter_name
 
ilLogger $log
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
bool $skip_root_node = false
 
bool $ajax = false
 
array $custom_open_nodes = array()
 
array $selected_nodes = array()
 
string $select_postvar = ""
 
bool $offline_mode = false
 
array $sec_highl_nodes = array()
 
bool $enable_dnd = false
 
string $search_term = ""
 
array $open_nodes = []
 
ilSessionIStorage $store
 
bool $select_multi = false
 
 $parent_obj
 
int $child_limit = 0
 
string $parent_cmd = ''
 
string $requested_exp_cmd = ""
 
string $requested_exp_cont = ""
 
string $requested_searchterm = ""
 
string $requested_node_id = ""
 
string $id
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 
static getLocalJsTreeJsPath ()
 
static getLocalJsTreeCssPath ()
 
static createHTMLExportDirs (string $a_target_dir)
 
static init (?ilGlobalTemplateInterface $a_main_tpl=null)
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static string $js_tree_path = "./node_modules/jstree/dist/jstree.js"
 
static string $js_tree_path_css = "./node_modules/jstree/dist/themes/default/style.min.css"
 
static string $js_expl_path = "assets/js/Explorer2.js"
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 19 of file class.ilIntLinkRepItemExplorerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilIntLinkRepItemExplorerGUI::__construct (   $a_parent_obj,
string  $a_parent_cmd 
)
Parameters
object | array$a_parent_objparent gui class or class array

Definition at line 26 of file class.ilIntLinkRepItemExplorerGUI.php.

29 {
30 parent::__construct($a_parent_obj, $a_parent_cmd, null, "", "");
31
32 // #14587 - ilRepositorySelectorExplorerGUI::__construct() does NOT include side blocks!
33 $list = $this->getTypeWhiteList();
34 $list[] = "poll";
35 $this->setTypeWhiteList($list);
36 }
getTypeWhiteList()
Get type white list.
setTypeWhiteList(array $a_val)
Set type white list.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), ilTreeExplorerGUI\getTypeWhiteList(), and ilTreeExplorerGUI\setTypeWhiteList().

+ Here is the call graph for this function:

Member Function Documentation

◆ getAnchorFromNodeId()

ilIntLinkRepItemExplorerGUI::getAnchorFromNodeId ( string  $node_id)
protected

Definition at line 119 of file class.ilIntLinkRepItemExplorerGUI.php.

119 : string
120 {
121 $e = explode("#", $node_id);
122 return $e[1] ?? "";
123 }

References Vendor\Package\$e.

Referenced by getNodeOnClick().

+ Here is the caller graph for this function:

◆ getChildsOfNode()

ilIntLinkRepItemExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node.

Parameters
int | string$a_parent_node_idparent id
Returns
array childs

Reimplemented from ilRepositorySelectorExplorerGUI.

Definition at line 91 of file class.ilIntLinkRepItemExplorerGUI.php.

91 : array
92 {
93 if (str_contains($a_parent_node_id, "#")) {
94 return [];
95 }
96 $ref_id = $this->getRefIdFromNodeId($a_parent_node_id);
97 $node = $this->tree->getNodeData($ref_id);
98 $childs = [];
99 if (!str_contains($a_parent_node_id, "#") && in_array($node["type"], ["crs", "cat", "grp", "fold"])) {
100 $obj_id = ilObject::_lookupObjId($ref_id);
101 foreach (ilPCParagraph::_readAnchors("cont", $obj_id, "") as $anchor) {
102 $anchor_node = $node;
103 $anchor_node["child"] = $ref_id . "#" . $anchor;
104 $anchor_node["title"] = "#" . $anchor;
105 $childs[] = $anchor_node;
106 }
107 }
108 $parent_childs = parent::getChildsOfNode($ref_id);
109 $childs = array_merge($childs, $parent_childs);
110 return $childs;
111 }
static _lookupObjId(int $ref_id)
static _readAnchors(string $a_parent_type, int $a_page_id, string $a_page_lang="-")
Read anchors of a page.

References ilTreeExplorerGUI\$childs, ilObject\_lookupObjId(), ilPCParagraph\_readAnchors(), and getRefIdFromNodeId().

+ Here is the call graph for this function:

◆ getNodeHref()

ilIntLinkRepItemExplorerGUI::getNodeHref (   $a_node)
Parameters
array | object$a_node

Reimplemented from ilRepositorySelectorExplorerGUI.

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

57 : string
58 {
59 if ($this->getSetLinkTargetScript() === "") {
60 return "#";
61 }
62
65 "linktype=RepositoryItem&linktarget=il__" . $a_node["type"] . "_" . $a_node["child"]
66 );
67
68 return $link;
69 }
getSetLinkTargetScript()
Get "set link target" script.
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)

References ilUtil\appendUrlParameterString(), and getSetLinkTargetScript().

+ Here is the call graph for this function:

◆ getNodeIcon()

ilIntLinkRepItemExplorerGUI::getNodeIcon (   $a_node)

Get node icon path.

Parameters
object | array$a_node
Returns
string image file path

Reimplemented from ilRepositorySelectorExplorerGUI.

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

131 : string
132 {
133 if (str_contains($a_node["child"], "#")) {
134 return "";
135 }
136 $a_node["child"] = $this->getRefIdFromNodeId($a_node["child"]);
137 return parent::getNodeIcon($a_node);
138 }

References getRefIdFromNodeId().

+ Here is the call graph for this function:

◆ getNodeOnClick()

ilIntLinkRepItemExplorerGUI::getNodeOnClick (   $a_node)

get onclick event handling

Parameters
array | object$a_node

Reimplemented from ilExplorerBaseGUI.

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

75 : string
76 {
77 if ($this->getSetLinkTargetScript() === "") {
78 $ref_id = $this->getRefIdFromNodeId($a_node["child"]);
79 $anchor = $this->getAnchorFromNodeId($a_node["child"]);
80
81 $anchor_str = "";
82 if ($anchor !== "") {
83 $anchor_str = " anchor="" . $anchor . """;
84 }
85 return "return il.IntLink.addInternalLink('[iln " . $a_node['type'] . "="" . $ref_id . """ . $anchor_str . "]','[/iln]', event);";
86 }
87
88 return "";
89 }

References getAnchorFromNodeId(), getRefIdFromNodeId(), and getSetLinkTargetScript().

+ Here is the call graph for this function:

◆ getRefIdFromNodeId()

ilIntLinkRepItemExplorerGUI::getRefIdFromNodeId ( string  $node_id)
protected

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

113 : int
114 {
115 $e = explode("#", $node_id);
116 return (int) $e[0];
117 }

References Vendor\Package\$e.

Referenced by getChildsOfNode(), getNodeIcon(), getNodeOnClick(), isNodeClickable(), isNodeHighlighted(), and isNodeVisible().

+ Here is the caller graph for this function:

◆ getSetLinkTargetScript()

ilIntLinkRepItemExplorerGUI::getSetLinkTargetScript ( )

Get "set link target" script.

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

References $link_target_script.

Referenced by getNodeHref(), and getNodeOnClick().

+ Here is the caller graph for this function:

◆ isNodeClickable()

ilIntLinkRepItemExplorerGUI::isNodeClickable (   $a_node)

Is node clickable?

Parameters
object | array$a_nodenode
Returns
bool node clickable true/false

Reimplemented from ilRepositorySelectorExplorerGUI.

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

140 : bool
141 {
142 $a_node["child"] = $this->getRefIdFromNodeId($a_node["child"]);
143 return parent::isNodeClickable($a_node);
144 }

References getRefIdFromNodeId().

+ Here is the call graph for this function:

◆ isNodeHighlighted()

ilIntLinkRepItemExplorerGUI::isNodeHighlighted (   $a_node)

Is node highlighted?

Parameters
object | array$a_nodenode
Returns
bool node highlighted true/false

Reimplemented from ilRepositorySelectorExplorerGUI.

Definition at line 146 of file class.ilIntLinkRepItemExplorerGUI.php.

146 : bool
147 {
148 if (str_contains($a_node["child"], "#")) {
149 return false;
150 }
151 $a_node["child"] = $this->getRefIdFromNodeId($a_node["child"]);
152 return parent::isNodeHighlighted($a_node);
153 }

References getRefIdFromNodeId().

+ Here is the call graph for this function:

◆ isNodeVisible()

ilIntLinkRepItemExplorerGUI::isNodeVisible (   $a_node)

Is node visible?

Parameters
object | array$a_nodenode
Returns
bool node visible true/false

Reimplemented from ilRepositorySelectorExplorerGUI.

Definition at line 125 of file class.ilIntLinkRepItemExplorerGUI.php.

125 : bool
126 {
127 $a_node["child"] = $this->getRefIdFromNodeId($a_node["child"]);
128 return parent::isNodeVisible($a_node);
129 }

References getRefIdFromNodeId().

+ Here is the call graph for this function:

◆ setSetLinkTargetScript()

ilIntLinkRepItemExplorerGUI::setSetLinkTargetScript ( string  $a_script)

Set "set link target" script.

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

41 : void
42 {
43 $this->link_target_script = $a_script;
44 }

Field Documentation

◆ $link_target_script

string ilIntLinkRepItemExplorerGUI::$link_target_script
protected

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

Referenced by getSetLinkTargetScript().


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