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

Explorer for selecting repository items. More...

+ Inheritance diagram for ilRepositorySelectorExplorerGUI:
+ Collaboration diagram for ilRepositorySelectorExplorerGUI:

Public Member Functions

 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

 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

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
 

Private Attributes

string $clickable_permission = 'read'
 

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

Explorer for selecting repository items.

The implementation starts as a replacement for the often (ab)used ilSearchRootSelector class. Clicking items triggers a "selection" command. However ajax/checkbox/radio and use in an inputgui class should be implemented in the future, too.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ getChildsOfNode()

ilRepositorySelectorExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node.

Parameters
int | string$a_parent_node_idparent id
Returns
array childs

Reimplemented from ilTreeExplorerGUI.

Reimplemented in ilIntLinkRepItemExplorerGUI.

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

283 : array
284 {
285 $ilAccess = $this->access;
286 if (!$ilAccess->checkAccess("read", "", (int) $a_parent_node_id)) {
287 return [];
288 }
289
290 return parent::getChildsOfNode($a_parent_node_id);
291 }

References $access.

◆ getClickableTypes()

ilRepositorySelectorExplorerGUI::getClickableTypes ( )

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

References $clickable_types.

Referenced by isNodeClickable().

+ Here is the caller graph for this function:

◆ getContextHighlightNode()

ilRepositorySelectorExplorerGUI::getContextHighlightNode ( )
protected

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

168 : int
169 {
170 if ($this->context_highlight_node_determined) {
171 return $this->context_highlight_node ?? 0;
172 }
173
174 $this->context_highlight_node_determined = true;
175 $ref_id = $this->cur_ref_id;
176 if ($ref_id === 0) {
177 $this->context_highlight_node = (int) $this->getNodeId($this->getRootNode());
179 }
180
181 while ($ref_id > 0) {
182 $node = $this->tree->getNodeData($ref_id);
183 if (is_array($node) && $this->isNodeIncludedInTree($node)) {
184 $this->context_highlight_node = $ref_id;
185 return $ref_id;
186 }
187
188 $ref_id = $this->tree->getParentId($ref_id);
189 }
190
191 return 0;
192 }
getNodeId($a_node)
Get id for node.

References $context_highlight_node, $cur_ref_id, ilTreeExplorerGUI\getNodeId(), ilTreeExplorerGUI\getRootNode(), ILIAS\Repository\int(), and isNodeIncludedInTree().

Referenced by isNodeHighlighted().

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

◆ getHighlightedNode()

ilRepositorySelectorExplorerGUI::getHighlightedNode ( )

Definition at line 318 of file class.ilRepositorySelectorExplorerGUI.php.

References $highlighted_node.

Referenced by isNodeHighlighted().

+ Here is the caller graph for this function:

◆ getHTML()

ilRepositorySelectorExplorerGUI::getHTML (   $new = false)

Get HTML.

Returns
string html

Reimplemented from ilTreeExplorerGUI.

Definition at line 351 of file class.ilRepositorySelectorExplorerGUI.php.

351 : string
352 {
353 // note: the repository explorers do not support the
354 // new rendering yet, since this needs a refactoring of the underlying
355 // classes (async handling for performance). This will be done in the legacy ui project but requires
356 // a common strategy and funding. See also https://mantis.ilias.de/view.php?id=47319
357 return parent::getHTML();
358 }

◆ getNodeContent()

ilRepositorySelectorExplorerGUI::getNodeContent (   $a_node)

Get content of a node.

Parameters
object | array$a_nodenode array or object
Returns
string content of the node

Reimplemented from ilExplorerBaseGUI.

Definition at line 118 of file class.ilRepositorySelectorExplorerGUI.php.

118 : string
119 {
121
122 $c = $this->getNodeContentModifier();
123 if (is_callable($c)) {
124 return $c($a_node);
125 }
126
127 $title = $a_node["title"];
128 if ($title === "ILIAS" && (int) $a_node["child"] === (int) $this->getNodeId($this->getRootNode())) {
129 $title = $lng->txt("repository");
130 }
131
132 return (string) $title;
133 }
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...

References Vendor\Package\$c, ilTreeExplorerGUI\$lng, getNodeContentModifier(), ilTreeExplorerGUI\getNodeId(), ilTreeExplorerGUI\getRootNode(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getNodeContentModifier()

ilRepositorySelectorExplorerGUI::getNodeContentModifier ( )

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

113 : ?Closure
114 {
115 return $this->nc_modifier;
116 }

References $nc_modifier.

Referenced by getNodeContent().

+ Here is the caller graph for this function:

◆ getNodeHref()

ilRepositorySelectorExplorerGUI::getNodeHref (   $a_node)

Get href for node.

Parameters
object | array$a_node
Returns
string href attribute

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilPoolSelectorGUI, ilIntLinkRepItemExplorerGUI, ilLinkTargetObjectExplorerGUI, ilPCFileItemFileSelectorGUI, and ilGroupActionTargetExplorerGUI.

Definition at line 208 of file class.ilRepositorySelectorExplorerGUI.php.

208 : string
209 {
210 $ilCtrl = $this->ctrl;
211
212 if ($this->select_postvar === "") {
213 $ilCtrl->setParameterByClass($this->selection_gui, $this->selection_par, $a_node["child"]);
214 $link = $ilCtrl->getLinkTargetByClass($this->selection_gui, $this->selection_cmd);
215 $ilCtrl->setParameterByClass($this->selection_gui, $this->selection_par, "");
216 } else {
217 return "#";
218 }
219
220 return $link;
221 }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc

References ilExplorerBaseGUI\$ctrl, and ilCtrl\setParameterByClass().

+ Here is the call graph for this function:

◆ getNodeIcon()

ilRepositorySelectorExplorerGUI::getNodeIcon (   $a_node)

Get node icon path.

Parameters
object | array$a_node
Returns
string image file path

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilIntLinkRepItemExplorerGUI.

Definition at line 135 of file class.ilRepositorySelectorExplorerGUI.php.

135 : string
136 {
137 $obj_id = ilObject::_lookupObjId($a_node["child"]);
138 return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]);
139 }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupObjId(int $ref_id)

References ilObject\_getIcon(), and ilObject\_lookupObjId().

+ Here is the call graph for this function:

◆ getNodeIconAlt()

ilRepositorySelectorExplorerGUI::getNodeIconAlt (   $a_node)

Get node icon alt attribute.

Parameters
object | array$a_nodenode
Returns
string image alt attribute

Reimplemented from ilTreeExplorerGUI.

Definition at line 141 of file class.ilRepositorySelectorExplorerGUI.php.

141 : string
142 {
144
145 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
146 $title = $a_node["title"];
147 if ($title === "ILIAS") {
148 $title = $lng->txt("repository");
149 }
150 return $lng->txt("icon") . " " . $title;
151 }
152
153 return parent::getNodeIconAlt($a_node);
154 }

References ilTreeExplorerGUI\$lng, ilTreeExplorerGUI\getNodeId(), ilTreeExplorerGUI\getRootNode(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getSelectableTypes()

ilRepositorySelectorExplorerGUI::getSelectableTypes ( )

Definition at line 338 of file class.ilRepositorySelectorExplorerGUI.php.

References $selectable_types.

Referenced by isNodeSelectable().

+ Here is the caller graph for this function:

◆ isNodeClickable()

ilRepositorySelectorExplorerGUI::isNodeClickable (   $a_node)

Is node clickable?

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

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilConditionSelector, ilIntLinkRepItemExplorerGUI, ilLinkTargetObjectExplorerGUI, ilPCFileItemFileSelectorGUI, ilForumMoveTopicsExplorer, ilGroupActionTargetExplorerGUI, and ilTestQuestionPoolSelectorExplorer.

Definition at line 298 of file class.ilRepositorySelectorExplorerGUI.php.

298 : bool
299 {
300 $ilAccess = $this->access;
301
302 if (!$ilAccess->hasUserRBACorAnyPositionAccess($this->clickable_permission, $a_node["child"])) {
303 return false;
304 }
305
306 if (is_array($this->getClickableTypes()) && count($this->getClickableTypes()) > 0) {
307 return in_array($a_node["type"], $this->getClickableTypes(), true);
308 }
309
310 return true;
311 }

References $access, and getClickableTypes().

+ Here is the call graph for this function:

◆ isNodeHighlighted()

ilRepositorySelectorExplorerGUI::isNodeHighlighted (   $a_node)

Is node highlighted?

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

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilConditionSelector, and ilIntLinkRepItemExplorerGUI.

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

156 : bool
157 {
158 if ($this->getHighlightedNode()) {
159 if ((int) $this->getHighlightedNode() === (int) $a_node["child"]) {
160 return true;
161 }
162 return false;
163 }
164
165 return (int) $a_node["child"] === $this->getContextHighlightNode();
166 }

References getContextHighlightNode(), and getHighlightedNode().

+ Here is the call graph for this function:

◆ isNodeIncludedInTree()

ilRepositorySelectorExplorerGUI::isNodeIncludedInTree ( array  $node)
protected

Definition at line 194 of file class.ilRepositorySelectorExplorerGUI.php.

194 : bool
195 {
197 if (count($type_white_list) > 0 && !in_array($node["type"], $type_white_list, true)) {
198 return false;
199 }
200
201 if (in_array($node["type"], $this->getTypeBlackList(), true)) {
202 return false;
203 }
204
205 return $this->isNodeVisible($node);
206 }
getTypeWhiteList()
Get type white list.
getTypeBlackList()
Get type black list.

References ilTreeExplorerGUI\$type_white_list, ilTreeExplorerGUI\getTypeBlackList(), ilTreeExplorerGUI\getTypeWhiteList(), and isNodeVisible().

Referenced by getContextHighlightNode().

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

◆ isNodeSelectable()

ilRepositorySelectorExplorerGUI::isNodeSelectable (   $a_node)
protected

Is node selectable?

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

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilForumMoveTopicsExplorer.

Definition at line 343 of file class.ilRepositorySelectorExplorerGUI.php.

343 : bool
344 {
345 if (count($this->getSelectableTypes())) {
346 return in_array($a_node['type'], $this->getSelectableTypes(), true);
347 }
348 return true;
349 }

References getSelectableTypes().

+ Here is the call graph for this function:

◆ isNodeVisible()

ilRepositorySelectorExplorerGUI::isNodeVisible (   $a_node)

Is node visible?

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

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilConditionSelector, ilIntLinkRepItemExplorerGUI, ilStandardGlossarySelectorGUI, and ilTestQuestionPoolSelectorExplorer.

Definition at line 223 of file class.ilRepositorySelectorExplorerGUI.php.

223 : bool
224 {
225 $ilAccess = $this->access;
226
227 if (!$ilAccess->checkAccess('visible', '', $a_node["child"])) {
228 return false;
229 }
230
231 return true;
232 }

References $access.

Referenced by isNodeIncludedInTree().

+ Here is the caller graph for this function:

◆ setClickablePermission()

ilRepositorySelectorExplorerGUI::setClickablePermission ( string  $rbac_perm)

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

293 : void
294 {
295 $this->clickable_permission = $rbac_perm;
296 }

◆ setClickableTypes()

ilRepositorySelectorExplorerGUI::setClickableTypes ( array  $a_types)

Definition at line 323 of file class.ilRepositorySelectorExplorerGUI.php.

323 : void
324 {
325 $this->clickable_types = $a_types;
326 }

Referenced by ilPCFileItemFileSelectorGUI\__construct(), ilStandardGlossarySelectorGUI\__construct(), and ilTestQuestionPoolSelectorExplorer\__construct().

+ Here is the caller graph for this function:

◆ setHighlightedNode()

ilRepositorySelectorExplorerGUI::setHighlightedNode ( string  $a_value)

Definition at line 313 of file class.ilRepositorySelectorExplorerGUI.php.

313 : void
314 {
315 $this->highlighted_node = $a_value;
316 }

◆ setNodeContentModifier()

ilRepositorySelectorExplorerGUI::setNodeContentModifier ( Closure  $a_val)

Definition at line 108 of file class.ilRepositorySelectorExplorerGUI.php.

108 : void
109 {
110 $this->nc_modifier = $a_val;
111 }

◆ setSelectableTypes()

ilRepositorySelectorExplorerGUI::setSelectableTypes ( array  $a_types)

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

333 : void
334 {
335 $this->selectable_types = $a_types;
336 }

◆ sortChilds()

ilRepositorySelectorExplorerGUI::sortChilds ( array  $a_childs,
  $a_parent_node_id 
)

Sort childs.

Parameters
array$a_childsarray of child nodes
string$a_parent_node_idparent node
Returns
array array of childs nodes

Reimplemented from ilExplorerBaseGUI.

Definition at line 234 of file class.ilRepositorySelectorExplorerGUI.php.

234 : array
235 {
236 $objDefinition = $this->obj_definition;
237
238 $parent_obj_id = ilObject::_lookupObjId((int) $a_parent_node_id);
239
240 if ($parent_obj_id > 0) {
241 $parent_type = ilObject::_lookupType($parent_obj_id);
242 } else {
243 $parent_type = "dummy";
244 $this->type_grps["dummy"] = ["root" => "dummy"];
245 }
246
247 if (empty($this->type_grps[$parent_type])) {
248 $this->type_grps[$parent_type] =
249 $objDefinition::getGroupedRepositoryObjectTypes($parent_type);
250 }
251 $group = [];
252
253 foreach ($a_childs as $child) {
254 $g = $objDefinition->getGroupOfObj($child["type"]);
255 if ($g == "") {
256 $g = $child["type"];
257 }
258 $group[$g][] = $child;
259 }
260
261 // #14587 - $objDefinition->getGroupedRepositoryObjectTypes does NOT include side blocks!
262 $wl = $this->getTypeWhiteList();
263 if (is_array($wl) && in_array("poll", $wl, true)) {
264 $this->type_grps[$parent_type]["poll"] = [];
265 }
266
267 $childs = [];
268 foreach ($this->type_grps[$parent_type] as $t => $g) {
269 if (isset($group[$t])) {
270 // do we have to sort this group??
271 $sort = ilContainerSorting::_getInstance($parent_obj_id);
272 $group = $sort->sortItems($group);
273
274 foreach ($group[$t] as $k => $item) {
275 $childs[] = $item;
276 }
277 }
278 }
279
280 return $childs;
281 }
static _getInstance(int $a_obj_id)
static _lookupType(int $id, bool $reference=false)

References ilTreeExplorerGUI\$childs, $obj_definition, ilContainerSorting\_getInstance(), ilObject\_lookupObjId(), ilObject\_lookupType(), and ilTreeExplorerGUI\getTypeWhiteList().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilRepositorySelectorExplorerGUI::$access
protected

◆ $clickable_permission

string ilRepositorySelectorExplorerGUI::$clickable_permission = 'read'
private

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

◆ $clickable_types

array ilRepositorySelectorExplorerGUI::$clickable_types = []
protected

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

Referenced by getClickableTypes().

◆ $context_highlight_node

int ilRepositorySelectorExplorerGUI::$context_highlight_node = null
protected

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

Referenced by getContextHighlightNode().

◆ $context_highlight_node_determined

bool ilRepositorySelectorExplorerGUI::$context_highlight_node_determined = false
protected

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

◆ $cur_ref_id

int ilRepositorySelectorExplorerGUI::$cur_ref_id
protected

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

Referenced by getContextHighlightNode().

◆ $highlighted_node

string ilRepositorySelectorExplorerGUI::$highlighted_node = ""
protected

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

Referenced by getHighlightedNode().

◆ $nc_modifier

Closure ilRepositorySelectorExplorerGUI::$nc_modifier = null
protected

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

Referenced by getNodeContentModifier().

◆ $obj_definition

ilObjectDefinition ilRepositorySelectorExplorerGUI::$obj_definition
protected

Definition at line 33 of file class.ilRepositorySelectorExplorerGUI.php.

Referenced by sortChilds().

◆ $request

StandardGUIRequest ilRepositorySelectorExplorerGUI::$request
protected

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

◆ $selectable_types

array ilRepositorySelectorExplorerGUI::$selectable_types = []
protected

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

Referenced by getSelectableTypes().

◆ $selection_cmd

string ilRepositorySelectorExplorerGUI::$selection_cmd
protected

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

◆ $selection_gui

string ilRepositorySelectorExplorerGUI::$selection_gui = null
protected

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

◆ $selection_par

string ilRepositorySelectorExplorerGUI::$selection_par
protected

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

◆ $session_materials

array ilRepositorySelectorExplorerGUI::$session_materials = []
protected

Definition at line 35 of file class.ilRepositorySelectorExplorerGUI.php.

◆ $type_grps

array ilRepositorySelectorExplorerGUI::$type_grps = []
protected

Definition at line 34 of file class.ilRepositorySelectorExplorerGUI.php.


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