ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAdministrationExplorerGUI Class Reference

Administration explorer GUI class. More...

+ Inheritance diagram for ilAdministrationExplorerGUI:
+ Collaboration diagram for ilAdministrationExplorerGUI:

Public Member Functions

 __construct (string $a_parent_obj, string $a_parent_cmd)
 
 getNodeContent ($a_node)
 
 getNodeIcon ($a_node)
 
 getNodeIconAlt ($a_node)
 
 isNodeHighlighted ($a_node)
 
 getNodeHref ($a_node)
 
 isNodeVisible ($a_node)
 
 sortChilds (array $a_childs, $a_parent_node_id)
 Sort childs. More...
 
 getChildsOfNode ($a_parent_node_id)
 
 isNodeClickable ($a_node)
 
- 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 Attributes

ilSetting $settings
 
ilObjectDefinition $obj_definition
 
ilRbacSystem $rbacsystem
 
ilDBInterface $db
 
ilObjUser $user
 
ilAccessHandler $access
 
array $type_grps = array()
 
array $session_materials = array()
 
AdminGUIRequest $request
 
int $cur_ref_id
 
int $top_node_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)
 
- 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)
 
- 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

Administration explorer GUI class.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilAdministrationExplorerGUI::__construct ( string  $a_parent_obj,
string  $a_parent_cmd 
)

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

45 {
46 global $DIC;
47
48 $this->tree = $DIC->repositoryTree();
49 $this->settings = $DIC->settings();
50 $this->obj_definition = $DIC["objDefinition"];
51 $this->lng = $DIC->language();
52 $this->ctrl = $DIC->ctrl();
53 $this->rbacsystem = $DIC->rbac()->system();
54 $this->db = $DIC->database();
55 $this->user = $DIC->user();
56 $this->access = $DIC->access();
57 $tree = $DIC->repositoryTree();
58 $objDefinition = $DIC["objDefinition"];
59 $this->request = new AdminGUIRequest(
60 $DIC->http(),
61 $DIC->refinery()
62 );
63
64 $this->cur_ref_id = $this->request->getRefId();
65
66 $this->top_node_id = 0;
67 parent::__construct("adm_exp", $a_parent_obj, $a_parent_cmd, $tree);
68
69 $this->setSkipRootNode(false);
70 $this->setAjax(true);
71 $this->setOrderField("title");
72
73 $white = array();
74 foreach ($objDefinition->getSubObjectsRecursively("root") as $rtype) {
75 if ($rtype["name"] !== "itgr" && !$objDefinition->isSideBlock($rtype["name"])) {
76 $white[] = $rtype["name"];
77 }
78 }
79 $this->setTypeWhiteList($white);
80
81 if ($this->cur_ref_id > 0) {
82 $this->setPathOpen($this->cur_ref_id);
83 }
84 }
setOrderField(string $a_val, bool $a_numeric=false)
setPathOpen($a_id)
Set node path to be opened.
setTypeWhiteList(array $a_val)
Set type white list.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilTreeExplorerGUI\$tree, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilExplorerBaseGUI\setAjax(), ilTreeExplorerGUI\setOrderField(), ilTreeExplorerGUI\setPathOpen(), ilExplorerBaseGUI\setSkipRootNode(), ILIAS\Repository\settings(), ilTreeExplorerGUI\setTypeWhiteList(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ getChildsOfNode()

ilAdministrationExplorerGUI::getChildsOfNode (   $a_parent_node_id)
Parameters
int | string$a_parent_node_idparent id

Reimplemented from ilTreeExplorerGUI.

Definition at line 225 of file class.ilAdministrationExplorerGUI.php.

225 : array
226 {
228
229 if (!$rbacsystem->checkAccess("read", (int) $a_parent_node_id)) {
230 return array();
231 }
232
233 return parent::getChildsOfNode($a_parent_node_id);
234 }
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 ...

References $rbacsystem, and ilRbacSystem\checkAccess().

+ Here is the call graph for this function:

◆ getNodeContent()

ilAdministrationExplorerGUI::getNodeContent (   $a_node)
Parameters
object | array$a_nodenode array or object

Reimplemented from ilExplorerBaseGUI.

Definition at line 89 of file class.ilAdministrationExplorerGUI.php.

89 : string
90 {
92
93 $title = $a_node["title"];
94 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
95 if ($title === "ILIAS") {
96 $title = $lng->txt("repository");
97 }
98 }
99
100 return $title;
101 }
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...
getNodeId($a_node)
Get id for node.

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

+ Here is the call graph for this function:

◆ getNodeHref()

ilAdministrationExplorerGUI::getNodeHref (   $a_node)
Parameters
object | array$a_nodenode array or object

Reimplemented from ilExplorerBaseGUI.

Definition at line 143 of file class.ilAdministrationExplorerGUI.php.

143 : string
144 {
145 $ilCtrl = $this->ctrl;
146 $objDefinition = $this->obj_definition;
147
148 $class_name = $objDefinition->getClassName($a_node["type"]);
149 $class = strtolower("ilObj" . $class_name . "GUI");
150 $ilCtrl->setParameterByClass($class, "ref_id", $a_node["child"]);
151 $link = $ilCtrl->getLinkTargetByClass($class, "view");
152 $ilCtrl->setParameterByClass($class, "ref_id", $this->cur_ref_id);
153
154 return $link;
155 }
getClassName(string $obj_name)

References ilExplorerBaseGUI\$ctrl, $obj_definition, and ilObjectDefinition\getClassName().

+ Here is the call graph for this function:

◆ getNodeIcon()

ilAdministrationExplorerGUI::getNodeIcon (   $a_node)
Parameters
object | array$a_nodenode array or object

Reimplemented from ilExplorerBaseGUI.

Definition at line 106 of file class.ilAdministrationExplorerGUI.php.

106 : string
107 {
108 $obj_id = ilObject::_lookupObjId((int) $a_node["child"]);
109 return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]);
110 }
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()

ilAdministrationExplorerGUI::getNodeIconAlt (   $a_node)
Parameters
object | array$a_nodenode array or object

Reimplemented from ilTreeExplorerGUI.

Definition at line 115 of file class.ilAdministrationExplorerGUI.php.

115 : string
116 {
118
119 if ($a_node["child"] == $this->getNodeId($this->getRootNode())) {
120 $title = $a_node["title"];
121 if ($title === "ILIAS") {
122 $title = $lng->txt("repository");
123 }
124 return $lng->txt("icon") . " " . $title;
125 }
126
127
128 return parent::getNodeIconAlt($a_node);
129 }

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

+ Here is the call graph for this function:

◆ isNodeClickable()

ilAdministrationExplorerGUI::isNodeClickable (   $a_node)
Parameters
object | array$a_nodenode array or object

Reimplemented from ilExplorerBaseGUI.

Definition at line 239 of file class.ilAdministrationExplorerGUI.php.

239 : bool
240 {
241 return $this->rbacsystem->checkAccess('read', (int) $a_node["child"]);
242 }

◆ isNodeHighlighted()

ilAdministrationExplorerGUI::isNodeHighlighted (   $a_node)
Parameters
object | array$a_nodenode array or object

Reimplemented from ilExplorerBaseGUI.

Definition at line 134 of file class.ilAdministrationExplorerGUI.php.

134 : bool
135 {
136 return $a_node["child"] == $this->cur_ref_id ||
137 ($this->cur_ref_id === 0 && $a_node["child"] == $this->getNodeId($this->getRootNode()));
138 }

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

+ Here is the call graph for this function:

◆ isNodeVisible()

ilAdministrationExplorerGUI::isNodeVisible (   $a_node)
Parameters
object | array$a_nodenode array or object

Reimplemented from ilExplorerBaseGUI.

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

160 : bool
161 {
163
164 $visible = $rbacsystem->checkAccess('visible', (int) $a_node["child"]);
165 if ($a_node["type"] === "rolf" && $a_node["child"] != ROLE_FOLDER_ID) {
166 return false;
167 }
168 return $visible;
169 }
const ROLE_FOLDER_ID
Definition: constants.php:34

References $rbacsystem, ilRbacSystem\checkAccess(), and ROLE_FOLDER_ID.

+ Here is the call graph for this function:

◆ sortChilds()

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

Sort childs.

Parameters
int | string$a_parent_node_idparent id

Reimplemented from ilExplorerBaseGUI.

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

175 : array
176 {
177 $objDefinition = $this->obj_definition;
178
179 $parent_obj_id = ilObject::_lookupObjId((int) $a_parent_node_id);
180
181 if ($parent_obj_id > 0) {
182 $parent_type = ilObject::_lookupType($parent_obj_id);
183 } else {
184 $parent_type = "dummy";
185 $this->type_grps["dummy"] = array("root" => "dummy");
186 }
187
188 if (empty($this->type_grps[$parent_type])) {
189 $this->type_grps[$parent_type] =
190 $objDefinition::getGroupedRepositoryObjectTypes($parent_type);
191 }
192 $group = array();
193
194 foreach ($a_childs as $child) {
195 $g = $objDefinition->getGroupOfObj($child["type"]);
196 if ($g === null || $g === "") {
197 $g = $child["type"];
198 }
199 $group[$g][] = $child;
200 }
201
202 $childs = array();
203 foreach ($this->type_grps[$parent_type] as $t => $g) {
204 if (isset($group[$t])) {
205 // do we have to sort this group??
206 $sort = ilContainerSorting::_getInstance($parent_obj_id);
207 $group = $sort->sortItems($group);
208
209 // need extra session sorting here
210 if ($t === "sess") {
211 }
212
213 foreach ($group[$t] as $k => $item) {
214 $childs[] = $item;
215 }
216 }
217 }
218
219 return $childs;
220 }
static _getInstance(int $a_obj_id)
static _lookupType(int $id, bool $reference=false)

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

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilAdministrationExplorerGUI::$access
protected

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

◆ $cur_ref_id

int ilAdministrationExplorerGUI::$cur_ref_id
protected

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

◆ $db

ilDBInterface ilAdministrationExplorerGUI::$db
protected

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

◆ $obj_definition

ilObjectDefinition ilAdministrationExplorerGUI::$obj_definition
protected

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

Referenced by getNodeHref(), and sortChilds().

◆ $rbacsystem

ilRbacSystem ilAdministrationExplorerGUI::$rbacsystem
protected

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

Referenced by getChildsOfNode(), and isNodeVisible().

◆ $request

AdminGUIRequest ilAdministrationExplorerGUI::$request
protected

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

◆ $session_materials

array ilAdministrationExplorerGUI::$session_materials = array()
protected

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

◆ $settings

ilSetting ilAdministrationExplorerGUI::$settings
protected

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

◆ $top_node_id

int ilAdministrationExplorerGUI::$top_node_id
protected

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

◆ $type_grps

array ilAdministrationExplorerGUI::$type_grps = array()
protected

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

◆ $user

ilObjUser ilAdministrationExplorerGUI::$user
protected

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


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