ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilOrgUnitExplorerGUI Class Reference

Class ilOrgUnitExplorerGUI. More...

+ Inheritance diagram for ilOrgUnitExplorerGUI:
+ Collaboration diagram for ilOrgUnitExplorerGUI:

Public Member Functions

 __construct ($a_expl_id, $a_parent_obj, $a_parent_cmd, $a_tree, \ilAccessHandler $access=null)
 
 getNodeContent ($a_node)
 Get content of a node. More...
 
 getRootNode ()
 
 getNodeIcon ($a_node)
 Get node icon. More...
 
 getNodeHref ($a_node)
 
 isNodeClickable ($a_node)
 
 isNodeSelectable ($a_node)
 
 getChildsOfNode ($a_parent_node_id)
 
- 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
 build (Node\Factory $factory, $record, $environment=null)
 Build and return a Node. More...
 

Protected Member Functions

 getLinkTarget ()
 
 getPluginLinkTarget ()
 
 filterChildrenByPermission (array $children)
 
- 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

const ORGU = "orgu"
 
array $stay_with_command = array('', 'render', 'view', 'infoScreen', 'showStaff', 'performPaste', 'cut')
 
ilTree $tree = null
 
ilAccessHandler $access
 
ILIAS HTTP Wrapper RequestWrapper $http_post
 
ILIAS HTTP Wrapper RequestWrapper $http_query
 
ILIAS Refinery Factory $refinery
 
- 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 Member Functions

 getNodeArrayRepresentation ($a_node)
 

Private Attributes

ilSetting $settings
 

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 = "./Services/UIComponent/Explorer2/js/Explorer2.js"
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitExplorerGUI::__construct (   $a_expl_id,
  $a_parent_obj,
  $a_parent_cmd,
  $a_tree,
\ilAccessHandler  $access = null 
)
Parameters
$a_expl_id
$a_parent_obj
$a_parent_cmd
$a_tree
$access

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\refinery(), ilExplorerBaseGUI\setAjax(), ILIAS\Repository\settings(), and ilTreeExplorerGUI\setTypeWhiteList().

46  {
47  global $DIC;
48  parent::__construct($a_expl_id, $a_parent_obj, $a_parent_cmd, $a_tree);
49  $this->setAjax(true);
50  $this->setTypeWhiteList(array(self::ORGU));
51  $this->tree->initLangCode();
52  $this->access = $DIC->access();
53  $this->settings = $DIC->settings();
54  $this->http_post = $DIC->http()->wrapper()->post();
55  $this->http_query= $DIC->http()->wrapper()->query();
56  $this->refinery = $DIC["refinery"];
57  }
setTypeWhiteList(array $a_val)
Set type white list.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ filterChildrenByPermission()

ilOrgUnitExplorerGUI::filterChildrenByPermission ( array  $children)
protected

Definition at line 230 of file class.ilOrgUnitExplorerGUI.php.

References ILIAS\Repository\access().

Referenced by getChildsOfNode().

230  : array
231  {
232  return array_filter(
233  $children,
234  function ($child) {
235  return $this->access->checkAccess("visible", "", $child["ref_id"]);
236  }
237  );
238  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getChildsOfNode()

ilOrgUnitExplorerGUI::getChildsOfNode (   $a_parent_node_id)

Definition at line 224 of file class.ilOrgUnitExplorerGUI.php.

References filterChildrenByPermission().

224  : array
225  {
226  $children = parent::getChildsOfNode($a_parent_node_id);
227  return $this->filterChildrenByPermission($children);
228  }
filterChildrenByPermission(array $children)
+ Here is the call graph for this function:

◆ getLinkTarget()

ilOrgUnitExplorerGUI::getLinkTarget ( )
protected

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

References $stay_with_command, and ILIAS\Repository\ctrl().

Referenced by getNodeHref().

131  : string
132  {
133  if ($this->ctrl->getCmdClass() === strtolower(ilObjOrgUnitGUI::class) && in_array(
134  $this->ctrl->getCmd(),
136  true
137  )) {
138  return $this->ctrl->getLinkTargetByClass(
139  array(ilAdministrationGUI::class, $this->ctrl->getCmdClass()),
140  $this->ctrl->getCmd()
141  );
142  }
143 
144  return $this->ctrl->getLinkTargetByClass(array(ilAdministrationGUI::class, ilObjOrgUnitGUI::class), 'view');
145  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNodeArrayRepresentation()

ilOrgUnitExplorerGUI::getNodeArrayRepresentation (   $a_node)
private
Parameters
$a_node
Returns
array

Definition at line 215 of file class.ilOrgUnitExplorerGUI.php.

Referenced by getNodeContent(), getNodeHref(), getNodeIcon(), isNodeClickable(), and isNodeSelectable().

215  : array
216  {
217  if (is_object($a_node)) {
218  return (array) $a_node;
219  }
220 
221  return $a_node;
222  }
+ Here is the caller graph for this function:

◆ getNodeContent()

ilOrgUnitExplorerGUI::getNodeContent (   $a_node)

Get content of a node.

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

Definition at line 64 of file class.ilOrgUnitExplorerGUI.php.

References $_GET, getNodeArrayRepresentation(), ILIAS\Repository\lng(), and ilUtil\secureString().

64  : string
65  {
66  $node = $this->getNodeArrayRepresentation($a_node);
67 
68  if ($node['title'] === '__OrgUnitAdministration') {
69  $node['title'] = $this->lng->txt('objs_orgu');
70  }
71  if ((int) $node['child'] === (int) $_GET['ref_id']) {
72  return "<span class='ilExp2NodeContent ilHighlighted'>" . $node['title'] . '</span>';
73  }
74 
75  return ilUtil::secureString($node['title']);
76  }
static secureString(string $a_str, bool $a_strip_html=true, string $a_allow="")
$_GET['client_id']
Definition: saml1-acs.php:21
+ Here is the call graph for this function:

◆ getNodeHref()

ilOrgUnitExplorerGUI::getNodeHref (   $a_node)
Parameters
array | object$a_node
Exceptions
ilCtrlException

Definition at line 109 of file class.ilOrgUnitExplorerGUI.php.

References ILIAS\Repository\ctrl(), getLinkTarget(), getNodeArrayRepresentation(), and getPluginLinkTarget().

109  : string
110  {
111  $node = $this->getNodeArrayRepresentation($a_node);
112 
113  if ($this->select_postvar) {
114  return '#';
115  }
116 
117  if ($this->ctrl->getCmd() === 'performPaste') {
118  $this->ctrl->setParameterByClass(ilObjOrgUnitGUI::class, 'target_node', $node['child']);
119  }
120  $array = $this->ctrl->getParameterArrayByClass(ilObjOrgUnitGUI::class);
121  $temp = $array['ref_id'];
122 
123  $this->ctrl->setParameterByClass(ilObjOrgUnitGUI::class, 'ref_id', $node['child']);
124  $this->ctrl->setParameterByClass(ilObjPluginDispatchGUI::class, 'ref_id', $node['child']);
125 
126  $link_target = ($node['type'] === self::ORGU) ? $this->getLinkTarget() : $this->getPluginLinkTarget();
127  $this->ctrl->setParameterByClass(ilObjOrgUnitGUI::class, 'ref_id', $temp);
128  return $link_target;
129  }
+ Here is the call graph for this function:

◆ getNodeIcon()

ilOrgUnitExplorerGUI::getNodeIcon (   $a_node)

Get node icon.

Parameters
array | object$a_nodeReturn custom icon of OrgUnit type if existing
Returns
string

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

References ilObject\_getIcon(), ilObject\_lookupObjId(), ilObjOrgUnit\getIconsCache(), getNodeArrayRepresentation(), and ILIAS\Repository\settings().

89  : string
90  {
91  $node = $this->getNodeArrayRepresentation($a_node);
92 
93  $obj_id = 0;
94  if ($this->settings->get('custom_icons')) {
95  $icons_cache = ilObjOrgUnit::getIconsCache();
96  $obj_id = ilObject::_lookupObjId($node["child"]);
97  if (isset($icons_cache[$obj_id])) {
98  return $icons_cache[$obj_id];
99  }
100  }
101 
102  return ilObject::_getIcon($obj_id, "tiny", $node["type"]);
103  }
static getIconsCache()
Returns an array that maps from OrgUnit object IDs to its icon defined by the assigned OrgUnit type...
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupObjId(int $ref_id)
+ Here is the call graph for this function:

◆ getPluginLinkTarget()

ilOrgUnitExplorerGUI::getPluginLinkTarget ( )
protected
Exceptions
ilCtrlException

Definition at line 150 of file class.ilOrgUnitExplorerGUI.php.

References ILIAS\Repository\ctrl().

Referenced by getNodeHref().

150  : string
151  {
152  return $this->ctrl->getLinkTargetByClass(ilObjPluginDispatchGUI::class, 'forward');
153  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRootNode()

ilOrgUnitExplorerGUI::getRootNode ( )

Definition at line 78 of file class.ilOrgUnitExplorerGUI.php.

References ilObjOrgUnit\getRootOrgRefId(), and ilTreeExplorerGUI\getTree().

78  : array
79  {
80  return $this->getTree()->getNodeData(ilObjOrgUnit::getRootOrgRefId());
81  }
static getRootOrgRefId()
+ Here is the call graph for this function:

◆ isNodeClickable()

ilOrgUnitExplorerGUI::isNodeClickable (   $a_node)
Parameters
object | array$a_node
Returns
bool

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

References ILIAS\Repository\access(), and getNodeArrayRepresentation().

159  : bool
160  {
161  $node = $this->getNodeArrayRepresentation($a_node);
162 
163  $node = $this->getNodeArrayRepresentation($a_node);
164 
165  if ($this->access->checkAccess('read', '', $node['ref_id'])) {
166  return true;
167  }
168 
169  return false;
170  }
+ Here is the call graph for this function:

◆ isNodeSelectable()

ilOrgUnitExplorerGUI::isNodeSelectable (   $a_node)
Parameters
$a_node
Returns
bool

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

References $refinery, ilExplorerBaseGUI\$selected_nodes, and getNodeArrayRepresentation().

177  : bool
178  {
179  $r = $this->refinery;
180  if ($this->http_post->has("id")) {
181  // Node selected via multiselect in "manage".
182  $selected_nodes = $this->http_post->retrieve(
183  "id",
184  $r->kindlyTo()->listOf($r->kindlyTo()->int()),
185  );
186  } elseif ($this->http_query->has("item_ref_id")) {
187  // Node selected via "move"-action.
188  $selected_nodes = $this->http_query->retrieve(
189  "item_ref_id",
190  $r->kindlyTo()->listOf($r->kindlyTo()->int()),
191  );
192  } else {
193  // No node selected.
194  return true;
195  }
196 
197  $node = $this->getNodeArrayRepresentation($a_node);
198  foreach ($selected_nodes as $sn) {
199  // Can't insert into itself.
200  if ($node["child"] == $sn) {
201  return false;
202  }
203  // Can't insert below itself.
204  if ($this->tree->isGrandChild($sn, $node["child"])) {
205  return false;
206  }
207  }
208  return true;
209  }
ILIAS Refinery Factory $refinery
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilOrgUnitExplorerGUI::$access
protected

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

◆ $http_post

ILIAS HTTP Wrapper RequestWrapper ilOrgUnitExplorerGUI::$http_post
protected

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

◆ $http_query

ILIAS HTTP Wrapper RequestWrapper ilOrgUnitExplorerGUI::$http_query
protected

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

◆ $refinery

ILIAS Refinery Factory ilOrgUnitExplorerGUI::$refinery
protected

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

Referenced by isNodeSelectable().

◆ $settings

ilSetting ilOrgUnitExplorerGUI::$settings
private

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

◆ $stay_with_command

array ilOrgUnitExplorerGUI::$stay_with_command = array('', 'render', 'view', 'infoScreen', 'showStaff', 'performPaste', 'cut')
protected

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

Referenced by getLinkTarget().

◆ $tree

ilTree ilOrgUnitExplorerGUI::$tree = null
protected

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

◆ ORGU

const ilOrgUnitExplorerGUI::ORGU = "orgu"
protected

Definition at line 29 of file class.ilOrgUnitExplorerGUI.php.


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