5require_once 
"./Services/Object/classes/class.ilObject2GUI.php";
 
   34    public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
 
   37        parent::__construct($a_id, $a_id_type, $a_parent_node_id);
 
   39        $this->lng = 
$DIC->language();
 
   40        $this->help = 
$DIC[
"ilHelp"];
 
   41        $this->tpl = 
$DIC[
"tpl"];
 
   42        $this->
user = $DIC->user();
 
   43        $this->tabs = 
$DIC->tabs();
 
   44        $this->ctrl = 
$DIC->ctrl();
 
   52    public function setTabs($a_show_settings = 
true)
 
   57        $ilHelp->setScreenIdComponent(
"wfld");
 
   59        $this->ctrl->setParameter($this, 
"wsp_id", $this->node_id);
 
   61        $this->tabs_gui->addTab(
 
   63            $lng->txt(
"wsp_tab_personal"),
 
   64            $this->ctrl->getLinkTarget($this, 
"")
 
   67        $this->ctrl->setParameterByClass(
 
   68            "ilObjWorkspaceRootFolderGUI",
 
   73        $this->tabs_gui->addTab(
 
   75            $lng->txt(
"wsp_tab_shared"),
 
   76            $this->ctrl->getLinkTargetByClass(
"ilObjWorkspaceRootFolderGUI", 
"shareFilter")
 
   79        $this->tabs_gui->addTab(
 
   81            $lng->txt(
"wsp_tab_ownership"),
 
   82            $this->ctrl->getLinkTargetByClass(array(
"ilObjWorkspaceRootFolderGUI", 
"ilObjectOwnershipManagementGUI"), 
"listObjects")
 
   85        if (!$this->ctrl->getNextClass($this)) {
 
   86            if (stristr($this->ctrl->getCmd(), 
"share")) {
 
   87                $this->tabs_gui->activateTab(
"share");
 
   89                $this->tabs_gui->activateTab(
"wsp");
 
   91                if ($a_show_settings) {
 
   93                        $this->tabs_gui->addSubTab(
 
   96                            $this->ctrl->getLinkTarget($this, 
"")
 
  101                        $this->tabs_gui->addSubTab(
 
  103                            $lng->txt(
"settings"),
 
  104                            $this->ctrl->getLinkTarget($this, 
"edit")
 
  114        $next_class = $this->ctrl->getNextClass($this);
 
  115        $cmd = $this->ctrl->getCmd();
 
  117        switch ($next_class) {
 
  118            case "ilcommonactiondispatchergui":
 
  119                include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
 
  121                $this->ctrl->forwardCommand($gui);
 
  124            case "ilobjectownershipmanagementgui":
 
  126                $this->tabs_gui->activateTab(
"ownership");
 
  127                include_once(
"Services/Object/classes/class.ilObjectOwnershipManagementGUI.php");
 
  129                $this->ctrl->forwardCommand($gui);
 
  134                if ($this->type != 
"wsrt") {
 
  166        unset(
$_SESSION[
'clipboard'][
'wsp2repo']);
 
  169        include_once 
"Services/Object/classes/class.ilObjectAddNewItemGUI.php";
 
  172        $gui->setCreationUrl(
$ilCtrl->getLinkTarget($this, 
"create"));
 
  175        include_once 
"Services/Object/classes/class.ilObjectListGUI.php";
 
  178            $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui", 
"ilnotegui"), 
"", 
"", 
true, 
false),
 
  179            $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui", 
"iltagginggui"), 
"", 
"", 
true, 
false)
 
  182        include_once 
"Modules/WorkspaceFolder/classes/class.ilObjWorkspaceFolderTableGUI.php";
 
  186        include_once(
"./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorerGUI.php");
 
  188        $exp->setTypeWhiteList(array(
"wsrt", 
"wfld"));
 
  189        $exp->setSelectableTypes(array(
"wsrt", 
"wfld"));
 
  190        $exp->setLinkToNodeClass(
true);
 
  191        $exp->setActivateHighlighting(
true);
 
  192        if ($exp->handleCommand()) {
 
  195        $left = $exp->getHTML();
 
  197        $tpl->setLeftNavContent($left);
 
  204        $this->tabs_gui->activateTab(
"wsp");
 
  205        $this->tabs_gui->activateSubTab(
"settings");
 
  212        $this->tabs_gui->activateTab(
"wsp");
 
  213        $this->tabs_gui->activateSubTab(
"settings");
 
  223        if (!$_REQUEST[
"item_ref_id"]) {
 
  225            $this->ctrl->redirect($this);
 
  228        $current_node = $_REQUEST[
"item_ref_id"];
 
  229        $parent_node = $this->tree->getParentId($current_node);
 
  232        $this->ctrl->setParameter($this, 
"wsp_id", $parent_node);
 
  236        foreach ($this->tree->getSubTree($this->tree->getNodeData($current_node)) as $node) {
 
  239                $no_cut[$node[
"wsp_id"]] = $obj->getTitle();
 
  243        if (count($no_cut)) {
 
  244            ilUtil::sendFailure($this->lng->txt(
"msg_no_perm_cut") . 
" " . implode(
',', $no_cut), 
true);
 
  245            $this->ctrl->redirect($this);
 
  251        $_SESSION[
'paste_cut_wspexpand'] = array();
 
  252        foreach ((array) $this->tree->getPathId($parent_node) as 
$node_id) {
 
  257        $_SESSION[
'clipboard'][
'source_id'] = $current_node;
 
  270        $_SESSION[
'clipboard'][
'wsp2repo'] = 
true;
 
  283        if (!$_REQUEST[
"item_ref_id"]) {
 
  285            $this->ctrl->redirect($this);
 
  288        $current_node = $_REQUEST[
"item_ref_id"];
 
  289        $owner = $this->tree->lookupOwner($current_node);
 
  290        if ($owner == 
$ilUser->getId()) {
 
  291            $parent_node = $this->tree->getParentId($current_node);
 
  294            $this->ctrl->setParameter($this, 
"wsp_id", $parent_node);
 
  299            $_SESSION[
'paste_copy_wspexpand'] = array();
 
  300            foreach ((array) $this->tree->getPathId($parent_node) as 
$node_id) {
 
  306            $this->ctrl->redirect($this);
 
  310        $_SESSION[
'clipboard'][
'source_id'] = $current_node;
 
  318        if (!$_REQUEST[
"item_ref_id"]) {
 
  319            $this->ctrl->redirect($this, 
"share");
 
  322        $current_node = $_REQUEST[
"item_ref_id"];
 
  326        if (
$handler->checkAccess(
"read", 
"", $current_node)) {
 
  328            $_SESSION[
'clipboard'][
'source_id'] = $current_node;
 
  334            $perms = 
$handler->getPermissions($current_node);
 
  341        $this->ctrl->redirect($this, 
"share");
 
  351        $_SESSION[
'clipboard'][
'wsp2repo'] = 
true;
 
  363        $ilTabs->clearTargets();
 
  366            $ilTabs->setBackTarget(
 
  367                $this->lng->txt(
'back'),
 
  368                $this->ctrl->getLinkTarget($this)
 
  371            $ilTabs->setBackTarget(
 
  372                $this->lng->txt(
'back'),
 
  373                $this->ctrl->getLinkTarget($this, 
'share')
 
  381        $this->tpl->addBlockfile(
 
  384            'tpl.paste_into_multiple_objects.html',
 
  389        if (!
$_SESSION[
'clipboard'][
'wsp2repo']) {
 
  390            include_once(
"./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorerGUI.php");
 
  392            $exp->setTypeWhiteList(array(
"wsrt", 
"wfld"));
 
  393            $exp->setSelectableTypes(array(
"wsrt", 
"wfld"));
 
  394            $exp->setSelectMode(
"node", 
false);
 
  395            if ($exp->handleCommand()) {
 
  398            $this->tpl->setVariable(
'OBJECT_TREE', $exp->getHTML());
 
  402            require_once 
'./Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php';
 
  406                'paste_' . $mode . 
'_repexpand' 
  408            $exp->setTargetGet(
'ref_id');
 
  410            if (
$_GET[
'paste_' . $mode . 
'_repexpand'] == 
'') {
 
  411                $expanded = 
$tree->readRootId();
 
  413                $expanded = 
$_GET[
'paste_' . $mode . 
'_repexpand'];
 
  415            $exp->setCheckedItems(array((
int) 
$_POST[
'node']));
 
  416            $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 
'showMoveIntoObjectTree'));
 
  417            $exp->setPostVar(
'node');
 
  418            $exp->setExpand($expanded);
 
  420            $this->tpl->setVariable(
'OBJECT_TREE', $exp->getOutput());
 
  426        $this->tpl->setVariable(
'FORM_TARGET', 
'_top');
 
  427        $this->tpl->setVariable(
 
  429            $this->ctrl->getFormAction($this, 
'performPasteIntoMultipleObjects')
 
  432        $this->tpl->setVariable(
'CMD_SUBMIT', 
'performPasteIntoMultipleObjects');
 
  433        $this->tpl->setVariable(
'TXT_SUBMIT', $this->lng->txt(
'paste'));
 
  444        $source_node_id = 
$_SESSION[
'clipboard'][
'source_id'];
 
  445        $target_node_id = $_REQUEST[
'node'];
 
  447        if (!$source_node_id) {
 
  449            $this->ctrl->redirect($this);
 
  451        if (!$target_node_id) {
 
  453            $this->ctrl->redirect($this, 
"showMoveIntoObjectTree");
 
  457        $source_obj_id = $this->tree->lookupObjectId($source_node_id);
 
  460        if (!
$_SESSION[
'clipboard'][
'wsp2repo']) {
 
  461            $target_obj_id = $this->tree->lookupObjectId($target_node_id);
 
  472        if ($source_node_id == $target_node_id) {
 
  474                $this->lng->txt(
'msg_obj_exists_in_folder'),
 
  475                $source_object->getTitle(),
 
  476                $target_object->getTitle()
 
  480        if (!in_array($source_object->getType(), array_keys($target_object->getPossibleSubObjects()))) {
 
  482                $this->lng->txt(
'msg_obj_may_not_contain_objects_of_type'),
 
  483                $target_object->getTitle(),
 
  484                $source_object->getType()
 
  489        $owner = $this->tree->lookupOwner($source_node_id);
 
  490        if ($mode == 
"copy" && 
$ilUser->getId() == $owner && !$this->checkPermissionBool(
'copy', 
'', 
'', $source_node_id)) {
 
  491            $fail[] = $this->lng->txt(
'permission_denied');
 
  494        if (!
$_SESSION[
'clipboard'][
'wsp2repo']) {
 
  495            if ($mode == 
"cut" && $this->tree->isGrandChild($source_node_id, $target_node_id)) {
 
  497                    $this->lng->txt(
'msg_paste_object_not_in_itself'),
 
  498                    $source_object->getTitle()
 
  503        if (
$_SESSION[
'clipboard'][
'wsp2repo'] == 
true) {               
 
  505            if (!$ilAccess->checkAccess(
"create", 
"", $target_node_id, $source_object->getType())) {
 
  507                    $this->lng->txt(
'msg_no_perm_paste_object_in_folder'),
 
  508                    $source_object->getTitle(),
 
  509                    $target_object->getTitle()
 
  513            if (!$this->
checkPermissionBool(
'create', 
'', $source_object->getType(), $target_node_id)) {
 
  515                    $this->lng->txt(
'msg_no_perm_paste_object_in_folder'),
 
  516                    $source_object->getTitle(),
 
  517                    $target_object->getTitle()
 
  524            $this->ctrl->redirect($this);
 
  529        if ($mode == 
"cut") {
 
  530            if (!
$_SESSION[
'clipboard'][
'wsp2repo']) {
 
  531                $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        elseif ($mode == 
"copy") {
 
  551            include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
 
  555            if (!
$_SESSION[
'clipboard'][
'wsp2repo']) {
 
  556                $wizard_options->disableTreeCopy();
 
  558            $wizard_options->saveOwner(
$ilUser->getId());
 
  559            $wizard_options->saveRoot($source_node_id);
 
  560            $wizard_options->read();
 
  562            $new_obj = $source_object->cloneObject($target_node_id, $copy_id);
 
  565            if ($new_obj && !
$_SESSION[
'clipboard'][
'wsp2repo']) {
 
  566                $new_obj_node_id = $this->tree->insertObject($target_node_id, $new_obj->getId());
 
  567                $this->
getAccessHandler()->setPermissions($target_node_id, $new_obj_node_id);
 
  570            $wizard_options->deleteAll();
 
  574        if (!
$_SESSION[
'clipboard'][
'wsp2repo']) {
 
  575            $redirect_node = $target_node_id;
 
  582        unset(
$_SESSION[
'clipboard'][
'source_id']);
 
  583        unset(
$_SESSION[
'clipboard'][
'wsp2repo']);
 
  587        if ($mode == 
'cut') {
 
  588            ilUtil::sendSuccess($this->lng->txt(
'msg_cut_copied'), 
true);
 
  590            ilUtil::sendSuccess($this->lng->txt(
'msg_cloned'), 
true);
 
  593        $this->ctrl->setParameter($this, 
"wsp_id", $redirect_node);
 
  594        $this->ctrl->redirect($this);
 
  602    public function share($a_load_data = 
true)
 
  606        include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
 
  613        include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
 
  616        $tbl->writeFilterToSession();
 
  623        include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
 
  637        $tpl->setTitle(
$lng->txt(
"wsp_password_protected_resource"));
 
  638        $tpl->setDescription(
$lng->txt(
"wsp_password_protected_resource_info"));
 
  640        $ilTabs->clearTargets();
 
  641        $ilTabs->setBackTarget(
 
  643            $this->ctrl->getLinkTarget($this, 
"share")
 
  658        $this->ctrl->setParameter($this, 
"item_ref_id", $a_node_id);
 
  660        $object_data = $this->
getAccessHandler()->getObjectDataFromNode($a_node_id);
 
  662        include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
  664        $form->setFormAction(
$ilCtrl->getFormAction($this, 
"checkPassword"));
 
  665        $form->setTitle(
$lng->txt(
"wsp_password_for") . 
": " . $object_data[
"title"]);
 
  673        $form->addCommandButton(
"checkPassword", 
$lng->txt(
"submit"));
 
  674        $form->addCommandButton(
"share", 
$lng->txt(
"cancel"));
 
  683        $node_id = $_REQUEST[
"item_ref_id"];
 
  685            $this->ctrl->redirect($this, 
"share");
 
  689        if (
$form->checkInput()) {
 
  690            include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
 
  697                $this->ctrl->setParameter($this, 
"item_ref_id", 
$node_id);
 
  698                $this->ctrl->redirect($this, 
"copyShared");
 
  700                $item = 
$form->getItemByPostVar(
"password");
 
  701                $item->setAlert(
$lng->txt(
"wsp_invalid_password"));
 
  706        $form->setValuesByPost();
 
  715    public static function _goto($a_target)
 
  717        $id = explode(
"_", $a_target);
 
  719        $_GET[
"baseClass"] = 
"ilsharedresourceGUI";
 
  721        include(
"ilias.php");
 
  732        include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
 
  737        $tbl->writeFilterToSession();
 
An exception for terminatinating execution or to throw for unit testing.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _allocateCopyId()
Allocate a copy for further entries.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
Class ilObjWorkspaceFolderGUI.
getType()
Functions that must be overwritten.
__construct($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
Constructor.
cut()
Move node preparation.
setTabs($a_show_settings=true)
initCreationForms($a_new_type)
Init creation froms.
performPasteIntoMultipleObjects()
Move node: target has been selected, execute.
copy_to_repository()
Copy node preparation (to repository)
showMoveIntoObjectTree()
Move node: select target (via explorer)
cut_for_repository()
Move node preparation (to repository)
initPasswordForm($a_node_id)
passwordForm($a_node_id, $form=null)
listSharedResourcesOfOtherUser()
Entry point for awareness tool.
static _goto($a_target)
Deep link.
executeCommand()
execute command
copy()
Copy node preparation.
Class ilObjWorkspaceFolderTableGUI.
New implementation of ilObjectGUI.
getAccessHandler()
Get access handler.
prepareOutput($a_show_subobjects=true)
prepare output
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
Render add new item selector.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
initCreateForm($a_new_type)
Init object creation form.
addHeaderAction()
Add header action menu.
static prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl=null)
Insert js/ajax links into template.
Class ilObjectOwnershipManagementGUI.
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
const PERMISSION_ALL_PASSWORD
static keepSharedSessionPassword($a_node_id, $a_password)
static getSharedNodePassword($a_node_id)
Explorer for selecting a personal workspace item.
Workspace share handler table GUI class.
if(!array_key_exists('StateId', $_REQUEST)) $id
update($pash, $contents, Config $config)
if(empty($password)) $table
if(isset($_POST['submit'])) $form