5 require_once
"./Services/Object/classes/class.ilObject2GUI.php";
28 $ilHelp->setScreenIdComponent(
"wfld");
30 $this->ctrl->setParameter($this,
"wsp_id",$this->node_id);
32 $this->tabs_gui->addTab(
"wsp", $lng->txt(
"wsp_tab_personal"),
33 $this->ctrl->getLinkTarget($this,
""));
35 $this->ctrl->setParameterByClass(
"ilObjWorkspaceRootFolderGUI",
"wsp_id",
38 $this->tabs_gui->addTab(
"share", $lng->txt(
"wsp_tab_shared"),
39 $this->ctrl->getLinkTargetByClass(
"ilObjWorkspaceRootFolderGUI",
"share"));
41 $this->tabs_gui->addTab(
"ownership", $lng->txt(
"wsp_tab_ownership"),
42 $this->ctrl->getLinkTargetByClass(array(
"ilObjWorkspaceRootFolderGUI",
"ilObjectOwnershipManagementGUI"),
"listObjects"));
44 if(!$this->ctrl->getNextClass($this))
46 if(stristr($this->ctrl->getCmd(),
"share"))
48 $this->tabs_gui->activateTab(
"share");
52 $this->tabs_gui->activateTab(
"wsp");
58 $this->tabs_gui->addSubTab(
"content",
60 $this->ctrl->getLinkTarget($this,
""));
65 $this->tabs_gui->addSubTab(
"settings",
66 $lng->txt(
"settings"),
67 $this->ctrl->getLinkTarget($this,
"edit"));
76 $next_class = $this->ctrl->getNextClass($this);
77 $cmd = $this->ctrl->getCmd();
81 case "ilcommonactiondispatchergui":
82 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
84 $this->ctrl->forwardCommand($gui);
87 case "ilobjectownershipmanagementgui":
89 $this->tabs_gui->activateTab(
"ownership");
90 include_once(
"Services/Object/classes/class.ilObjectOwnershipManagementGUI.php");
92 $this->ctrl->forwardCommand($gui);
97 if($this->type !=
"wsrt")
128 unset(
$_SESSION[
'clipboard'][
'wsp2repo']);
130 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
132 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
133 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
135 include_once
"Modules/WorkspaceFolder/classes/class.ilObjWorkspaceFolderTableGUI.php";
137 $tpl->setContent($table->getHTML());
139 include_once
"Modules/WorkspaceFolder/classes/class.ilWorkspaceFolderExplorer.php";
142 if($this->node_id != $exp->getRoot())
144 $ilTabs->activateSubTab(
"content");
150 if($this->node_id != $exp->getRoot() || $exp->hasFolders($this->node_id))
153 $exp->setSessionExpandVariable(
'wspexpand');
154 $exp->setExpand($this->node_id);
155 $exp->setExpandTarget($this->ctrl->getLinkTarget($this));
157 if (
$_GET[
"wspexpand"] !=
"")
159 $exp->setExpand(
$_GET[
"wspexpand"]);
162 $exp->highlightNode($this->node_id);
165 $left .= $exp->getOutput();
168 $tpl->setLeftNavContent($left);
175 $this->tabs_gui->activateTab(
"wsp");
176 $this->tabs_gui->activateSubTab(
"settings");
183 $this->tabs_gui->activateTab(
"wsp");
184 $this->tabs_gui->activateSubTab(
"settings");
197 $this->ctrl->redirect($this);
200 $current_node =
$_REQUEST[
"item_ref_id"];
201 $parent_node = $this->tree->getParentId($current_node);
204 $this->ctrl->setParameter($this,
"wsp_id", $parent_node);
208 foreach ($this->tree->getSubTree($this->tree->getNodeData($current_node)) as $node)
213 $no_cut[$node[
"wsp_id"]] = $obj->getTitle();
220 $this->ctrl->redirect($this);
226 $_SESSION[
'paste_cut_wspexpand'] = array();
227 foreach((array)$this->tree->getPathId($parent_node) as
$node_id)
233 $_SESSION[
'clipboard'][
'source_id'] = $current_node;
246 $_SESSION[
'clipboard'][
'wsp2repo'] =
true;
262 $this->ctrl->redirect($this);
265 $current_node =
$_REQUEST[
"item_ref_id"];
266 $owner = $this->tree->lookupOwner($current_node);
267 if($owner == $ilUser->getId())
269 $parent_node = $this->tree->getParentId($current_node);
272 $this->ctrl->setParameter($this,
"wsp_id", $parent_node);
277 $_SESSION[
'paste_copy_wspexpand'] = array();
278 foreach((array)$this->tree->getPathId($parent_node) as
$node_id)
287 $this->ctrl->redirect($this);
291 $_SESSION[
'clipboard'][
'source_id'] = $current_node;
301 $this->ctrl->redirect($this,
"share");
304 $current_node =
$_REQUEST[
"item_ref_id"];
308 if($handler->checkAccess(
"read",
"", $current_node))
311 $_SESSION[
'clipboard'][
'source_id'] = $current_node;
319 $perms = $handler->getPermissions($current_node);
327 $this->ctrl->redirect($this,
"share");
337 $_SESSION[
'clipboard'][
'wsp2repo'] =
true;
346 global $ilTabs,
$tree;
348 $ilTabs->clearTargets();
352 $ilTabs->setBackTarget($this->lng->txt(
'back'),
353 $this->ctrl->getLinkTarget($this));
357 $ilTabs->setBackTarget($this->lng->txt(
'back'),
358 $this->ctrl->getLinkTarget($this,
'share'));
365 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
366 'tpl.paste_into_multiple_objects.html',
"Services/Object");
371 require_once
'Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php';
373 'paste_'.$mode.
'_wspexpand', $this->tree, $this->getAccessHandler());
376 if(
$_GET[
'paste_'.$mode.
'_wspexpand'] ==
'')
379 $expanded = $this->tree->readRootId();
383 $expanded =
$_GET[
'paste_'.$mode.
'_wspexpand'];
390 require_once
'./Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php';
392 '',
'paste_'.$mode.
'_repexpand');
393 $exp->setTargetGet(
'ref_id');
395 if(
$_GET[
'paste_'.$mode.
'_repexpand'] ==
'')
397 $expanded = $tree->readRootId();
401 $expanded =
$_GET[
'paste_'.$mode.
'_repexpand'];
405 $exp->setCheckedItems(array((
int)
$_POST[
'node']));
406 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showMoveIntoObjectTree'));
407 $exp->setPostVar(
'node');
408 $exp->setExpand($expanded);
411 $this->tpl->setVariable(
'OBJECT_TREE', $exp->getOutput());
414 $this->tpl->setVariable(
'FORM_TARGET',
'_top');
415 $this->tpl->setVariable(
'FORM_ACTION',
416 $this->ctrl->getFormAction($this,
'performPasteIntoMultipleObjects'));
418 $this->tpl->setVariable(
'CMD_SUBMIT',
'performPasteIntoMultipleObjects');
419 $this->tpl->setVariable(
'TXT_SUBMIT', $this->lng->txt(
'paste'));
430 $source_node_id =
$_SESSION[
'clipboard'][
'source_id'];
436 $this->ctrl->redirect($this);
441 $this->ctrl->redirect($this,
"showMoveIntoObjectTree");
445 $source_obj_id = $this->tree->lookupObjectId($source_node_id);
450 $target_obj_id = $this->tree->lookupObjectId($target_node_id);
463 if($source_node_id == $target_node_id)
465 $fail[] = sprintf($this->lng->txt(
'msg_obj_exists_in_folder'),
466 $source_object->getTitle(), $target_object->getTitle());
469 if(!in_array($source_object->getType(), array_keys($objDefinition->getSubObjects($target_object->getType()))))
471 $fail[] = sprintf($this->lng->txt(
'msg_obj_may_not_contain_objects_of_type'),
472 $target_object->getTitle(), $source_object->getType());
476 $owner = $this->tree->lookupOwner($source_node_id);
477 if($mode ==
"copy" && $ilUser->getId() == $owner && !$this->
checkPermissionBool(
'copy',
'',
'', $source_node_id))
479 $fail[] = $this->lng->txt(
'permission_denied');
484 if($mode ==
"cut" && $this->tree->isGrandChild($source_node_id, $target_node_id))
486 $fail[] = sprintf($this->lng->txt(
'msg_paste_object_not_in_itself'),
487 $source_object->getTitle());
492 $fail[] = sprintf($this->lng->txt(
'msg_no_perm_paste_object_in_folder'),
493 $source_object->getTitle(), $target_object->getTitle());
499 if(!$ilAccess->checkAccess(
'create',
'', $target_node_id, $source_object->getType()))
501 $fail[] = sprintf($this->lng->txt(
'msg_no_perm_paste_object_in_folder'),
502 $source_object->getTitle(), $target_object->getTitle());
509 $this->ctrl->redirect($this);
518 $this->tree->moveTree($source_node_id, $target_node_id);
522 $parent_id = $this->tree->getParentId($source_node_id);
526 $this->tree->deleteReference($source_node_id);
527 $source_node = $this->tree->getNodeData($source_node_id);
528 $this->tree->deleteTree($source_node);
531 $source_object->createReference();
532 $source_object->putInTree($target_node_id);
533 $source_object->setPermissions($target_node_id);
539 else if($mode ==
"copy")
541 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
544 $wizard_options->saveOwner($ilUser->getId());
545 $wizard_options->saveRoot($source_node_id);
546 $wizard_options->read();
548 $new_obj = $source_object->cloneObject($target_node_id, $copy_id, !
$_SESSION[
'clipboard'][
'wsp2repo']);
551 if($new_obj && !
$_SESSION[
'clipboard'][
'wsp2repo'])
553 $new_obj_node_id = $this->tree->insertObject($target_node_id, $new_obj->getId());
554 $this->
getAccessHandler()->setPermissions($target_node_id, $new_obj_node_id);
557 $wizard_options->deleteAll();
563 $redirect_node = $target_node_id;
572 unset(
$_SESSION[
'clipboard'][
'source_id']);
573 unset(
$_SESSION[
'clipboard'][
'wsp2repo']);
577 $this->ctrl->setParameter($this,
"wsp_id", $redirect_node);
578 $this->ctrl->redirect($this);
583 global
$tpl, $ilToolbar;
588 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
590 $si->setOptions(array(
""=>
"-")+$users);
591 $ilToolbar->addInputItem(
$si);
593 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
594 $ilToolbar->addFormButton($this->lng->txt(
"ok"),
"share");
604 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
606 $tpl->setContent($tbl->getHTML());
612 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
615 $tbl->writeFilterToSession();
622 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
634 $tpl->setTitle($lng->txt(
"wsp_password_protected_resource"));
635 $tpl->setDescription($lng->txt(
"wsp_password_protected_resource_info"));
637 $ilTabs->clearTargets();
638 $ilTabs->setBackTarget($lng->txt(
"back"),
639 $this->ctrl->getLinkTarget($this,
"share"));
646 $tpl->setContent($form->getHTML());
653 $this->ctrl->setParameter($this,
"item_ref_id", $a_node_id);
655 $object_data = $this->
getAccessHandler()->getObjectDataFromNode($a_node_id);
657 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
659 $form->setFormAction($ilCtrl->getFormAction($this,
"checkPassword"));
660 $form->setTitle($lng->txt(
"wsp_password_for").
": ".$object_data[
"title"]);
664 $password->setRequired(
true);
665 $password->setSkipSyntaxCheck(
true);
666 $form->addItem($password);
668 $form->addCommandButton(
"checkPassword", $lng->txt(
"submit"));
669 $form->addCommandButton(
"share", $lng->txt(
"cancel"));
681 $this->ctrl->redirect($this,
"share");
685 if($form->checkInput())
687 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
689 $input = md5($form->getInput(
"password"));
690 if($input == $password)
695 $this->ctrl->setParameter($this,
"item_ref_id",
$node_id);
696 $this->ctrl->redirect($this,
"copyShared");
700 $item = $form->getItemByPostVar(
"password");
701 $item->setAlert($lng->txt(
"wsp_invalid_password"));
706 $form->setValuesByPost();
717 $id = explode(
"_", $a_target);
719 $_GET[
"baseClass"] =
"ilsharedresourceGUI";
720 $_GET[
"wsp_id"] = $id[0];
721 include(
"ilias.php");