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($gui);
88 include_once
"Modules/File/classes/class.ilObjFileGUI.php";
90 $ilCtrl->forwardCommand($gui);
93 case "ilobjtestverificationgui":
94 include_once
"Modules/Test/classes/class.ilObjTestVerificationGUI.php";
96 $ilCtrl->forwardCommand($gui);
99 case "ilobjexerciseverificationgui":
100 include_once
"Modules/Exercise/classes/class.ilObjExerciseVerificationGUI.php";
102 $ilCtrl->forwardCommand($gui);
105 case "ilobjlinkresourcegui":
106 include_once
"Modules/WebResource/classes/class.ilObjLinkResourceGUI.php";
108 $ilCtrl->forwardCommand($gui);
111 case "ilobjportfoliogui":
112 include_once
"Services/Portfolio/classes/class.ilObjPortfolioGUI.php";
114 $ilCtrl->forwardCommand($gui);
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
"Services/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
"Services/Portfolio/classes/class.ilObjPortfolio.php";
198 if(!$prtf->isOnline())
203 include_once
"Services/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",
$_GET[
"gtp"]);
260 $ilCtrl->redirectByClass($gui,
"preview");
264 $ilCtrl->setParameterByClass($gui,
"wsp_id", $a_node_id);
265 $ilCtrl->redirectByClass($gui,
"deliver");
269 $ilCtrl->setParameterByClass($gui,
"wsp_id", $a_node_id);
270 $ilCtrl->redirectByClass($gui);
273 $ilCtrl->setParameterByClass($gui,
"prt_id", $a_node_id);
274 $ilCtrl->redirectByClass($gui,
"preview");
277 exit(
"invalid object type");
285 $lng->loadLanguageModule(
"wsp");
287 $tpl->setTitle($lng->txt(
"wsp_password_protected_resource"));
288 $tpl->setDescription($lng->txt(
"wsp_password_protected_resource_info"));
295 $tpl->setContent($form->getHTML());
304 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
312 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
314 $form->setFormAction($ilCtrl->getFormAction($this,
"checkPassword"));
315 $form->setTitle($lng->txt(
"wsp_password_for").
": ".$object_data[
"title"]);
319 $password->setRequired(
true);
320 $form->addItem($password);
322 $form->addCommandButton(
"checkPassword", $lng->txt(
"submit"));
324 if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
326 $ilTabs->setBackTarget($lng->txt(
"back"), $ilCtrl->getLinkTarget($this,
"cancelPassword"));
327 $form->addCommandButton(
"cancelPassword", $lng->txt(
"cancel"));
337 if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
341 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
342 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
345 ilUtil::redirect(
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".$owner);
349 include_once
"Services/Portfolio/classes/class.ilObjPortfolio.php";
351 $owner = $prtf->getOwner();
352 ilUtil::redirect(
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio&dsh=".$owner);
361 $lng->loadLanguageModule(
"wsp");
364 if($form->checkInput())
366 $input = md5($form->getInput(
"password"));
369 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
374 include_once
"Services/Portfolio/classes/class.ilPortfolioAccessHandler.php";
377 if($input == $password)
392 $item = $form->getItemByPostVar(
"password");
393 $item->setAlert($lng->txt(
"wsp_invalid_password"));
398 $form->setValuesByPost();