ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilWorkspaceExplorerGUI Class Reference

Explorer for selecting a personal workspace item. More...

+ Inheritance diagram for ilWorkspaceExplorerGUI:
+ Collaboration diagram for ilWorkspaceExplorerGUI:

Public Member Functions

 __construct (int $a_user_id, $a_parent_obj, string $a_parent_cmd, $a_select_gui, string $a_select_cmd, string $a_select_par="sel_wsp_obj")
 ilWorkspaceExplorerGUI constructor. More...
 
 setLinkToNodeClass (bool $a_val)
 
 getLinkToNodeClass ()
 
 setActivateHighlighting (bool $a_val)
 
 getActivateHighlighting ()
 
 setSelectableTypes (array $a_val)
 
 getSelectableTypes ()
 
 setCustomLinkTarget (string $a_val)
 
 getCustomLinkTarget ()
 
 getNodeHref ($a_node)
 @inheritcoc More...
 
 getNodeContent ($a_node)
 @inheritcoc More...
 
 isNodeClickable ($a_node)
 @inheritcoc More...
 
 getNodeIcon ($a_node)
 @inheritcoc More...
 
 isNodeHighlighted ($a_node)
 @inheritcoc 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

 isNodeSelectable ($a_node)
 @inheritcoc 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

ilWorkspaceAccessHandler $access_handler
 
bool $link_to_node_class = false
 
string $custom_link_target = ""
 
object string null $select_gui = null
 
string $select_cmd = ""
 
string $select_par = ""
 
array $selectable_types = array()
 
bool $activate_highlighting = false
 
StandardGUIRequest $request
 
- 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

Explorer for selecting a personal workspace item.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilWorkspaceExplorerGUI::__construct ( int  $a_user_id,
  $a_parent_obj,
string  $a_parent_cmd,
  $a_select_gui,
string  $a_select_cmd,
string  $a_select_par = "sel_wsp_obj" 
)

ilWorkspaceExplorerGUI constructor.

Parameters
object | array$a_parent_obj
string | object$a_select_gui

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

50 {
51 global $DIC;
52
53 $this->ctrl = $DIC->ctrl();
54 $this->lng = $DIC->language();
55
56 $this->select_gui = (is_object($a_select_gui))
57 ? strtolower(get_class($a_select_gui))
58 : $a_select_gui;
59 $this->select_cmd = $a_select_cmd;
60 $this->select_par = $a_select_par;
61
62 $this->request = new StandardGUIRequest(
63 $DIC->http(),
64 $DIC->refinery()
65 );
66
67 $this->tree = new ilWorkspaceTree($a_user_id);
68 $this->root_id = $this->tree->readRootId();
69 $this->access_handler = new ilWorkspaceAccessHandler($this->tree);
70
71 parent::__construct("wsp_sel", $a_parent_obj, $a_parent_cmd, $this->tree);
72 $this->setSkipRootNode(false);
73 $this->setAjax(true);
74 $this->setPathOpen($this->root_id);
75
76 $this->setTypeWhiteList(array("wsrt", "wfld"));
77 }
setPathOpen($a_id)
Set node path to be opened.
setTypeWhiteList(array $a_val)
Set type white list.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getActivateHighlighting()

ilWorkspaceExplorerGUI::getActivateHighlighting ( )

Definition at line 94 of file class.ilWorkspaceExplorerGUI.php.

94 : bool
95 {
97 }

References $activate_highlighting.

Referenced by isNodeHighlighted().

+ Here is the caller graph for this function:

◆ getCustomLinkTarget()

ilWorkspaceExplorerGUI::getCustomLinkTarget ( )

Definition at line 114 of file class.ilWorkspaceExplorerGUI.php.

114 : string
115 {
117 }

References $custom_link_target.

Referenced by getNodeHref().

+ Here is the caller graph for this function:

◆ getLinkToNodeClass()

ilWorkspaceExplorerGUI::getLinkToNodeClass ( )

Definition at line 84 of file class.ilWorkspaceExplorerGUI.php.

84 : bool
85 {
87 }

References $link_to_node_class.

Referenced by getNodeHref().

+ Here is the caller graph for this function:

◆ getNodeContent()

ilWorkspaceExplorerGUI::getNodeContent (   $a_node)

@inheritcoc

Reimplemented from ilExplorerBaseGUI.

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

168 : string
169 {
171
172 if ($a_node["child"] == $this->tree->getRootId()) {
173 return $lng->txt("personal_resources");
174 }
175
176 return $a_node["title"];
177 }
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...

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

+ Here is the call graph for this function:

◆ getNodeHref()

ilWorkspaceExplorerGUI::getNodeHref (   $a_node)

@inheritcoc

Reimplemented from ilExplorerBaseGUI.

Definition at line 122 of file class.ilWorkspaceExplorerGUI.php.

122 : string
123 {
124 if ($this->select_postvar != "") {
125 return "";
126 }
127 if ($this->getCustomLinkTarget() != "") {
128 return $this->getCustomLinkTarget() . "&" . $this->select_par . "=" . $a_node["child"];
129 }
130
131 $ilCtrl = $this->ctrl;
132
133 $target_class = $this->select_gui;
134 if (is_object($this->parent_obj)) {
135 $target_path = [get_class($this->parent_obj)];
136 } else {
137 $target_path = $this->parent_obj;
138 }
139 $target_path = $target_path + [$target_class];
140
141 if ($this->getLinkToNodeClass()) {
142 switch ($a_node["type"]) {
143 case "wsrt":
144 $target_class = "ilobjworkspacerootfoldergui";
145 $target_path = ["ilDashboardGUI", "ilPersonalWorkspaceGUI", "ilobjworkspacerootfoldergui"];
146 break;
147 case "wfld":
148 $target_class = "ilobjworkspacefoldergui";
149 break;
150 }
151 }
152
153 /*var_dump($target_path);
154 var_dump($target_class);
155 var_dump($this->select_par);
156 var_dump($a_node);*/
157 $ilCtrl->setParameterByClass($target_class, $this->select_par, $a_node["child"]);
158 $ret = $ilCtrl->getLinkTargetByClass($target_path, $this->select_cmd);
159 /*var_dump($ret);
160 exit;*/
161 $ilCtrl->setParameterByClass($target_class, $this->select_par, $this->request->getSelectPar());
162 return $ret;
163 }

References ilExplorerBaseGUI\$ctrl, ilExplorerBaseGUI\$parent_obj, $select_gui, getCustomLinkTarget(), and getLinkToNodeClass().

+ Here is the call graph for this function:

◆ getNodeIcon()

ilWorkspaceExplorerGUI::getNodeIcon (   $a_node)

@inheritcoc

Reimplemented from ilExplorerBaseGUI.

Definition at line 204 of file class.ilWorkspaceExplorerGUI.php.

204 : string
205 {
206 $t = $a_node["type"];
207 if (in_array($t, array("sktr"))) {
208 return ilUtil::getImagePath("standard/icon_skll.svg");
209 }
210 return ilUtil::getImagePath("standard/icon_" . $t . ".svg");
211 }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References ilUtil\getImagePath().

+ Here is the call graph for this function:

◆ getSelectableTypes()

ilWorkspaceExplorerGUI::getSelectableTypes ( )

Definition at line 104 of file class.ilWorkspaceExplorerGUI.php.

104 : array
105 {
107 }

References $selectable_types.

Referenced by isNodeClickable(), and isNodeSelectable().

+ Here is the caller graph for this function:

◆ isNodeClickable()

ilWorkspaceExplorerGUI::isNodeClickable (   $a_node)

@inheritcoc

Reimplemented from ilExplorerBaseGUI.

Definition at line 182 of file class.ilWorkspaceExplorerGUI.php.

182 : bool
183 {
184 if (in_array($a_node["type"], $this->getSelectableTypes())) {
185 return true;
186 }
187 return false;
188 }

References getSelectableTypes().

+ Here is the call graph for this function:

◆ isNodeHighlighted()

ilWorkspaceExplorerGUI::isNodeHighlighted (   $a_node)

@inheritcoc

Reimplemented from ilExplorerBaseGUI.

Definition at line 216 of file class.ilWorkspaceExplorerGUI.php.

216 : bool
217 {
218 $wsp_id = $this->request->getWspId();
219 if ($this->getActivateHighlighting() &&
220 ((int) $a_node["child"] == $wsp_id || $wsp_id == 0 && $a_node["child"] == $this->getRootId())) {
221 return true;
222 }
223 return false;
224 }

References getActivateHighlighting(), and ilTreeExplorerGUI\getRootId().

+ Here is the call graph for this function:

◆ isNodeSelectable()

ilWorkspaceExplorerGUI::isNodeSelectable (   $a_node)
protected

@inheritcoc

Reimplemented from ilExplorerBaseGUI.

Definition at line 193 of file class.ilWorkspaceExplorerGUI.php.

193 : bool
194 {
195 if (in_array($a_node["type"], $this->getSelectableTypes())) {
196 return true;
197 }
198 return false;
199 }

References getSelectableTypes().

+ Here is the call graph for this function:

◆ setActivateHighlighting()

ilWorkspaceExplorerGUI::setActivateHighlighting ( bool  $a_val)

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

89 : void
90 {
91 $this->activate_highlighting = $a_val;
92 }

◆ setCustomLinkTarget()

ilWorkspaceExplorerGUI::setCustomLinkTarget ( string  $a_val)

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

109 : void
110 {
111 $this->custom_link_target = $a_val;
112 }

◆ setLinkToNodeClass()

ilWorkspaceExplorerGUI::setLinkToNodeClass ( bool  $a_val)

Definition at line 79 of file class.ilWorkspaceExplorerGUI.php.

79 : void
80 {
81 $this->link_to_node_class = $a_val;
82 }

◆ setSelectableTypes()

ilWorkspaceExplorerGUI::setSelectableTypes ( array  $a_val)

Definition at line 99 of file class.ilWorkspaceExplorerGUI.php.

99 : void
100 {
101 $this->selectable_types = $a_val;
102 }

Field Documentation

◆ $access_handler

ilWorkspaceAccessHandler ilWorkspaceExplorerGUI::$access_handler
protected

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

◆ $activate_highlighting

bool ilWorkspaceExplorerGUI::$activate_highlighting = false
protected

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

Referenced by getActivateHighlighting().

◆ $custom_link_target

string ilWorkspaceExplorerGUI::$custom_link_target = ""
protected

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

Referenced by getCustomLinkTarget().

◆ $link_to_node_class

bool ilWorkspaceExplorerGUI::$link_to_node_class = false
protected

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

Referenced by getLinkToNodeClass().

◆ $request

StandardGUIRequest ilWorkspaceExplorerGUI::$request
protected

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

◆ $select_cmd

string ilWorkspaceExplorerGUI::$select_cmd = ""
protected

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

◆ $select_gui

object string null ilWorkspaceExplorerGUI::$select_gui = null
protected

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

Referenced by getNodeHref().

◆ $select_par

string ilWorkspaceExplorerGUI::$select_par = ""
protected

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

◆ $selectable_types

array ilWorkspaceExplorerGUI::$selectable_types = array()
protected

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

Referenced by getSelectableTypes().


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