ILIAS  release_7 Revision v7.30-3-g800a261c036
ilRepositorySelectorExplorerGUI Class Reference

Explorer for selecting repository items. More...

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

Public Member Functions

 __construct ( $a_parent_obj, $a_parent_cmd, $a_selection_gui=null, $a_selection_cmd="selectObject", $a_selection_par="sel_ref_id", $a_id="rep_exp_sel")
 Constructor. More...
 
 setNodeContentModifier (callable $a_val)
 Set node content modifier. More...
 
 getNodeContentModifier ()
 Get node content modifier. More...
 
 getNodeContent ($a_node)
 Get node content. More...
 
 getNodeIcon ($a_node)
 Get node icon. More...
 
 getNodeIconAlt ($a_node)
 Get node icon alt text. More...
 
 isNodeHighlighted ($a_node)
 Is node highlighted? More...
 
 getNodeHref ($a_node)
 Get href for node. More...
 
 isNodeVisible ($a_node)
 Is node visible. More...
 
 sortChilds ($a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs of node. More...
 
 isNodeClickable ($a_node)
 Is node clickable? More...
 
 setHighlightedNode ($a_value)
 set an alternate highlighted node if $_GET["ref_id"] is not set or wrong More...
 
 getHighlightedNode ()
 get an alternate highlighted node if $_GET["ref_id"] is not set or wrong Returns null if not set More...
 
 setClickableTypes ($a_types)
 set Whitelist for clickable items More...
 
 getClickableTypes ()
 get whitelist for clickable items More...
 
 setSelectableTypes ($a_types)
 Get HTML. More...
 
 getSelectableTypes ()
 get whitelist for clickable items More...
 
- Public Member Functions inherited from ilTreeExplorerGUI
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd, $a_tree)
 Constructor. More...
 
 getTree ()
 Get tree. More...
 
 setOrderField ($a_val, $a_numeric=false)
 Set order field. More...
 
 getOrderField ()
 Get order field. More...
 
 setTypeWhiteList ($a_val)
 Set type white list. More...
 
 getTypeWhiteList ()
 Get type white list. More...
 
 setTypeBlackList ($a_val)
 Set type black list. More...
 
 getTypeBlackList ()
 Get type black list. More...
 
 setPreloadChilds ($a_val)
 Set preload childs. More...
 
 getPreloadChilds ()
 Get preload childs. More...
 
 getSuccessorNode ($a_node_id, $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 ($node, $environment=null)
 Get a list of records (that list can also be empty).Each record will be relayed to $this->build to retrieve a Node. Also, each record will be asked for Sub-Nodes using this function.
Returns
array
More...
 
 build (\ILIAS\UI\Component\Tree\Node\Factory $factory, $record, $environment=null)
 
 getTreeLabel ()
 
 getTreeComponent ()
 Get Tree UI. More...
 
 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
 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd)
 Constructor. More...
 
 setChildLimit ($a_val)
 Set child limit. More...
 
 getChildLimit ()
 Get child limit. More...
 
 setSearchTerm ($a_val)
 Set search term. More...
 
 getSearchTerm ()
 Get search term. More...
 
 setMainTemplate ($a_main_tpl=null)
 Set main template (that is responsible for adding js/css) More...
 
 getRootNode ()
 Get root node. More...
 
 getChildsOfNode ($a_parent_node_id)
 Get childs 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 childs? More...
 
 sortChilds ($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 ($a_val)
 Set skip root node. More...
 
 getSkipRootNode ()
 Get skip root node. More...
 
 setAjax ($a_val)
 Set ajax. More...
 
 getAjax ()
 Get ajax. More...
 
 setSecondaryHighlightedNodes ($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 ($a_postvar, $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 ($a_val)
 Set offline mode. More...
 
 getOfflineMode ()
 Get offline mode. More...
 
 handleCommand ()
 Handle explorer internal command. More...
 
 getContainerId ()
 Get container id. More...
 
 openNode ()
 Open node. More...
 
 closeNode ()
 Close node. More...
 
 getNodeAsync ()
 Get node asynchronously. More...
 
 beforeRendering ()
 Before rendering. More...
 
 getOnLoadCode ()
 Get on load code. More...
 
 getHTML ()
 Get HTML. More...
 
 renderNode ($a_node, $tpl)
 Render node. More...
 
 renderChilds ($a_node_id, $tpl)
 Render childs. More...
 
 getDomNodeIdForNodeId ($a_node_id)
 Get DOM node id for node id. More...
 
 getNodeIdForDomNodeId ($a_dom_node_id)
 Get node id for dom node id. More...
 
 listItemStart ($tpl, $a_node)
 List item start. More...
 
 listItemEnd ($tpl)
 List item end. More...
 
 listStart ($tpl)
 List start. More...
 
 listEnd ($tpl)
 List end. More...
 
 isNodeOnclickEnabled ()
 
 setNodeOnclickEnabled ($nodeOnclickEnabled)
 
 isEnableDnd ()
 
 setEnableDnd ($enable_dnd)
 Enable Drag & Drop functionality. More...
 
- 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

 isNodeSelectable ($a_node)
 Is node selectable? More...
 
- Protected Member Functions inherited from ilTreeExplorerGUI
 preloadChilds ()
 Preload childs. More...
 
 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 ()
 Render tree. More...
 
- 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 ()
 

Protected Attributes

 $obj_definition
 
 $lng
 
 $type_grps = array()
 
 $session_materials = array()
 
 $highlighted_node = null
 
 $clickable_types = array()
 
 $ctrl
 
 $access
 
 $nc_modifier = null
 
 $selection_gui = null
 
 $selection_par
 
 $selection_cmd
 
- Protected Attributes inherited from ilTreeExplorerGUI
 $lng
 
 $httpRequest
 
 $tree = null
 
 $tree_label = ""
 
 $order_field = ""
 
 $order_field_numeric = false
 
 $type_white_list = array()
 
 $type_black_list = array()
 
 $childs = array()
 
 $preloaded = false
 
 $preload_childs = false
 
 $root_node_data = null
 
 $all_childs = array()
 
 $ui
 
- Protected Attributes inherited from ilExplorerBaseGUI
 $log
 
 $ctrl
 
 $tpl
 
 $skip_root_node = false
 
 $ajax = false
 
 $custom_open_nodes = array()
 
 $selected_nodes = array()
 
 $select_postvar = ""
 
 $offline_mode = false
 
 $sec_highl_nodes = array()
 
 $enable_dnd = false
 
 $search_term = ""
 
 $open_nodes = []
 
 $store
 
 $parent_obj
 
 $child_limit = 0
 
 $parent_cmd = ''
 

Additional Inherited Members

- Static Public Member Functions inherited from ilExplorerBaseGUI
static getLocalExplorerJsPath ()
 Get local path of explorer js. More...
 
static getLocalJsTreeJsPath ()
 Get local path of jsTree js. More...
 
static getLocalJsTreeCssPath ()
 Get local path of jsTree js. More...
 
static createHTMLExportDirs ($a_target_dir)
 Create html export directories. More...
 
static init ($a_main_tpl=null)
 Init JS. More...
 
- Static Protected Attributes inherited from ilExplorerBaseGUI
static $js_tree_path = "./node_modules/jstree/dist/jstree.js"
 
static $js_tree_path_css = "./node_modules/jstree/dist/themes/default/style.min.css"
 
static $js_expl_path = "./Services/UIComponent/Explorer2/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
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilRepositorySelectorExplorerGUI::__construct (   $a_parent_obj,
  $a_parent_cmd,
  $a_selection_gui = null,
  $a_selection_cmd = "selectObject",
  $a_selection_par = "sel_ref_id",
  $a_id = "rep_exp_sel" 
)

Constructor.

Parameters
object$a_parent_objparent gui object
string$a_parent_cmdparent cmd that renders the explorer
object/string$a_selection_gui gui class that should be called for the selection command
string$a_selection_cmdselection command
string$a_selection_parselection parameter

Reimplemented in ilPoolSelectorGUI, and ilPCFileItemFileSelectorGUI.

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

81 {
82 global $DIC;
83
84 $this->tree = $DIC->repositoryTree();
85 $this->obj_definition = $DIC["objDefinition"];
86 $this->lng = $DIC->language();
87 $tree = $DIC->repositoryTree();
88 $ilSetting = $DIC->settings();
89 $objDefinition = $DIC["objDefinition"];
90
91 $this->access = $DIC->access();
92 $this->ctrl = $DIC->ctrl();
93
94 if (is_null($a_selection_gui)) {
95 $a_selection_gui = $a_parent_obj;
96 }
97
98 $this->selection_gui = is_object($a_selection_gui)
99 ? strtolower(get_class($a_selection_gui))
100 : strtolower($a_selection_gui);
101 $this->selection_cmd = $a_selection_cmd;
102 $this->selection_par = $a_selection_par;
103 parent::__construct($a_id, $a_parent_obj, $a_parent_cmd, $tree);
104
105 $this->setSkipRootNode(false);
106 $this->setAjax(true);
107 $this->setOrderField("title");
108
109 // per default: all object types, except item groups
110 $white = array();
111 foreach ($objDefinition->getSubObjectsRecursively("root") as $rtype) {
112 if ($rtype["name"] != "itgr" && !$objDefinition->isSideBlock($rtype["name"])) {
113 $white[] = $rtype["name"];
114 }
115 }
116 $this->setTypeWhiteList($white);
117
118 // always open the path to the current ref id
119 $this->setPathOpen((int) $this->tree->readRootId());
120 if ((int) $_GET["ref_id"] > 0) {
121 $this->setPathOpen((int) $_GET["ref_id"]);
122 }
123 $this->setChildLimit((int) $ilSetting->get("rep_tree_limit_number"));
124 }
$_GET["client_id"]
setChildLimit($a_val)
Set child limit.
setSkipRootNode($a_val)
Set skip root node.
setTypeWhiteList($a_val)
Set type white list.
setPathOpen($a_id)
Set node path to be opened.
setOrderField($a_val, $a_numeric=false)
Set order field.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilSetting
Definition: privfeed.php:17

References $_GET, $DIC, $ilSetting, ilTreeExplorerGUI\$tree, ILIAS\GlobalScreen\Provider\__construct(), ilExplorerBaseGUI\setAjax(), ilExplorerBaseGUI\setChildLimit(), ilTreeExplorerGUI\setOrderField(), ilTreeExplorerGUI\setPathOpen(), ilExplorerBaseGUI\setSkipRootNode(), and ilTreeExplorerGUI\setTypeWhiteList().

+ Here is the call graph for this function:

Member Function Documentation

◆ getChildsOfNode()

ilRepositorySelectorExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Get childs of node.

Parameters
int$a_parent_node_idnode id
Returns
array childs array

Reimplemented from ilTreeExplorerGUI.

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

334 {
335 $ilAccess = $this->access;
336
337 if (!$ilAccess->checkAccess("read", "", $a_parent_node_id)) {
338 return array();
339 }
340
341 return parent::getChildsOfNode($a_parent_node_id);
342 }

References $access.

◆ getClickableTypes()

ilRepositorySelectorExplorerGUI::getClickableTypes ( )

get whitelist for clickable items

Returns
array types

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

References $clickable_types.

Referenced by isNodeClickable().

+ Here is the caller graph for this function:

◆ getHighlightedNode()

ilRepositorySelectorExplorerGUI::getHighlightedNode ( )

get an alternate highlighted node if $_GET["ref_id"] is not set or wrong Returns null if not set

Returns
mixed ref_id

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

References $highlighted_node.

Referenced by isNodeHighlighted().

+ Here is the caller graph for this function:

◆ getNodeContent()

ilRepositorySelectorExplorerGUI::getNodeContent (   $a_node)

Get node content.

Parameters
array$a_nodenode data
Returns
string content

Reimplemented from ilExplorerBaseGUI.

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

153 {
155
156 $c = $this->getNodeContentModifier();
157 if (is_callable($c)) {
158 return $c($a_node);
159 }
160
161 $title = $a_node["title"];
162 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
163 if ($title == "ILIAS") {
164 $title = $lng->txt("repository");
165 }
166 }
167
168 return $title;
169 }
getNodeId($a_node)
Get id for node.
$c
Definition: cli.php:37

References $c, $lng, getNodeContentModifier(), ilTreeExplorerGUI\getNodeId(), and ilTreeExplorerGUI\getRootNode().

+ Here is the call graph for this function:

◆ getNodeContentModifier()

ilRepositorySelectorExplorerGUI::getNodeContentModifier ( )

Get node content modifier.

Returns
callable

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

References $nc_modifier.

Referenced by getNodeContent().

+ Here is the caller graph for this function:

◆ getNodeHref()

ilRepositorySelectorExplorerGUI::getNodeHref (   $a_node)

Get href for node.

Parameters
mixed$a_nodenode object/array
Returns
string href attribute

Reimplemented from ilExplorerBaseGUI.

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

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

234 {
235 $ilCtrl = $this->ctrl;
236
237 if ($this->select_postvar == "") {
238 $ilCtrl->setParameterByClass($this->selection_gui, $this->selection_par, $a_node["child"]);
239 $link = $ilCtrl->getLinkTargetByClass($this->selection_gui, $this->selection_cmd);
240 $ilCtrl->setParameterByClass($this->selection_gui, $this->selection_par, "");
241 } else {
242 return "#";
243 }
244
245 return $link;
246 }

References $ctrl.

◆ getNodeIcon()

ilRepositorySelectorExplorerGUI::getNodeIcon (   $a_node)

Get node icon.

Parameters
array$a_nodenode data
Returns
string icon path

Reimplemented from ilExplorerBaseGUI.

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

178 {
179 $obj_id = ilObject::_lookupObjId($a_node["child"]);
180 return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]);
181 }
static _lookupObjId($a_id)
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.

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

+ Here is the call graph for this function:

◆ getNodeIconAlt()

ilRepositorySelectorExplorerGUI::getNodeIconAlt (   $a_node)

Get node icon alt text.

Parameters
array$a_nodenode data
Returns
string alt text

Reimplemented from ilTreeExplorerGUI.

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

190 {
192
193 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
194 $title = $a_node["title"];
195 if ($title == "ILIAS") {
196 $title = $lng->txt("repository");
197 }
198 return $lng->txt("icon") . " " . $title;
199 }
200
201
202 return parent::getNodeIconAlt($a_node);
203 }

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

+ Here is the call graph for this function:

◆ getSelectableTypes()

ilRepositorySelectorExplorerGUI::getSelectableTypes ( )

get whitelist for clickable items

Returns
array types

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

456 {
457 return (array) $this->selectable_types;
458 }

Referenced by isNodeSelectable().

+ Here is the caller graph for this function:

◆ isNodeClickable()

ilRepositorySelectorExplorerGUI::isNodeClickable (   $a_node)

Is node clickable?

Parameters
array$a_nodenode data
Returns
boolean node clickable true/false

Reimplemented from ilExplorerBaseGUI.

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

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

351 {
352 $ilAccess = $this->access;
353
354 if ($this->select_postvar != "") {
355 // return false; #14354
356 }
357
358 if (!$ilAccess->hasUserRBACorAnyPositionAccess("read", $a_node["child"])) {
359 return false;
360 }
361
362 if (is_array($this->getClickableTypes()) && count($this->getClickableTypes()) > 0) {
363 return in_array($a_node["type"], $this->getClickableTypes());
364 }
365
366 return true;
367 }
getClickableTypes()
get whitelist for clickable items

References $access, and getClickableTypes().

+ Here is the call graph for this function:

◆ isNodeHighlighted()

ilRepositorySelectorExplorerGUI::isNodeHighlighted (   $a_node)

Is node highlighted?

Parameters
mixed$a_nodenode object/array
Returns
boolean node visible true/false

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilConditionSelector.

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

212 {
213 if ($this->getHighlightedNode()) {
214 if ($this->getHighlightedNode() == $a_node["child"]) {
215 return true;
216 }
217 return false;
218 }
219
220 if ($a_node["child"] == $_GET["ref_id"] ||
221 ($_GET["ref_id"] == "" && $a_node["child"] == $this->getNodeId($this->getRootNode()))) {
222 return true;
223 }
224 return false;
225 }
getHighlightedNode()
get an alternate highlighted node if $_GET["ref_id"] is not set or wrong Returns null if not set

References $_GET, getHighlightedNode(), ilTreeExplorerGUI\getNodeId(), and ilTreeExplorerGUI\getRootNode().

+ Here is the call graph for this function:

◆ isNodeSelectable()

ilRepositorySelectorExplorerGUI::isNodeSelectable (   $a_node)
protected

Is node selectable?

Parameters
mixed$a_nodenode object/array
Returns
boolean node selectable true/false

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilForumMoveTopicsExplorer.

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

467 {
468 if (count($this->getSelectableTypes())) {
469 return in_array($a_node['type'], $this->getSelectableTypes());
470 }
471 return true;
472 }
getSelectableTypes()
get whitelist for clickable items

References getSelectableTypes().

+ Here is the call graph for this function:

◆ isNodeVisible()

ilRepositorySelectorExplorerGUI::isNodeVisible (   $a_node)

Is node visible.

Parameters
array$a_nodenode data
Returns
bool visible true/false

Reimplemented from ilExplorerBaseGUI.

Reimplemented in ilForumMoveTopicsExplorer, ilConditionSelector, and ilTestQuestionPoolSelectorExplorer.

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

255 {
256 $ilAccess = $this->access;
257
258 if (!$ilAccess->checkAccess('visible', '', $a_node["child"])) {
259 return false;
260 }
261
262 return true;
263 }

References $access.

◆ setClickableTypes()

ilRepositorySelectorExplorerGUI::setClickableTypes (   $a_types)

set Whitelist for clickable items

Parameters
array/string$a_types array type

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

396 {
397 if (!is_array($a_types)) {
398 $a_types = array($a_types);
399 }
400 $this->clickable_types = $a_types;
401 }

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

+ Here is the caller graph for this function:

◆ setHighlightedNode()

ilRepositorySelectorExplorerGUI::setHighlightedNode (   $a_value)

set an alternate highlighted node if $_GET["ref_id"] is not set or wrong

Parameters
int$a_valueref_id

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

375 {
376 $this->highlighted_node = $a_value;
377 }

◆ setNodeContentModifier()

ilRepositorySelectorExplorerGUI::setNodeContentModifier ( callable  $a_val)

Set node content modifier.

Parameters
callable$a_val

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

132 {
133 $this->nc_modifier = $a_val;
134 }

◆ setSelectableTypes()

ilRepositorySelectorExplorerGUI::setSelectableTypes (   $a_types)

Get HTML.

Parameters

return set Whitelist for clickable items

Parameters
array/string$a_types array type

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

443 {
444 if (!is_array($a_types)) {
445 $a_types = array($a_types);
446 }
447 $this->selectable_types = $a_types;
448 }

◆ sortChilds()

ilRepositorySelectorExplorerGUI::sortChilds (   $a_childs,
  $a_parent_node_id 
)

Sort childs.

Parameters
array$a_childsarray of child nodes
int$a_parent_node_idparent node id
Returns
array array of childs nodes

Reimplemented from ilExplorerBaseGUI.

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

273 {
274 $objDefinition = $this->obj_definition;
275
276 $parent_obj_id = ilObject::_lookupObjId($a_parent_node_id);
277
278 if ($parent_obj_id > 0) {
279 $parent_type = ilObject::_lookupType($parent_obj_id);
280 } else {
281 $parent_type = "dummy";
282 $this->type_grps["dummy"] = array("root" => "dummy");
283 }
284
285 if (empty($this->type_grps[$parent_type])) {
286 $this->type_grps[$parent_type] =
287 $objDefinition->getGroupedRepositoryObjectTypes($parent_type);
288 }
289 $group = array();
290
291 foreach ($a_childs as $child) {
292 $g = $objDefinition->getGroupOfObj($child["type"]);
293 if ($g == "") {
294 $g = $child["type"];
295 }
296 $group[$g][] = $child;
297 }
298
299 // #14587 - $objDefinition->getGroupedRepositoryObjectTypes does NOT include side blocks!
300 $wl = $this->getTypeWhiteList();
301 if (is_array($wl) && in_array("poll", $wl)) {
302 $this->type_grps[$parent_type]["poll"] = array();
303 }
304
305 $childs = array();
306 foreach ($this->type_grps[$parent_type] as $t => $g) {
307 if (is_array($group[$t])) {
308 // do we have to sort this group??
309 include_once("./Services/Container/classes/class.ilContainer.php");
310 include_once("./Services/Container/classes/class.ilContainerSorting.php");
311 $sort = ilContainerSorting::_getInstance($parent_obj_id);
312 $group = $sort->sortItems($group);
313
314 // need extra session sorting here
315 if ($t == "sess") {
316 }
317
318 foreach ($group[$t] as $k => $item) {
319 $childs[] = $item;
320 }
321 }
322 }
323
324 return $childs;
325 }
static _getInstance($a_obj_id)
get instance by obj_id
static _lookupType($a_id, $a_reference=false)
lookup object type
getTypeWhiteList()
Get type white list.

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

ilRepositorySelectorExplorerGUI::$access
protected

◆ $clickable_types

ilRepositorySelectorExplorerGUI::$clickable_types = array()
protected

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

Referenced by getClickableTypes().

◆ $ctrl

ilRepositorySelectorExplorerGUI::$ctrl
protected

◆ $highlighted_node

ilRepositorySelectorExplorerGUI::$highlighted_node = null
protected

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

Referenced by getHighlightedNode().

◆ $lng

ilRepositorySelectorExplorerGUI::$lng
protected

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

Referenced by getNodeContent(), and getNodeIconAlt().

◆ $nc_modifier

ilRepositorySelectorExplorerGUI::$nc_modifier = null
protected

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

Referenced by getNodeContentModifier().

◆ $obj_definition

ilRepositorySelectorExplorerGUI::$obj_definition
protected

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

Referenced by sortChilds().

◆ $selection_cmd

ilRepositorySelectorExplorerGUI::$selection_cmd
protected

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

◆ $selection_gui

ilRepositorySelectorExplorerGUI::$selection_gui = null
protected

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

◆ $selection_par

ilRepositorySelectorExplorerGUI::$selection_par
protected

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

◆ $session_materials

ilRepositorySelectorExplorerGUI::$session_materials = array()
protected

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

◆ $type_grps

ilRepositorySelectorExplorerGUI::$type_grps = array()
protected

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


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