5 require_once
"./Services/Object/classes/class.ilObject2GUI.php";
29 $ilHelp->setScreenIdComponent(
"wfld");
31 $this->ctrl->setParameter($this,
"wsp_id",$this->node_id);
33 $this->tabs_gui->addTab(
"wsp", $lng->txt(
"wsp_tab_personal"),
34 $this->ctrl->getLinkTarget($this,
""));
36 $this->ctrl->setParameterByClass(
"ilObjWorkspaceRootFolderGUI",
"wsp_id",
39 $this->tabs_gui->addTab(
"share", $lng->txt(
"wsp_tab_shared"),
40 $this->ctrl->getLinkTargetByClass(
"ilObjWorkspaceRootFolderGUI",
"shareFilter"));
42 $this->tabs_gui->addTab(
"ownership", $lng->txt(
"wsp_tab_ownership"),
43 $this->ctrl->getLinkTargetByClass(
array(
"ilObjWorkspaceRootFolderGUI",
"ilObjectOwnershipManagementGUI"),
"listObjects"));
45 if(!$this->ctrl->getNextClass($this))
47 if(stristr($this->ctrl->getCmd(),
"share"))
49 $this->tabs_gui->activateTab(
"share");
53 $this->tabs_gui->activateTab(
"wsp");
59 $this->tabs_gui->addSubTab(
"content",
61 $this->ctrl->getLinkTarget($this,
""));
66 $this->tabs_gui->addSubTab(
"settings",
67 $lng->txt(
"settings"),
68 $this->ctrl->getLinkTarget($this,
"edit"));
77 $next_class = $this->ctrl->getNextClass($this);
78 $cmd = $this->ctrl->getCmd();
82 case "ilcommonactiondispatchergui":
83 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
85 $this->ctrl->forwardCommand($gui);
88 case "ilobjectownershipmanagementgui":
90 $this->tabs_gui->activateTab(
"ownership");
91 include_once(
"Services/Object/classes/class.ilObjectOwnershipManagementGUI.php");
93 $this->ctrl->forwardCommand($gui);
98 if($this->type !=
"wsrt")
129 unset(
$_SESSION[
'clipboard'][
'wsp2repo']);
132 include_once
"Services/Object/classes/class.ilObjectAddNewItemGUI.php";
135 $gui->setCreationUrl($ilCtrl->getLinkTarget($this,
"create"));
138 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
140 $this->ctrl->getLinkTargetByClass(
array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
141 $this->ctrl->getLinkTargetByClass(
array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
143 include_once
"Modules/WorkspaceFolder/classes/class.ilObjWorkspaceFolderTableGUI.php";
145 $tpl->setContent($table->getHTML());
147 include_once
"Modules/WorkspaceFolder/classes/class.ilWorkspaceFolderExplorer.php";
150 if($this->node_id != $exp->getRoot())
152 $ilTabs->activateSubTab(
"content");
158 if($this->node_id != $exp->getRoot() || $exp->hasFolders($this->node_id))
161 $exp->setSessionExpandVariable(
'wspexpand');
162 $exp->setExpand($this->node_id);
163 $exp->setExpandTarget($this->ctrl->getLinkTarget($this));
165 if (
$_GET[
"wspexpand"] !=
"")
167 $exp->setExpand(
$_GET[
"wspexpand"]);
170 $exp->highlightNode($this->node_id);
173 $left .= $exp->getOutput();
176 $tpl->setLeftNavContent($left);
183 $this->tabs_gui->activateTab(
"wsp");
184 $this->tabs_gui->activateSubTab(
"settings");
191 $this->tabs_gui->activateTab(
"wsp");
192 $this->tabs_gui->activateSubTab(
"settings");
202 if (!$_REQUEST[
"item_ref_id"])
205 $this->ctrl->redirect($this);
208 $current_node = $_REQUEST[
"item_ref_id"];
209 $parent_node = $this->tree->getParentId($current_node);
212 $this->ctrl->setParameter($this,
"wsp_id", $parent_node);
216 foreach ($this->tree->getSubTree($this->tree->getNodeData($current_node)) as $node)
221 $no_cut[$node[
"wsp_id"]] = $obj->getTitle();
228 $this->ctrl->redirect($this);
235 foreach((
array)$this->tree->getPathId($parent_node) as
$node_id)
241 $_SESSION[
'clipboard'][
'source_id'] = $current_node;
254 $_SESSION[
'clipboard'][
'wsp2repo'] =
true;
267 if (!$_REQUEST[
"item_ref_id"])
270 $this->ctrl->redirect($this);
273 $current_node = $_REQUEST[
"item_ref_id"];
274 $owner = $this->tree->lookupOwner($current_node);
275 if($owner == $ilUser->getId())
277 $parent_node = $this->tree->getParentId($current_node);
280 $this->ctrl->setParameter($this,
"wsp_id", $parent_node);
286 foreach((
array)$this->tree->getPathId($parent_node) as
$node_id)
295 $this->ctrl->redirect($this);
299 $_SESSION[
'clipboard'][
'source_id'] = $current_node;
307 if (!$_REQUEST[
"item_ref_id"])
309 $this->ctrl->redirect($this,
"share");
312 $current_node = $_REQUEST[
"item_ref_id"];
316 if($handler->checkAccess(
"read",
"", $current_node))
319 $_SESSION[
'clipboard'][
'source_id'] = $current_node;
327 $perms = $handler->getPermissions($current_node);
335 $this->ctrl->redirect($this,
"share");
345 $_SESSION[
'clipboard'][
'wsp2repo'] =
true;
354 global $ilTabs,
$tree;
356 $ilTabs->clearTargets();
360 $ilTabs->setBackTarget($this->lng->txt(
'back'),
361 $this->ctrl->getLinkTarget($this));
365 $ilTabs->setBackTarget($this->lng->txt(
'back'),
366 $this->ctrl->getLinkTarget($this,
'share'));
373 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
374 'tpl.paste_into_multiple_objects.html',
"Services/Object");
379 require_once
'Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php';
381 'paste_'.$mode.
'_wspexpand', $this->tree, $this->getAccessHandler());
384 if(
$_GET[
'paste_'.$mode.
'_wspexpand'] ==
'')
387 $expanded = $this->tree->readRootId();
391 $expanded =
$_GET[
'paste_'.$mode.
'_wspexpand'];
398 require_once
'./Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php';
400 '',
'paste_'.$mode.
'_repexpand');
401 $exp->setTargetGet(
'ref_id');
403 if(
$_GET[
'paste_'.$mode.
'_repexpand'] ==
'')
405 $expanded = $tree->readRootId();
409 $expanded =
$_GET[
'paste_'.$mode.
'_repexpand'];
414 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showMoveIntoObjectTree'));
415 $exp->setPostVar(
'node');
416 $exp->setExpand($expanded);
419 $this->tpl->setVariable(
'OBJECT_TREE', $exp->getOutput());
422 $this->tpl->setVariable(
'FORM_TARGET',
'_top');
423 $this->tpl->setVariable(
'FORM_ACTION',
424 $this->ctrl->getFormAction($this,
'performPasteIntoMultipleObjects'));
426 $this->tpl->setVariable(
'CMD_SUBMIT',
'performPasteIntoMultipleObjects');
427 $this->tpl->setVariable(
'TXT_SUBMIT', $this->lng->txt(
'paste'));
438 $source_node_id =
$_SESSION[
'clipboard'][
'source_id'];
439 $target_node_id = $_REQUEST[
'node'];
444 $this->ctrl->redirect($this);
449 $this->ctrl->redirect($this,
"showMoveIntoObjectTree");
453 $source_obj_id = $this->tree->lookupObjectId($source_node_id);
458 $target_obj_id = $this->tree->lookupObjectId($target_node_id);
471 if($source_node_id == $target_node_id)
473 $fail[] = sprintf($this->lng->txt(
'msg_obj_exists_in_folder'),
474 $source_object->getTitle(), $target_object->getTitle());
477 if(!in_array($source_object->getType(), array_keys($target_object->getPossibleSubObjects())))
479 $fail[] = sprintf($this->lng->txt(
'msg_obj_may_not_contain_objects_of_type'),
480 $target_object->getTitle(), $source_object->getType());
484 $owner = $this->tree->lookupOwner($source_node_id);
485 if($mode ==
"copy" && $ilUser->getId() == $owner && !$this->
checkPermissionBool(
'copy',
'',
'', $source_node_id))
487 $fail[] = $this->lng->txt(
'permission_denied');
492 if($mode ==
"cut" && $this->tree->isGrandChild($source_node_id, $target_node_id))
494 $fail[] = sprintf($this->lng->txt(
'msg_paste_object_not_in_itself'),
495 $source_object->getTitle());
499 if (
$_SESSION[
'clipboard'][
'wsp2repo'] ==
true)
502 if (!$ilAccess->checkAccess(
"create",
"", $target_node_id, $source_object->getType()))
504 $fail[] = sprintf($this->lng->txt(
'msg_no_perm_paste_object_in_folder'),
505 $source_object->getTitle(), $target_object->getTitle());
512 $fail[] = sprintf($this->lng->txt(
'msg_no_perm_paste_object_in_folder'),
513 $source_object->getTitle(), $target_object->getTitle());
520 $this->ctrl->redirect($this);
529 $this->tree->moveTree($source_node_id, $target_node_id);
533 $parent_id = $this->tree->getParentId($source_node_id);
537 $this->tree->deleteReference($source_node_id);
538 $source_node = $this->tree->getNodeData($source_node_id);
539 $this->tree->deleteTree($source_node);
542 $source_object->createReference();
543 $source_object->putInTree($target_node_id);
544 $source_object->setPermissions($target_node_id);
550 else if($mode ==
"copy")
552 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
558 $wizard_options->disableTreeCopy();
560 $wizard_options->saveOwner($ilUser->getId());
561 $wizard_options->saveRoot($source_node_id);
562 $wizard_options->read();
564 $new_obj = $source_object->cloneObject($target_node_id, $copy_id);
567 if($new_obj && !
$_SESSION[
'clipboard'][
'wsp2repo'])
569 $new_obj_node_id = $this->tree->insertObject($target_node_id, $new_obj->getId());
570 $this->
getAccessHandler()->setPermissions($target_node_id, $new_obj_node_id);
573 $wizard_options->deleteAll();
579 $redirect_node = $target_node_id;
588 unset(
$_SESSION[
'clipboard'][
'source_id']);
589 unset(
$_SESSION[
'clipboard'][
'wsp2repo']);
602 $this->ctrl->setParameter($this,
"wsp_id", $redirect_node);
603 $this->ctrl->redirect($this);
615 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
617 $tpl->setContent(
$tbl->getHTML());
622 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
625 $tbl->writeFilterToSession();
632 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
644 $tpl->setTitle($lng->txt(
"wsp_password_protected_resource"));
645 $tpl->setDescription($lng->txt(
"wsp_password_protected_resource_info"));
647 $ilTabs->clearTargets();
648 $ilTabs->setBackTarget($lng->txt(
"back"),
649 $this->ctrl->getLinkTarget($this,
"share"));
656 $tpl->setContent($form->getHTML());
663 $this->ctrl->setParameter($this,
"item_ref_id", $a_node_id);
665 $object_data = $this->
getAccessHandler()->getObjectDataFromNode($a_node_id);
667 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
669 $form->setFormAction($ilCtrl->getFormAction($this,
"checkPassword"));
670 $form->setTitle($lng->txt(
"wsp_password_for").
": ".$object_data[
"title"]);
674 $password->setRequired(
true);
675 $password->setSkipSyntaxCheck(
true);
676 $form->addItem($password);
678 $form->addCommandButton(
"checkPassword", $lng->txt(
"submit"));
679 $form->addCommandButton(
"share", $lng->txt(
"cancel"));
688 $node_id = $_REQUEST[
"item_ref_id"];
691 $this->ctrl->redirect($this,
"share");
695 if($form->checkInput())
697 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
699 $input = md5($form->getInput(
"password"));
700 if($input == $password)
705 $this->ctrl->setParameter($this,
"item_ref_id",
$node_id);
706 $this->ctrl->redirect($this,
"copyShared");
710 $item = $form->getItemByPostVar(
"password");
711 $item->setAlert($lng->txt(
"wsp_invalid_password"));
716 $form->setValuesByPost();
725 public static function _goto($a_target)
727 $id = explode(
"_", $a_target);
729 $_GET[
"baseClass"] =
"ilsharedresourceGUI";
730 $_GET[
"wsp_id"] = $id[0];
731 include(
"ilias.php");
742 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
747 $tbl->writeFilterToSession();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
initPasswordForm($a_node_id)
Class ilObjWorkspaceFolderGUI.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
passwordForm($a_node_id, $form=null)
setTargetGet($a_target_get)
set the varname in Get-string public
initCreationForms($a_new_type)
New implementation of ilObjectGUI.
const PERMISSION_ALL_PASSWORD
getAccessHandler()
Get access handler.
cut()
Move node preparation.
Class ilObjectOwnershipManagementGUI.
static getSharedNodePassword($a_node_id)
static _goto($a_target)
Deep link.
showMoveIntoObjectTree()
Move node: select target (via explorer)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Workspace share handler table GUI class.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl=null)
Insert js/ajax links into template.
static _lookupObjId($a_id)
static _allocateCopyId()
Allocate a copy for further entries.
initCreateForm($a_new_type)
Init object creation form.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static keepSharedSessionPassword($a_node_id, $a_password)
performPasteIntoMultipleObjects()
Move node: target has been selected, execute.
copy_to_repository()
Copy node preparation (to repository)
Render add new item selector.
Class ilObjWorkspaceFolderTableGUI.
listSharedResourcesOfOtherUser()
Entry point for awareness tool.
prepareOutput($a_show_subobjects=true)
copy()
Copy node preparation.
cut_for_repository()
Move node preparation (to repository)
addHeaderAction()
Add header action menu.
setTabs($a_show_settings=true)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call