ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

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.

86  : void
87  {
88  $ilCtrl = $this->ctrl;
89  $objDefinition = $this->obj_definition;
90  $tpl = $this->tpl;
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  $next_class = "ilObj" . $objDefinition->getClassName($node["type"]) . "GUI";
127  $ilCtrl->redirectByClass($next_class, $ilCtrl->getCmd());
128  }
129 
130  // if we do this here the object can still change the breadcrumb
131  $this->renderLocator();
132 
133  // current node
134  $class_path = $ilCtrl->lookupClassPath($next_class);
135  $class_name = $ilCtrl->getClassForClasspath($class_path);
136  if ($this->std_request->getNewType()) {
137  $gui = new $class_name(0, ilObject2GUI::WORKSPACE_NODE_ID, $this->node_id);
138  $gui->setCreationMode();
139  } else {
140  $gui = new $class_name($this->node_id, ilObject2GUI::WORKSPACE_NODE_ID, false);
141  }
142  $ilCtrl->forwardCommand($gui);
143 
144  //$this->renderBack();
145 
146  $tpl->setLocator();
147  }
renderLocator()
Build locator for current node.
setLocator()
Insert locator.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ initTree()

ilPersonalWorkspaceGUI::initTree ( )
protected

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

References $user, and $user_id.

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

◆ renderBack()

ilPersonalWorkspaceGUI::renderBack ( )
protected

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

References $ctrl, $lng, $tabs, $user, and ilLanguage\txt().

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

◆ renderLocator()

ilPersonalWorkspaceGUI::renderLocator ( )
protected

Build locator for current node.

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

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

Referenced by executeCommand().

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