26 $ilCtrl->saveParameter($this,
"wsp_id");
27 $ilCtrl->saveParameter($this,
"prt_id");
28 $this->node_id =
$_GET[
"wsp_id"];
29 $this->portfolio_id =
$_GET[
"prt_id"];
36 $next_class = $ilCtrl->getNextClass($this);
37 $cmd = $ilCtrl->getCmd();
39 $tpl->getStandardTemplate();
42 $ilMainMenu->setActive(
"desktop");
45 if($ilUser->getId() != ANONYMOUS_USER_ID &&
47 !in_array($next_class, array(
"ilobjbloggui",
"ilobjportfoliogui")))
49 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
50 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
53 $owner_id = $tree->lookupOwner($this->node_id);
54 $obj_id = $tree->lookupObjectId($this->node_id);
56 $lng->loadLanguageModule(
"wsp");
59 if($owner_id != $ilUser->getId())
61 $ilCtrl->setParameterByClass(
"ilpersonaldesktopgui",
"dsh", $owner_id);
62 $link = $ilCtrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"jumptoworkspace");
63 $ilLocator->addItem($lng->txt(
"wsp_tab_shared"), $link);
65 include_once
"Services/User/classes/class.ilUserUtil.php";
70 $link = $ilCtrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"jumptoworkspace");
71 $ilLocator->addItem($lng->txt(
"wsp_tab_personal"), $link);
74 $link = $access_handler->getGotoLink($this->node_id, $obj_id);
76 $tpl->setLocator($ilLocator);
82 include_once
"Modules/Blog/classes/class.ilObjBlogGUI.php";
84 $ilCtrl->forwardCommand($bgui);
88 include_once
"Modules/File/classes/class.ilObjFileGUI.php";
90 $ilCtrl->forwardCommand($fgui);
93 case "ilobjtestverificationgui":
94 include_once
"Modules/Test/classes/class.ilObjTestVerificationGUI.php";
96 $ilCtrl->forwardCommand($tgui);
99 case "ilobjexerciseverificationgui":
100 include_once
"Modules/Exercise/classes/class.ilObjExerciseVerificationGUI.php";
102 $ilCtrl->forwardCommand($egui);
105 case "ilobjlinkresourcegui":
106 include_once
"Modules/WebResource/classes/class.ilObjLinkResourceGUI.php";
108 $ilCtrl->forwardCommand($lgui);
111 case "ilobjportfoliogui":
112 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioGUI.php";
114 $ilCtrl->forwardCommand($pgui);
130 if(!$this->node_id && !$this->portfolio_id)
132 exit(
"invalid call");
138 if(!self::hasAccess($this->node_id))
140 exit(
"no permission");
146 if(!self::hasAccess($this->portfolio_id,
true))
148 exit(
"no permission");
154 public static function hasAccess($a_node_id, $a_is_portfolio =
false)
159 if($ilUser->getId() != ANONYMOUS_USER_ID)
163 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
164 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
170 include_once
"Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php";
180 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
184 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
190 if (!$ilSetting->get(
'user_portfolios'))
196 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
198 if(!$prtf->isOnline())
203 include_once
"Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php";
218 ilUtil::redirect(
"ilias.php?baseClass=ilSharedResourceGUI&cmd=passwordForm&wsp_id=".$a_node_id);
222 ilUtil::redirect(
"ilias.php?baseClass=ilSharedResourceGUI&cmd=passwordForm&prt_id=".$a_node_id);
231 global
$ilCtrl, $objDefinition;
235 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
237 if(!$object_data[
"obj_id"])
239 exit(
"invalid object");
246 exit(
"invalid object");
248 $object_data[
"obj_id"] = $a_node_id;
249 $object_data[
"type"] =
"prtf";
252 $class = $objDefinition->getClassName($object_data[
"type"]);
253 $gui =
"ilobj".$class.
"gui";
255 switch($object_data[
"type"])
258 $ilCtrl->setParameterByClass($gui,
"wsp_id", $a_node_id);
259 $ilCtrl->setParameterByClass($gui,
"gtp", (
int)
$_GET[
"gtp"]);
260 $ilCtrl->redirectByClass($gui,
"preview");
266 $ilCtrl->setParameterByClass($gui,
"wsp_id", $a_node_id);
267 $ilCtrl->redirectByClass($gui,
"deliver");
271 $ilCtrl->setParameterByClass($gui,
"wsp_id", $a_node_id);
272 $ilCtrl->redirectByClass($gui);
275 $ilCtrl->setParameterByClass($gui,
"prt_id", $a_node_id);
276 $ilCtrl->setParameterByClass($gui,
"gtp", (
int)$_GET[
"gtp"]);
277 if($_GET[
"back_url"])
279 $ilCtrl->setParameterByClass($gui,
"back_url", rawurlencode($_GET[
"back_url"]));
281 $ilCtrl->redirectByClass($gui,
"preview");
284 exit(
"invalid object type");
292 $lng->loadLanguageModule(
"wsp");
294 $tpl->setTitle($lng->txt(
"wsp_password_protected_resource"));
295 $tpl->setDescription($lng->txt(
"wsp_password_protected_resource_info"));
302 $tpl->setContent($form->getHTML());
311 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
319 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
321 $form->setFormAction($ilCtrl->getFormAction($this,
"checkPassword"));
322 $form->setTitle($lng->txt(
"wsp_password_for").
": ".$object_data[
"title"]);
326 $password->setRequired(
true);
327 $form->addItem($password);
329 $form->addCommandButton(
"checkPassword", $lng->txt(
"submit"));
331 if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
333 $ilTabs->setBackTarget($lng->txt(
"back"), $ilCtrl->getLinkTarget($this,
"cancelPassword"));
334 $form->addCommandButton(
"cancelPassword", $lng->txt(
"cancel"));
344 if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
348 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
349 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
352 ilUtil::redirect(
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".$owner);
356 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
358 $owner = $prtf->getOwner();
359 ilUtil::redirect(
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio&dsh=".$owner);
368 $lng->loadLanguageModule(
"wsp");
371 if($form->checkInput())
373 $input = md5($form->getInput(
"password"));
376 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
381 include_once
"Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php";
384 if($input == $password)
399 $item = $form->getItemByPostVar(
"password");
400 $item->setAlert($lng->txt(
"wsp_invalid_password"));
405 $form->setValuesByPost();