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

GUI class for personal workspace. More...

+ Collaboration diagram for ilPersonalWorkspaceGUI:

Public Member Functions

 executeCommand ()
 

Protected Member Functions

 initTree ()
 
 renderBack ()
 
 renderLocator ()
 Build locator for current node. More...
 

Protected Attributes

ilSetting $settings
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilHelpGUI $help
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilObjUser $user
 
ilTabsGUI $tabs
 
ilLocatorGUI $locator
 
ilTree $tree
 
int $node_id
 
ContextServices $tool_context
 
StandardGUIRequest $std_request
 

Detailed Description

Member Function Documentation

◆ executeCommand()

ilPersonalWorkspaceGUI::executeCommand ( )

Definition at line 86 of file class.ilPersonalWorkspaceGUI.php.

86 : void
87 {
88 $ilCtrl = $this->ctrl;
89 $objDefinition = $this->obj_definition;
91
92 if ($this->settings->get("disable_personal_workspace")) {
93 throw new ilException($this->lng->txt("no_permission"));
94 }
95
96 $ilCtrl->setReturn($this, "render");
97
98 if (!in_array($ilCtrl->getCmd(), ["shareFilter"]) &&
99 !in_array(strtolower($ilCtrl->getCmdClass()), ["ilobjectownershipmanagementgui"])
100 ) {
101 $this->tool_context->current()->addAdditionalData(ilWorkspaceGSToolProvider::SHOW_WS_TREE, true);
102 }
103
104 // new type
105 if ($this->std_request->getNewType()) {
106 $class_name = $objDefinition->getClassName(
107 $this->std_request->getNewType()
108 );
109
110 // Only set the fixed cmdClass if the next class is different to
111 // the GUI class of the new object.
112 // An example:
113 // ilObjLinkResourceGUI tries to forward to ilLinkInputGUI (adding an internal link
114 // when creating a link resource)
115 // Without this fix, the cmdClass ilObjectCopyGUI would never be reached
116 if (strtolower($ilCtrl->getNextClass($this)) !== strtolower("ilObj" . $class_name . "GUI")) {
117 $this->ctrl->setParameterByClass("ilObj" . $class_name . "GUI", "new_type", $this->std_request->getNewType());
118 $ilCtrl->redirectByClass("ilObj" . $class_name . "GUI", $ilCtrl->getCmd());
119 }
120 }
121
122 // root node
123 $next_class = $ilCtrl->getNextClass();
124 if (!$next_class) {
125 $node = $this->tree->getNodeData($this->node_id);
126 if (isset($node["type"])) {
127 $next_class = "ilObj" . $objDefinition->getClassName($node["type"]) . "GUI";
128 } else {
129 $next_class = "ilObjWorkspaceRootFolderGUI";
130 }
131 $ilCtrl->redirectByClass($next_class, $ilCtrl->getCmd());
132 }
133
134 // if we do this here the object can still change the breadcrumb
135 $this->renderLocator();
136
137 // current node
138 $class_path = $ilCtrl->lookupClassPath($next_class);
139 $class_name = $ilCtrl->getClassForClasspath($class_path);
140 if ($this->std_request->getNewType()) {
141 $gui = new $class_name(0, ilObject2GUI::WORKSPACE_NODE_ID, $this->node_id);
142 $gui->setCreationMode();
143 } else {
144 $gui = new $class_name($this->node_id, ilObject2GUI::WORKSPACE_NODE_ID, false);
145 }
146 $ilCtrl->forwardCommand($gui);
147
148 //$this->renderBack();
149
150 $tpl->setLocator();
151 }
Base class for ILIAS Exception handling.
renderLocator()
Build locator for current node.
ilGlobalTemplateInterface $tpl
setLocator()
Insert locator.

References $ctrl, $obj_definition, $tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), renderLocator(), ILIAS\UICore\GlobalTemplate\setLocator(), ILIAS\Repository\settings(), ilWorkspaceGSToolProvider\SHOW_WS_TREE, and ilObject2GUI\WORKSPACE_NODE_ID.

+ Here is the call graph for this function:

◆ initTree()

ilPersonalWorkspaceGUI::initTree ( )
protected

Definition at line 153 of file class.ilPersonalWorkspaceGUI.php.

153 : void
154 {
155 $ilUser = $this->user;
156
157 $user_id = $ilUser->getId();
158
159 $this->tree = new ilWorkspaceTree($user_id);
160 if (!$this->tree->getRootId()) {
161 $this->tree->createTreeForUser($user_id);
162 }
163 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $user, and $user_id.

◆ renderBack()

ilPersonalWorkspaceGUI::renderBack ( )
protected

Definition at line 165 of file class.ilPersonalWorkspaceGUI.php.

165 : void
166 {
168 $ilTabs = $this->tabs;
169 $ilCtrl = $this->ctrl;
170 $ilUser = $this->user;
171
172 $root = $this->tree->getNodeData($this->node_id);
173 if ($root["type"] != "wfld" && $root["type"] != "wsrt") {
174 // do not override existing back targets, e.g. public user profile gui
175 if (!$ilTabs->back_target) {
176 $owner = $this->tree->lookupOwner($this->node_id);
177 // workspace
178 if ($owner == $ilUser->getId()) {
179 $parent = $this->tree->getParentNodeData($this->node_id);
180 if ($parent["wsp_id"]) {
181 if ($parent["type"] == "wsrt") {
182 $class = "ilobjworkspacerootfoldergui";
183 } else {
184 $class = "ilobjworkspacefoldergui";
185 }
186 $ilCtrl->setParameterByClass($class, "wsp_id", $parent["wsp_id"]);
187 $ilTabs->setBackTarget(
188 $lng->txt("back"),
189 $ilCtrl->getLinkTargetByClass($class, "")
190 );
191 }
192 }
193 // "shared by others"
194 else {
195 $ilCtrl->setParameterByClass("ilobjworkspacerootfoldergui", "wsp_id", "");
196 $ilCtrl->setParameterByClass("ilobjworkspacerootfoldergui", "user", $owner);
197 $ilTabs->setBackTarget(
198 $lng->txt("back"),
199 $ilCtrl->getLinkTargetByClass("ilobjworkspacerootfoldergui", "share")
200 );
201 }
202 }
203 }
204 }
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 $ctrl, $lng, $tabs, $user, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ renderLocator()

ilPersonalWorkspaceGUI::renderLocator ( )
protected

Build locator for current node.

Definition at line 209 of file class.ilPersonalWorkspaceGUI.php.

209 : void
210 {
212 $ilCtrl = $this->ctrl;
213 $ilLocator = $this->locator;
214 $objDefinition = $this->obj_definition;
215
216 $ilLocator->clearItems();
217
218 // we have no path if shared item
219 $path = $this->tree->getPathFull($this->node_id);
220 if ($path) {
221 foreach ($path as $node) {
222 $obj_class = "ilObj" . $objDefinition->getClassName($node["type"]) . "GUI";
223
224 $ilCtrl->setParameter($this, "wsp_id", $node["wsp_id"]);
225
226 switch ($node["type"]) {
227 case "wsrt":
228 $ilLocator->addItem($lng->txt("mm_personal_and_shared_r"), $ilCtrl->getLinkTargetByClass($obj_class, "render"));
229 break;
230
231 case "blog":
232 case $objDefinition->isContainer($node["type"]):
233 $ilLocator->addItem($node["title"], $ilCtrl->getLinkTargetByClass($obj_class, "render"));
234 break;
235
236 default:
237 $ilLocator->addItem($node["title"], $ilCtrl->getLinkTargetByClass($obj_class, "edit"));
238 break;
239 }
240 }
241 }
242
243 $ilCtrl->setParameter($this, "wsp_id", $this->node_id);
244 }
$path
Definition: ltiservices.php:30

References $ctrl, $lng, $locator, $obj_definition, $path, and ilLanguage\txt().

Referenced by executeCommand().

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

Field Documentation

◆ $ctrl

ilCtrl ilPersonalWorkspaceGUI::$ctrl
protected

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

Referenced by executeCommand(), renderBack(), and renderLocator().

◆ $help

ilHelpGUI ilPersonalWorkspaceGUI::$help
protected

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

◆ $lng

ilLanguage ilPersonalWorkspaceGUI::$lng
protected

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

Referenced by renderBack(), and renderLocator().

◆ $locator

ilLocatorGUI ilPersonalWorkspaceGUI::$locator
protected

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

Referenced by renderLocator().

◆ $node_id

int ilPersonalWorkspaceGUI::$node_id
protected

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

◆ $obj_definition

ilObjectDefinition ilPersonalWorkspaceGUI::$obj_definition
protected

Definition at line 41 of file class.ilPersonalWorkspaceGUI.php.

Referenced by executeCommand(), and renderLocator().

◆ $settings

ilSetting ilPersonalWorkspaceGUI::$settings
protected

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

◆ $std_request

StandardGUIRequest ilPersonalWorkspaceGUI::$std_request
protected

Definition at line 49 of file class.ilPersonalWorkspaceGUI.php.

◆ $tabs

ilTabsGUI ilPersonalWorkspaceGUI::$tabs
protected

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

Referenced by renderBack().

◆ $tool_context

ContextServices ilPersonalWorkspaceGUI::$tool_context
protected

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

◆ $tpl

ilGlobalTemplateInterface ilPersonalWorkspaceGUI::$tpl
protected

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

Referenced by executeCommand().

◆ $tree

ilTree ilPersonalWorkspaceGUI::$tree
protected

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

◆ $user

ilObjUser ilPersonalWorkspaceGUI::$user
protected

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

Referenced by initTree(), and renderBack().


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