71 $this->ctrl = $DIC->ctrl();
72 $this->tpl = $DIC[
"tpl"];
73 $this->main_menu = $DIC[
"ilMainMenu"];
74 $this->locator = $DIC[
"ilLocator"];
75 $this->
user = $DIC->user();
76 $this->lng = $DIC->language();
77 $this->obj_definition = $DIC[
"objDefinition"];
78 $this->tabs = $DIC->tabs();
79 $this->db = $DIC->database();
82 $ilCtrl->saveParameter($this,
"wsp_id");
83 $ilCtrl->saveParameter($this,
"prt_id");
84 $this->node_id = (int)
$_GET[
"wsp_id"];
85 $this->portfolio_id = (int)
$_GET[
"prt_id"];
97 $next_class =
$ilCtrl->getNextClass($this);
100 $tpl->getStandardTemplate();
103 $ilMainMenu->setActive(
"desktop");
106 if (
$ilUser->getId() != ANONYMOUS_USER_ID &&
108 !in_array($next_class, array(
"ilobjbloggui",
"ilobjportfoliogui"))) {
109 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
110 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
113 $owner_id =
$tree->lookupOwner($this->node_id);
114 $obj_id =
$tree->lookupObjectId($this->node_id);
116 $lng->loadLanguageModule(
"wsp");
119 if ($owner_id !=
$ilUser->getId()) {
120 $ilCtrl->setParameterByClass(
"ilpersonaldesktopgui",
"dsh", $owner_id);
121 $link =
$ilCtrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"jumptoworkspace");
122 $ilLocator->addItem(
$lng->txt(
"wsp_tab_shared"), $link);
124 include_once
"Services/User/classes/class.ilUserUtil.php";
127 $link =
$ilCtrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"jumptoworkspace");
128 $ilLocator->addItem(
$lng->txt(
"wsp_tab_personal"), $link);
131 $link = $access_handler->getGotoLink($this->node_id, $obj_id);
133 $tpl->setLocator($ilLocator);
136 switch ($next_class) {
138 include_once
"Modules/Blog/classes/class.ilObjBlogGUI.php";
140 $ilCtrl->forwardCommand($bgui);
144 include_once
"Modules/File/classes/class.ilObjFileGUI.php";
146 $ilCtrl->forwardCommand($fgui);
149 case "ilobjtestverificationgui":
150 include_once
"Modules/Test/classes/class.ilObjTestVerificationGUI.php";
152 $ilCtrl->forwardCommand($tgui);
155 case "ilobjexerciseverificationgui":
156 include_once
"Modules/Exercise/classes/class.ilObjExerciseVerificationGUI.php";
158 $ilCtrl->forwardCommand($egui);
161 case "ilobjlinkresourcegui":
162 include_once
"Modules/WebResource/classes/class.ilObjLinkResourceGUI.php";
164 $ilCtrl->forwardCommand($lgui);
167 case "ilobjportfoliogui":
168 include_once
"Modules/Portfolio/classes/class.ilObjPortfolioGUI.php";
170 $ilCtrl->forwardCommand($pgui);
185 if (!$this->node_id && !$this->portfolio_id) {
186 exit(
"invalid call");
190 if ($this->node_id) {
191 if (!self::hasAccess($this->node_id)) {
192 exit(
"no permission");
196 if (!self::hasAccess($this->portfolio_id,
true)) {
197 exit(
"no permission");
203 public static function hasAccess($a_node_id, $a_is_portfolio =
false)
211 if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
212 if (!$a_is_portfolio) {
213 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
214 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
218 include_once
"Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php";
227 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
229 if (!$a_is_portfolio) {
230 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
239 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
241 if (!$prtf->isOnline()) {
245 include_once
"Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php";
256 if (!$a_is_portfolio) {
257 ilUtil::redirect(
"ilias.php?baseClass=ilSharedResourceGUI&cmd=passwordForm&wsp_id=" . $a_node_id);
259 ilUtil::redirect(
"ilias.php?baseClass=ilSharedResourceGUI&cmd=passwordForm&prt_id=" . $a_node_id);
271 if (!$a_is_portfolio) {
272 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
274 if (!$object_data[
"obj_id"]) {
275 exit(
"invalid object");
279 exit(
"invalid object");
281 $object_data[
"obj_id"] = $a_node_id;
282 $object_data[
"type"] =
"prtf";
285 $class = $objDefinition->getClassName($object_data[
"type"]);
286 $gui =
"ilobj" . $class .
"gui";
288 switch ($object_data[
"type"]) {
290 $ilCtrl->setParameterByClass($gui,
"wsp_id", $a_node_id);
291 $ilCtrl->setParameterByClass($gui,
"gtp", (
int)
$_GET[
"gtp"]);
292 $ilCtrl->redirectByClass($gui,
"preview");
299 $ilCtrl->setParameterByClass($gui,
"wsp_id", $a_node_id);
300 $ilCtrl->redirectByClass($gui,
"deliver");
305 $ilCtrl->setParameterByClass($gui,
"wsp_id", $a_node_id);
306 $ilCtrl->redirectByClass($gui);
310 $ilCtrl->setParameterByClass($gui,
"prt_id", $a_node_id);
311 $ilCtrl->setParameterByClass($gui,
"gtp", (
int) $_GET[
"gtp"]);
312 if ($_GET[
"back_url"]) {
313 $ilCtrl->setParameterByClass($gui,
"back_url", rawurlencode($_GET[
"back_url"]));
315 $ilCtrl->redirectByClass($gui,
"preview");
319 exit(
"invalid object type");
328 $lng->loadLanguageModule(
"wsp");
330 $tpl->setTitle(
$lng->txt(
"wsp_password_protected_resource"));
331 $tpl->setDescription(
$lng->txt(
"wsp_password_protected_resource_info"));
347 if ($this->node_id) {
348 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
354 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
356 $form->setFormAction(
$ilCtrl->getFormAction($this,
"checkPassword"));
357 $form->setTitle(
$lng->txt(
"wsp_password_for") .
": " . $object_data[
"title"]);
365 $form->addCommandButton(
"checkPassword",
$lng->txt(
"submit"));
368 $ilTabs->setBackTarget(
$lng->txt(
"back"),
$ilCtrl->getLinkTarget($this,
"cancelPassword"));
369 $form->addCommandButton(
"cancelPassword",
$lng->txt(
"cancel"));
380 if ($this->node_id) {
381 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
382 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
384 $owner =
$tree->lookupOwner($this->node_id);
385 ilUtil::redirect(
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=" . $owner);
387 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
389 $owner = $prtf->getOwner();
390 ilUtil::redirect(
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio&dsh=" . $owner);
400 $lng->loadLanguageModule(
"wsp");
403 if (
$form->checkInput()) {
405 if ($this->node_id) {
406 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
409 include_once
"Modules/Portfolio/classes/class.ilPortfolioAccessHandler.php";
413 if ($this->node_id) {
421 $item =
$form->getItemByPostVar(
"password");
422 $item->setAlert(
$lng->txt(
"wsp_invalid_password"));
427 $form->setValuesByPost();
static getSharedNodePassword($a_node_id)
const PERMISSION_ALL_PASSWORD
Class ilObjLinkResourceGUI.
Access handler for personal workspace.
static _lookupTitle($a_id)
lookup object title
Workspace deep link handler GUI.
static getSharedNodePassword($a_node_id)
Tree handler for personal workspace.
static _getPermissions($a_node_id)
Get all permissions to node.
static keepSharedSessionPassword($a_node_id, $a_password)
Portfolio view gui class.
if(isset($_POST['submit'])) $form
GUI class for exercise verification.
const PORTFOLIO_OBJECT_ID
static getObjectDataFromNode($a_node_id)
static hasAccess($a_node_id, $a_is_portfolio=false)
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static keepSharedSessionPassword($a_node_id, $a_password)
GUI class for test verification.
GUI class for file objects.
Access handler for portfolio.
static _getPermissions($a_node_id)
Get all permissions to node.
static redirect($a_script)
redirectToResource($a_node_id, $a_is_portfolio=false)