ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilObjWorkspaceFolderGUI Class Reference

Class ilObjWorkspaceFolderGUI. More...

+ Inheritance diagram for ilObjWorkspaceFolderGUI:
+ Collaboration diagram for ilObjWorkspaceFolderGUI:

Public Member Functions

 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 getType ()
 Functions that must be overwritten. More...
 
 setTabs ($a_show_settings=true)
 
 isActiveAdministrationPanel ()
 
 setAdministrationPanel (bool $active)
 
 executeCommand ()
 execute command More...
 
 render ()
 Render folder. More...
 
 edit ()
 
 update ()
 
 cut ()
 Move node preparation. More...
 
 cut_for_repository ()
 Move node preparation (to workspace) More...
 
 cut_for_workspace ()
 Move node preparation (to workspace) More...
 
 copy ()
 Copy node preparation. More...
 
 copyShared ()
 
 copy_to_repository ()
 Copy node preparation (to repository) More...
 
 copy_to_workspace ()
 Copy node preparation (to repository) More...
 
 showMoveIntoObjectTree ($repo_switch_allowed=false)
 Move node: select target (via explorer) More...
 
 performPasteIntoMultipleObjects ()
 Move node: target has been selected, execute. More...
 
 shareFilter ()
 
 share ($a_load_data=true)
 
 applyShareFilter ()
 
 resetShareFilter ()
 
 listSharedResourcesOfOtherUser ()
 Entry point for awareness tool. More...
 
 cancelDeletion ()
 
 showAdministrationPanel ()
 show administration panel More...
 
 download ()
 
 getBucketTitle ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 isVisible ($a_ref_id, $a_type)
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 

Static Public Member Functions

static _goto ($a_target)
 Deep link. More...
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Protected Member Functions

 addContentSubTabs ($a_show_settings)
 Add content subtabs. More...
 
 enableAdminPanel ()
 Enable admin panel. More...
 
 disableAdminPanel ()
 Disable admin panel. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getRequestItemIds ()
 Get requested item ids. More...
 
 passwordForm ($a_node_id, $form=null)
 
 initPasswordForm ($a_node_id)
 
 checkPassword ()
 
 deleteConfirmation ()
 Display delete confirmation form (workspace specific) More...
 
 setSortation ()
 Set sortation. More...
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $help
 
 $tabs
 
 $ui
 
 $user_folder_settings
 
 $requested_sortation
 
 $wsp_log
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

Additional Inherited Members

- Data Fields inherited from ilObject2GUI
 $tree
 
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjWorkspaceFolderGUI::__construct (   $a_id = 0,
  $a_id_type = self::REPOSITORY_NODE_ID,
  $a_parent_node_id = 0 
)

Constructor.

Reimplemented from ilObject2GUI.

Reimplemented in ilObjWorkspaceRootFolderGUI.

Definition at line 53 of file class.ilObjWorkspaceFolderGUI.php.

54 {
55 global $DIC;
56 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
57
58 $this->lng = $DIC->language();
59 $this->help = $DIC["ilHelp"];
60 $this->tpl = $DIC["tpl"];
61 $this->user = $DIC->user();
62 $this->tabs = $DIC->tabs();
63 $this->ctrl = $DIC->ctrl();
64 $this->ui = $DIC->ui();
65
66 $this->wsp_log = ilLoggerFactory::getLogger("pwsp");
67
68 $this->user_folder_settings = new ilWorkspaceFolderUserSettings(
69 $this->user->getId(),
71 );
72
73 $this->requested_sortation = (int) $_GET["sortation"];
74
75 $this->lng->loadLanguageModule("cntr");
76 }
user()
Definition: user.php:4
$_GET["client_id"]
static getLogger($a_component_id)
Get component logger.
Stores user settings per workspace folder Table: wfld_user_setting (rw)
User settings for workspace folders.
help()
Definition: help.php:2
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
ui()
Definition: ui.php:5
$DIC
Definition: xapitoken.php:46

References $_GET, $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilLoggerFactory\getLogger(), help(), ui(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjWorkspaceFolderGUI::_goto (   $a_target)
static

Deep link.

Parameters
string$a_target

Definition at line 901 of file class.ilObjWorkspaceFolderGUI.php.

902 {
903 $id = explode("_", $a_target);
904
905 $_GET["baseClass"] = "ilsharedresourceGUI";
906 $_GET["wsp_id"] = $id[0];
907 include("ilias.php");
908 exit;
909 }
exit
Definition: login.php:29

References $_GET, and exit.

◆ addContentSubTabs()

ilObjWorkspaceFolderGUI::addContentSubTabs (   $a_show_settings)
protected

Add content subtabs.

Definition at line 146 of file class.ilObjWorkspaceFolderGUI.php.

147 {
151
152 if ($this->checkPermissionBool("read")) {
153 $tabs->addSubTab("content", $lng->txt("view"), $ctrl->getLinkTarget($this, "disableAdminPanel"));
154 $tabs->addSubTab("manage", $lng->txt("cntr_manage"), $ctrl->getLinkTarget($this, "enableAdminPanel"));
155 }
156
157 if ($this->checkPermissionBool("write") && $a_show_settings) {
158 $this->tabs_gui->addSubTab(
159 "settings",
160 $lng->txt("settings"),
161 $this->ctrl->getLinkTarget($this, "edit")
162 );
163 }
164
165 if ($this->isActiveAdministrationPanel()) {
166 $tabs->activateSubTab("manage");
167 } else {
168 $tabs->activateSubTab("content");
169 }
170 }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, $tabs, ilObject2GUI\checkPermissionBool(), and isActiveAdministrationPanel().

Referenced by setTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyShareFilter()

ilObjWorkspaceFolderGUI::applyShareFilter ( )

Definition at line 797 of file class.ilObjWorkspaceFolderGUI.php.

798 {
799 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
800 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
801 $tbl->resetOffset();
802 $tbl->writeFilterToSession();
803
804 $this->share();
805 }
getAccessHandler()
Get access handler.
Workspace share handler table GUI class.

References ilObject2GUI\getAccessHandler(), and share().

+ Here is the call graph for this function:

◆ cancelDeletion()

ilObjWorkspaceFolderGUI::cancelDeletion ( )
Parameters

return

Definition at line 992 of file class.ilObjWorkspaceFolderGUI.php.

993 {
994 unset($_SESSION['clipboard']['cmd']);
995 unset($_SESSION['clipboard']['source_ids']);
996 unset($_SESSION['clipboard']['wsp2repo']);
997 unset($_SESSION['clipboard']['shared']);
998 parent::cancelDelete();
999 }
$_SESSION["AccountId"]

References $_SESSION.

◆ checkPassword()

ilObjWorkspaceFolderGUI::checkPassword ( )
protected

Definition at line 865 of file class.ilObjWorkspaceFolderGUI.php.

866 {
868
869 $node_id = $_REQUEST["item_ref_id"];
870 if (!$node_id) {
871 $this->ctrl->redirect($this, "share");
872 }
873
874 $form = $this->initPasswordForm($node_id);
875 if ($form->checkInput()) {
876 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
878 $input = md5($form->getInput("password"));
879 if ($input == $password) {
880 // we save password and start over
882
883 $this->ctrl->setParameter($this, "item_ref_id", $node_id);
884 $this->ctrl->redirect($this, "copyShared");
885 } else {
886 $item = $form->getItemByPostVar("password");
887 $item->setAlert($lng->txt("wsp_invalid_password"));
888 ilUtil::sendFailure($lng->txt("form_input_not_valid"));
889 }
890 }
891
892 $form->setValuesByPost();
893 $this->passwordForm($node_id, $form);
894 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static keepSharedSessionPassword($a_node_id, $a_password)
$password
Definition: cron.php:14

References ilObjectGUI\$lng, ilObject2GUI\$node_id, $password, ilWorkspaceAccessHandler\getSharedNodePassword(), initPasswordForm(), ilWorkspaceAccessHandler\keepSharedSessionPassword(), passwordForm(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ copy()

ilObjWorkspaceFolderGUI::copy ( )

Copy node preparation.

cioy object(s) out from a container and write the information to clipboard

Definition at line 408 of file class.ilObjWorkspaceFolderGUI.php.

409 {
411
412 $item_ids = $this->getRequestItemIds();
413 if (count($item_ids) == 0) {
414 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
415 $this->ctrl->redirect($this);
416 }
417
418 // on cancel or fail we return to parent node
419 $this->ctrl->setParameter($this, "wsp_id", $this->node_id);
420
421 $repo_switch_allowed = true;
422 foreach ($item_ids as $item_id) {
423 $node = $this->tree->getNodeData($item_id);
424 if (ilObject::_lookupType($node["obj_id"]) != "file") {
425 $repo_switch_allowed = false;
426 }
427 $current_node = $item_id;
428 $owner = $this->tree->lookupOwner($current_node);
429 if ($owner == $ilUser->getId()) {
430 // open current position
431 // using the explorer session storage directly is basically a hack
432 // as we do not use setExpanded() [see below]
433 $_SESSION['paste_copy_wspexpand'] = array();
434 foreach ((array) $this->tree->getPathId($item_id) as $node_id) {
435 $_SESSION['paste_copy_wspexpand'][] = $node_id;
436 }
437 } else {
438 // see copyShared()
439 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
440 $this->ctrl->redirect($this);
441 }
442 }
443
444 // remember source node
445 $_SESSION['clipboard']['source_ids'] = $item_ids;
446 $_SESSION['clipboard']['cmd'] = 'copy';
447
448 return $this->showMoveIntoObjectTree($repo_switch_allowed);
449 }
showMoveIntoObjectTree($repo_switch_allowed=false)
Move node: select target (via explorer)
getRequestItemIds()
Get requested item ids.
static _lookupType($a_id, $a_reference=false)
lookup object type
$ilUser
Definition: imgupload.php:18

References $_SESSION, $ilUser, ilObject2GUI\$node_id, ilObjectGUI\$user, ilObject\_lookupType(), getRequestItemIds(), ilUtil\sendFailure(), and showMoveIntoObjectTree().

Referenced by copy_to_repository(), and copy_to_workspace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_to_repository()

ilObjWorkspaceFolderGUI::copy_to_repository ( )

Copy node preparation (to repository)

copy object(s) out from a container and write the information to clipboard

Definition at line 483 of file class.ilObjWorkspaceFolderGUI.php.

484 {
485 $_SESSION['clipboard']['wsp2repo'] = true;
486 $this->copy();
487 }

References $_SESSION, and copy().

+ Here is the call graph for this function:

◆ copy_to_workspace()

ilObjWorkspaceFolderGUI::copy_to_workspace ( )

Copy node preparation (to repository)

copy object(s) out from a container and write the information to clipboard

Definition at line 494 of file class.ilObjWorkspaceFolderGUI.php.

495 {
496 $_SESSION['clipboard']['wsp2repo'] = false;
497 $this->copy();
498 }

References $_SESSION, and copy().

+ Here is the call graph for this function:

◆ copyShared()

ilObjWorkspaceFolderGUI::copyShared ( )

Definition at line 451 of file class.ilObjWorkspaceFolderGUI.php.

452 {
453 if (!$_REQUEST["item_ref_id"]) {
454 $this->ctrl->redirect($this, "share");
455 }
456
457 $current_node = $_REQUEST["item_ref_id"];
458 $handler = $this->getAccessHandler();
459 // see ilSharedRessourceGUI::hasAccess()
460 if ($handler->checkAccess("read", "", $current_node)) {
461 // remember source node
462 $_SESSION['clipboard']['source_ids'] = [$current_node];
463 $_SESSION['clipboard']['cmd'] = 'copy';
464 $_SESSION['clipboard']['shared'] = true;
465
466 return $this->showMoveIntoObjectTree();
467 } else {
468 $perms = $handler->getPermissions($current_node);
469 if (in_array(ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD, $perms)) {
470 return $this->passwordForm($current_node);
471 }
472 }
473
474 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
475 $this->ctrl->redirect($this, "share");
476 }

References $_SESSION, ilObject2GUI\getAccessHandler(), passwordForm(), ilWorkspaceAccessGUI\PERMISSION_ALL_PASSWORD, ilUtil\sendFailure(), and showMoveIntoObjectTree().

+ Here is the call graph for this function:

◆ cut()

ilObjWorkspaceFolderGUI::cut ( )

Move node preparation.

cut object(s) out from a container and write the information to clipboard

Definition at line 332 of file class.ilObjWorkspaceFolderGUI.php.

333 {
334 $item_ids = $this->getRequestItemIds();
335 if (count($item_ids) == 0) {
336 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
337 $this->ctrl->redirect($this);
338 }
339
340 //$current_node = $_REQUEST["item_ref_id"];
341 //$parent_node = $this->tree->getParentId($current_node);
342
343 // on cancel or fail we return to parent node
344 //$this->ctrl->setParameter($this, "wsp_id", $parent_node);
345
346 // check permission
347 $no_cut = array();
348 $repo_switch_allowed = true;
349 foreach ($item_ids as $item_id) {
350 foreach ($this->tree->getSubTree($this->tree->getNodeData($item_id)) as $node) {
351 if (ilObject::_lookupType($node["obj_id"]) != "file") {
352 $repo_switch_allowed = false;
353 }
354 if (!$this->checkPermissionBool("delete", "", "", $node["wsp_id"])) {
355 $obj = ilObjectFactory::getInstanceByObjId($node["obj_id"]);
356 $no_cut[$node["wsp_id"]] = $obj->getTitle();
357 unset($obj);
358 }
359 }
360 }
361 if (count($no_cut)) {
362 ilUtil::sendFailure($this->lng->txt("msg_no_perm_cut") . " " . implode(',', $no_cut), true);
363 $this->ctrl->redirect($this);
364 }
365
366 // open current position
367 // using the explorer session storage directly is basically a hack
368 // as we do not use setExpanded() [see below]
369 $_SESSION['paste_cut_wspexpand'] = array();
370 foreach ((array) $this->tree->getPathId($this->node_id) as $node_id) {
371 $_SESSION['paste_cut_wspexpand'][] = $node_id;
372 }
373
374 // remember source node
375 $_SESSION['clipboard']['source_ids'] = $item_ids;
376 $_SESSION['clipboard']['cmd'] = 'cut';
377
378 return $this->showMoveIntoObjectTree($repo_switch_allowed);
379 }
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id

References $_SESSION, ilObject2GUI\$node_id, ilObject\_lookupType(), ilObject2GUI\checkPermissionBool(), ilObjectFactory\getInstanceByObjId(), getRequestItemIds(), ilUtil\sendFailure(), and showMoveIntoObjectTree().

Referenced by cut_for_repository(), and cut_for_workspace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cut_for_repository()

ilObjWorkspaceFolderGUI::cut_for_repository ( )

Move node preparation (to workspace)

cut object(s) out from a container and write the information to clipboard

Definition at line 386 of file class.ilObjWorkspaceFolderGUI.php.

387 {
388 $_SESSION['clipboard']['wsp2repo'] = true;
389 $this->cut();
390 }

References $_SESSION, and cut().

+ Here is the call graph for this function:

◆ cut_for_workspace()

ilObjWorkspaceFolderGUI::cut_for_workspace ( )

Move node preparation (to workspace)

cut object(s) out from a container and write the information to clipboard

Definition at line 397 of file class.ilObjWorkspaceFolderGUI.php.

398 {
399 $_SESSION['clipboard']['wsp2repo'] = false;
400 $this->cut();
401 }

References $_SESSION, and cut().

+ Here is the call graph for this function:

◆ deleteConfirmation()

ilObjWorkspaceFolderGUI::deleteConfirmation ( )
protected

Display delete confirmation form (workspace specific)

This should probably be moved elsewhere as done with RepUtil

Definition at line 932 of file class.ilObjWorkspaceFolderGUI.php.

933 {
934 global $DIC;
935
936 $tpl = $DIC["tpl"];
937 $lng = $DIC["lng"];
938
939 $item_ids = $this->getRequestItemIds();
940
941 if (count($item_ids) == 0) {
942 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
943 $this->ctrl->redirect($this, "");
944 }
945
946 // on cancel or fail we return to parent node
947 //$parent_node = $this->tree->getParentId($node_id);
948 //$this->ctrl->setParameter($this, "wsp_id", $parent_node);
949
950 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
951 $cgui = new ilConfirmationGUI();
952 $cgui->setHeaderText($lng->txt("info_delete_sure") . "<br/>" .
953 $lng->txt("info_delete_warning_no_trash"));
954
955 $cgui->setFormAction($this->ctrl->getFormAction($this));
956 $cgui->setCancel($lng->txt("cancel"), "cancelDeletion");
957 $cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
958
959 foreach ($item_ids as $node_id) {
960 $children = $this->tree->getSubTree($this->tree->getNodeData($node_id));
961 foreach ($children as $child) {
962 $node_id = $child["wsp_id"];
963 $obj_id = $this->tree->lookupObjectId($node_id);
965 $title = call_user_func(array(ilObjectFactory::getClassByType($type),'_lookupTitle'), $obj_id);
966
967 // if anything fails, abort the whole process
968 if (!$this->checkPermissionBool("delete", "", "", $node_id)) {
969 ilUtil::sendFailure($lng->txt("msg_no_perm_delete") . " " . $title, true);
970 $this->ctrl->redirect($this);
971 }
972
973 $cgui->addItem(
974 "id[]",
975 $node_id,
976 $title,
977 ilObject::_getIcon($obj_id, "small", $type),
978 $lng->txt("icon") . " " . $lng->txt("obj_" . $type)
979 );
980 }
981 }
982
983 $tpl->setContent($cgui->getHTML());
984 }
Confirmation screen class.
static getClassByType($a_obj_type)
Get class by type.
$type

References $DIC, ilObjectGUI\$lng, ilObject2GUI\$node_id, ilObjectGUI\$obj_id, ilObjectGUI\$tpl, $type, ilObject\_lookupType(), ilObject2GUI\checkPermissionBool(), ilObjectFactory\getClassByType(), getRequestItemIds(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ disableAdminPanel()

ilObjWorkspaceFolderGUI::disableAdminPanel ( )
protected

Disable admin panel.

Definition at line 184 of file class.ilObjWorkspaceFolderGUI.php.

185 {
186 $this->setAdministrationPanel(false);
187 $this->ctrl->redirect($this, "");
188 }

References setAdministrationPanel().

+ Here is the call graph for this function:

◆ download()

ilObjWorkspaceFolderGUI::download ( )

Definition at line 1129 of file class.ilObjWorkspaceFolderGUI.php.

1130 {
1131 // This variable determines whether the task has been initiated by a folder's action drop-down to prevent a folder
1132 // duplicate inside the zip.
1133 $initiated_by_folder_action = false;
1134
1135 if ($_GET["item_ref_id"] != "") {
1136 $_POST["id"] = array($_GET["item_ref_id"]);
1137 }
1138
1139 if (!isset($_POST["id"])) {
1140 /*$object = ilObjectFactory::getInstanceByRefId($_GET['ref_id']);
1141 $object_type = $object->getType();
1142 if($object_type == "fold")
1143 {
1144 $_POST["id"] = array($_GET['ref_id']);
1145 $initiated_by_folder_action = true;
1146 }
1147 else
1148 {
1149 $ilErr->raiseError($this->lng->txt("no_checkbox"), $ilErr->MESSAGE);
1150 }
1151 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);*/
1152 $this->ctrl->redirect($this, "");
1153 }
1154
1155 $download_job = new ilDownloadWorkspaceFolderBackgroundTask($GLOBALS['DIC']->user()->getId(), $_POST["id"], $initiated_by_folder_action);
1156
1157 $download_job->setBucketTitle($this->getBucketTitle());
1158 if ($download_job->run()) {
1159 ilUtil::sendSuccess($this->lng->txt('msg_bt_download_started'), true);
1160 }
1161 $this->ctrl->redirect($this);
1162 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$_POST["username"]

References $_GET, $_POST, $GLOBALS, getBucketTitle(), and user().

+ Here is the call graph for this function:

◆ edit()

ilObjWorkspaceFolderGUI::edit ( )

Reimplemented from ilObject2GUI.

Definition at line 292 of file class.ilObjWorkspaceFolderGUI.php.

293 {
294 parent::edit();
295
296 $this->tabs_gui->activateTab("wsp");
297 $this->tabs_gui->activateSubTab("settings");
298 }

◆ enableAdminPanel()

ilObjWorkspaceFolderGUI::enableAdminPanel ( )
protected

Enable admin panel.

Definition at line 175 of file class.ilObjWorkspaceFolderGUI.php.

176 {
177 $this->setAdministrationPanel(true);
178 $this->ctrl->redirect($this, "");
179 }

References setAdministrationPanel().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjWorkspaceFolderGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

Definition at line 190 of file class.ilObjWorkspaceFolderGUI.php.

191 {
192 $next_class = $this->ctrl->getNextClass($this);
193 $cmd = $this->ctrl->getCmd();
194
195 switch ($next_class) {
196 case "ilcommonactiondispatchergui":
197 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
199 $this->ctrl->forwardCommand($gui);
200 break;
201
202 case "ilobjectownershipmanagementgui":
203 $this->prepareOutput();
204 $this->tabs_gui->activateTab("ownership");
205 include_once("Services/Object/classes/class.ilObjectOwnershipManagementGUI.php");
207 $this->ctrl->forwardCommand($gui);
208 break;
209
210 default:
211 $this->prepareOutput();
212 if ($this->type != "wsrt") {
213 $this->addHeaderAction();
214 }
215 if (!$cmd) {
216 $cmd = "render";
217 }
218 $this->$cmd();
219 break;
220 }
221
222 return true;
223 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
prepareOutput($a_show_subobjects=true)
prepare output
addHeaderAction()
Add header action menu.
Class ilObjectOwnershipManagementGUI.

References ilObjectGUI\addHeaderAction(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), and ilObject2GUI\prepareOutput().

+ Here is the call graph for this function:

◆ getBucketTitle()

ilObjWorkspaceFolderGUI::getBucketTitle ( )

Definition at line 1164 of file class.ilObjWorkspaceFolderGUI.php.

1165 {
1166 return $bucket_title = ilUtil::getAsciiFilename($this->object->getTitle());
1167 }

Referenced by download().

+ Here is the caller graph for this function:

◆ getRequestItemIds()

ilObjWorkspaceFolderGUI::getRequestItemIds ( )
protected

Get requested item ids.

Returns
array

Definition at line 313 of file class.ilObjWorkspaceFolderGUI.php.

314 {
315 if (is_string($_REQUEST["item_ref_id"]) && $_REQUEST["item_ref_id"] != "") {
316 return [(int) $_REQUEST["item_ref_id"]];
317 } elseif (is_array($_POST["id"])) {
318 return array_map(function ($i) {
319 return (int) $i;
320 }, $_POST["id"]);
321 }
322 return [];
323 }
$i
Definition: metadata.php:24

References $_POST, and $i.

Referenced by copy(), cut(), deleteConfirmation(), and showMoveIntoObjectTree().

+ Here is the caller graph for this function:

◆ getType()

ilObjWorkspaceFolderGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

Reimplemented in ilObjWorkspaceRootFolderGUI.

Definition at line 78 of file class.ilObjWorkspaceFolderGUI.php.

79 {
80 return "wfld";
81 }

◆ initCreationForms()

ilObjWorkspaceFolderGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObject2GUI.

Definition at line 225 of file class.ilObjWorkspaceFolderGUI.php.

226 {
227 $forms = array(
228 self::CFORM_NEW => $this->initCreateForm($a_new_type)
229 );
230
231 return $forms;
232 }
initCreateForm($a_new_type)
Init object creation form.

References ilObjectGUI\initCreateForm().

+ Here is the call graph for this function:

◆ initPasswordForm()

ilObjWorkspaceFolderGUI::initPasswordForm (   $a_node_id)
protected

Definition at line 839 of file class.ilObjWorkspaceFolderGUI.php.

840 {
843
844 $this->ctrl->setParameter($this, "item_ref_id", $a_node_id);
845
846 $object_data = $this->getAccessHandler()->getObjectDataFromNode($a_node_id);
847
848 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
849 $form = new ilPropertyFormGUI();
850 $form->setFormAction($ilCtrl->getFormAction($this, "checkPassword"));
851 $form->setTitle($lng->txt("wsp_password_for") . ": " . $object_data["title"]);
852
853 $password = new ilPasswordInputGUI($lng->txt("password"), "password");
854 $password->setRetype(false);
855 $password->setRequired(true);
856 $password->setSkipSyntaxCheck(true);
857 $form->addItem($password);
858
859 $form->addCommandButton("checkPassword", $lng->txt("submit"));
860 $form->addCommandButton("share", $lng->txt("cancel"));
861
862 return $form;
863 }
This class represents a password property in a property form.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $password, and ilObject2GUI\getAccessHandler().

Referenced by checkPassword(), and passwordForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActiveAdministrationPanel()

ilObjWorkspaceFolderGUI::isActiveAdministrationPanel ( )
Returns
bool

Definition at line 129 of file class.ilObjWorkspaceFolderGUI.php.

130 {
131 return (bool) $_SESSION["il_wsp_admin_panel"];
132 }

References $_SESSION.

Referenced by addContentSubTabs(), render(), and showAdministrationPanel().

+ Here is the caller graph for this function:

◆ listSharedResourcesOfOtherUser()

ilObjWorkspaceFolderGUI::listSharedResourcesOfOtherUser ( )

Entry point for awareness tool.

Definition at line 914 of file class.ilObjWorkspaceFolderGUI.php.

915 {
917
918 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
919 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
920 $tbl->resetOffset();
921 $tbl->resetFilter();
922 $_POST["user"] = $_GET["user"];
923 $tbl->writeFilterToSession();
924 $this->share();
925 }

References $_GET, $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObject2GUI\getAccessHandler(), and share().

+ Here is the call graph for this function:

◆ passwordForm()

ilObjWorkspaceFolderGUI::passwordForm (   $a_node_id,
  $form = null 
)
protected

Definition at line 817 of file class.ilObjWorkspaceFolderGUI.php.

818 {
821 $ilTabs = $this->tabs;
822
823 $tpl->setTitle($lng->txt("wsp_password_protected_resource"));
824 $tpl->setDescription($lng->txt("wsp_password_protected_resource_info"));
825
826 $ilTabs->clearTargets();
827 $ilTabs->setBackTarget(
828 $lng->txt("back"),
829 $this->ctrl->getLinkTarget($this, "share")
830 );
831
832 if (!$form) {
833 $form = $this->initPasswordForm($a_node_id);
834 }
835
836 $tpl->setContent($form->getHTML());
837 }

References ilObjectGUI\$lng, $tabs, ilObjectGUI\$tpl, and initPasswordForm().

Referenced by checkPassword(), and copyShared().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performPasteIntoMultipleObjects()

ilObjWorkspaceFolderGUI::performPasteIntoMultipleObjects ( )

Move node: target has been selected, execute.

Definition at line 617 of file class.ilObjWorkspaceFolderGUI.php.

618 {
620
621 $mode = $_SESSION['clipboard']['cmd'];
622 $source_node_ids = $_SESSION['clipboard']['source_ids'];
623 $target_node_id = $_REQUEST['node'];
624
625 if (!is_array($source_node_ids) || count($source_node_ids) == 0) {
626 ilUtil::sendFailure($this->lng->txt('select_at_least_one_object'), true);
627 $this->ctrl->redirect($this);
628 }
629 if (!$target_node_id) {
630 ilUtil::sendFailure($this->lng->txt('select_at_least_one_object'), true);
631 $this->ctrl->redirect($this, "showMoveIntoObjectTree");
632 }
633
634 if (!$_SESSION['clipboard']['wsp2repo']) {
635 $target_obj_id = $this->tree->lookupObjectId($target_node_id);
636 } else {
637 $target_obj_id = ilObject::_lookupObjId($target_node_id);
638 }
639 $target_object = ilObjectFactory::getInstanceByObjId($target_obj_id);
640
641 $fail = array();
642 foreach ($source_node_ids as $source_node_id) {
643 // object instances
644 $source_obj_id = $this->tree->lookupObjectId($source_node_id);
645 $source_object = ilObjectFactory::getInstanceByObjId($source_obj_id);
646
647
648 // sanity checks
649 if ($source_node_id == $target_node_id) {
650 $fail[] = sprintf(
651 $this->lng->txt('msg_obj_exists_in_folder'),
652 $source_object->getTitle(),
653 $target_object->getTitle()
654 );
655 }
656
657 if (!in_array($source_object->getType(), array_keys($target_object->getPossibleSubObjects()))) {
658 $fail[] = sprintf(
659 $this->lng->txt('msg_obj_may_not_contain_objects_of_type'),
660 $target_object->getTitle(),
661 $source_object->getType()
662 );
663 }
664
665 // if object is shared permission to copy has been checked above
666 $owner = $this->tree->lookupOwner($source_node_id);
667 if ($mode == "copy" && $ilUser->getId() == $owner && !$this->checkPermissionBool('copy', '', '', $source_node_id)) {
668 $fail[] = $this->lng->txt('permission_denied');
669 }
670
671 if (!$_SESSION['clipboard']['wsp2repo']) {
672 if ($mode == "cut" && $this->tree->isGrandChild($source_node_id, $target_node_id)) {
673 $fail[] = sprintf(
674 $this->lng->txt('msg_paste_object_not_in_itself'),
675 $source_object->getTitle()
676 );
677 }
678 }
679
680 if ($_SESSION['clipboard']['wsp2repo'] == true) { // see #22959
681 global $ilAccess;
682 if (!$ilAccess->checkAccess("create", "", $target_node_id, $source_object->getType())) {
683 $fail[] = sprintf(
684 $this->lng->txt('msg_no_perm_paste_object_in_folder'),
685 $source_object->getTitle(),
686 $target_object->getTitle()
687 );
688 }
689 } else {
690 if (!$this->checkPermissionBool('create', '', $source_object->getType(), $target_node_id)) {
691 $fail[] = sprintf(
692 $this->lng->txt('msg_no_perm_paste_object_in_folder'),
693 $source_object->getTitle(),
694 $target_object->getTitle()
695 );
696 }
697 }
698 }
699
700 if (sizeof($fail)) {
701 ilUtil::sendFailure(implode("<br />", $fail), true);
702 $this->ctrl->redirect($this);
703 }
704
705 foreach ($source_node_ids as $source_node_id) {
706 $source_tree = $this->tree;
707 if ($ilUser->getId() != $owner && $mode == "copy") {
708 $source_tree = new ilWorkspaceTree($owner);
709 }
710 $node_data = $source_tree->getNodeData($source_node_id);
711 $source_object = ilObjectFactory::getInstanceByObjId($node_data["obj_id"]);
712
713 // move the node
714 if ($mode == "cut") {
715 if (!$_SESSION['clipboard']['wsp2repo']) {
716 $this->tree->moveTree($source_node_id, $target_node_id);
717 } else {
718 $parent_id = $this->tree->getParentId($source_node_id);
719
720 // remove from personal workspace
721 $this->getAccessHandler()->removePermission($source_node_id);
722 $this->tree->deleteReference($source_node_id);
723 $source_node = $this->tree->getNodeData($source_node_id);
724 $this->tree->deleteTree($source_node);
725
726 // add to repository
727 $source_object->createReference();
728 $source_object->putInTree($target_node_id);
729 $source_object->setPermissions($target_node_id);
730
731 $source_node_id = $parent_id;
732 }
733 } // copy the node
734 elseif ($mode == "copy") {
735 include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
737 $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
738 $this->wsp_log->debug("Copy ID: " . $copy_id . ", Source Node: " . $source_node_id
739 . ", source object: " . $source_object->getId());
740 if (!$_SESSION['clipboard']['wsp2repo']) {
741 $wizard_options->disableTreeCopy();
742 }
743 $wizard_options->saveOwner($ilUser->getId());
744 $wizard_options->saveRoot($source_node_id);
745 $wizard_options->read();
746
747 $new_obj = $source_object->cloneObject($target_node_id, $copy_id);
748 // insert into workspace tree
749 if ($new_obj && !$_SESSION['clipboard']['wsp2repo']) {
750 $this->wsp_log->debug("New Obj ID: " . $new_obj->getId());
751 $new_obj_node_id = $this->tree->insertObject($target_node_id, $new_obj->getId());
752 $this->getAccessHandler()->setPermissions($target_node_id, $new_obj_node_id);
753 }
754
755 $wizard_options->deleteAll();
756 }
757 }
758
759 // redirect to target if not repository
760 if (!$_SESSION['clipboard']['wsp2repo']) {
761 $redirect_node = $target_node_id;
762 } else {
763 // reload current folder
764 $redirect_node = $this->node_id;
765 }
766
767 unset($_SESSION['clipboard']['cmd']);
768 unset($_SESSION['clipboard']['source_ids']);
769 unset($_SESSION['clipboard']['wsp2repo']);
770 unset($_SESSION['clipboard']['shared']);
771
772 // #17746
773 if ($mode == 'cut') {
774 ilUtil::sendSuccess($this->lng->txt('msg_cut_copied'), true);
775 } else {
776 ilUtil::sendSuccess($this->lng->txt('msg_cloned'), true);
777 }
778
779 $this->ctrl->setParameter($this, "wsp_id", $redirect_node);
780 $this->ctrl->redirect($this);
781 }
static _allocateCopyId()
Allocate a copy for further entries.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static _lookupObjId($a_id)
Tree handler for personal workspace.

References $_SESSION, $ilUser, ilObject2GUI\$node_id, ilObject2GUI\$parent_id, ilObject2GUI\$tree, ilObjectGUI\$user, ilCopyWizardOptions\_allocateCopyId(), ilCopyWizardOptions\_getInstance(), ilObject\_lookupObjId(), ilObject2GUI\checkPermissionBool(), ilObject2GUI\getAccessHandler(), ilObjectFactory\getInstanceByObjId(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ render()

ilObjWorkspaceFolderGUI::render ( )

Render folder.

Definition at line 237 of file class.ilObjWorkspaceFolderGUI.php.

238 {
241 $ilTabs = $this->tabs;
243
244 //$this->addContentSubTabs();
246
247 unset($_SESSION['clipboard']['wsp2repo']);
248
249 // add new item
250 include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
251 $gui = new ilObjectAddNewItemGUI($this->node_id);
253 $gui->setCreationUrl($ilCtrl->getLinkTarget($this, "create"));
254 $gui->render();
255
256 include_once "Services/Object/classes/class.ilObjectListGUI.php";
258 "",
259 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
260 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
261 );
262
263 include_once "Modules/WorkspaceFolder/classes/class.ilWorkspaceContentGUI.php";
264 $gui = new ilWorkspaceContentGUI(
265 $this,
266 $this->node_id,
268 $this->getAccessHandler(),
269 $this->ui,
270 $this->lng,
271 $this->user,
272 $this->objDefinition,
273 $this->ctrl,
274 $this->user_folder_settings
275 );
276 $tpl->setContent($gui->render());
277
278 include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorerGUI.php");
279 $exp = new ilWorkspaceExplorerGUI($ilUser->getId(), $this, "render", $this, "", "wsp_id");
280 $exp->setTypeWhiteList(array("wsrt", "wfld"));
281 $exp->setSelectableTypes(array("wsrt", "wfld"));
282 $exp->setLinkToNodeClass(true);
283 $exp->setActivateHighlighting(true);
284 if ($exp->handleCommand()) {
285 return;
286 }
287 $left = $exp->getHTML();
288
289 $tpl->setLeftNavContent($left);
290 }
showAdministrationPanel()
show administration panel
Render add new item selector.
static prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl=null)
Insert js/ajax links into template.
Workspace content renderer.
Explorer for selecting a personal workspace item.

References $_SESSION, ilObjectGUI\$ctrl, $ilCtrl, $ilUser, $tabs, ilObjectGUI\$tpl, ilObjectGUI\$user, ilObject2GUI\getAccessHandler(), isActiveAdministrationPanel(), ilObjectDefinition\MODE_WORKSPACE, ilObjectListGUI\prepareJsLinks(), showAdministrationPanel(), ui(), and user().

+ Here is the call graph for this function:

◆ resetShareFilter()

ilObjWorkspaceFolderGUI::resetShareFilter ( )

Definition at line 807 of file class.ilObjWorkspaceFolderGUI.php.

808 {
809 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
810 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
811 $tbl->resetOffset();
812 $tbl->resetFilter();
813
814 $this->shareFilter();
815 }

References ilObject2GUI\getAccessHandler(), and shareFilter().

+ Here is the call graph for this function:

◆ setAdministrationPanel()

ilObjWorkspaceFolderGUI::setAdministrationPanel ( bool  $active)
Parameters
bool$active
Returns
bool

Definition at line 138 of file class.ilObjWorkspaceFolderGUI.php.

139 {
140 return $_SESSION["il_wsp_admin_panel"] = $active;
141 }

References $_SESSION.

Referenced by disableAdminPanel(), and enableAdminPanel().

+ Here is the caller graph for this function:

◆ setSortation()

ilObjWorkspaceFolderGUI::setSortation ( )
protected

Set sortation.

Definition at line 1123 of file class.ilObjWorkspaceFolderGUI.php.

1124 {
1125 $this->user_folder_settings->updateSortation($this->object->getId(), $this->requested_sortation);
1126 $this->ctrl->redirect($this, "");
1127 }

◆ setTabs()

ilObjWorkspaceFolderGUI::setTabs (   $a_show_settings = true)

Reimplemented in ilObjWorkspaceRootFolderGUI.

Definition at line 83 of file class.ilObjWorkspaceFolderGUI.php.

84 {
86 $ilHelp = $this->help;
87
88 $ilHelp->setScreenIdComponent("wfld");
89
90 $this->ctrl->setParameter($this, "wsp_id", $this->node_id);
91
92 $this->tabs_gui->addTab(
93 "wsp",
94 $lng->txt("wsp_tab_personal"),
95 $this->ctrl->getLinkTarget($this, "")
96 );
97
98 $this->ctrl->setParameterByClass(
99 "ilObjWorkspaceRootFolderGUI",
100 "wsp_id",
101 $this->getAccessHandler()->getTree()->getRootId()
102 );
103
104 $this->tabs_gui->addTab(
105 "share",
106 $lng->txt("wsp_tab_shared"),
107 $this->ctrl->getLinkTargetByClass("ilObjWorkspaceRootFolderGUI", "shareFilter")
108 );
109
110 $this->tabs_gui->addTab(
111 "ownership",
112 $lng->txt("wsp_tab_ownership"),
113 $this->ctrl->getLinkTargetByClass(array("ilObjWorkspaceRootFolderGUI", "ilObjectOwnershipManagementGUI"), "listObjects")
114 );
115
116 if (!$this->ctrl->getNextClass($this)) {
117 if (stristr($this->ctrl->getCmd(), "share")) {
118 $this->tabs_gui->activateTab("share");
119 } else {
120 $this->tabs_gui->activateTab("wsp");
121 $this->addContentSubTabs($a_show_settings);
122 }
123 }
124 }
addContentSubTabs($a_show_settings)
Add content subtabs.

References $help, ilObjectGUI\$lng, addContentSubTabs(), and ilObject2GUI\getAccessHandler().

+ Here is the call graph for this function:

◆ share()

ilObjWorkspaceFolderGUI::share (   $a_load_data = true)

Definition at line 788 of file class.ilObjWorkspaceFolderGUI.php.

789 {
791
792 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
793 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id, $a_load_data);
794 $tpl->setContent($tbl->getHTML());
795 }

References ilObjectGUI\$tpl, and ilObject2GUI\getAccessHandler().

Referenced by applyShareFilter(), listSharedResourcesOfOtherUser(), and shareFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shareFilter()

ilObjWorkspaceFolderGUI::shareFilter ( )

Definition at line 783 of file class.ilObjWorkspaceFolderGUI.php.

784 {
785 $this->share(false);
786 }

References share().

Referenced by resetShareFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showAdministrationPanel()

ilObjWorkspaceFolderGUI::showAdministrationPanel ( )

show administration panel

Definition at line 1009 of file class.ilObjWorkspaceFolderGUI.php.

1010 {
1011 global $DIC;
1012
1013 $ilAccess = $this->access;
1014 $lng = $this->lng;
1015
1016 $main_tpl = $DIC->ui()->mainTemplate();
1017
1018 $lng->loadLanguageModule('cntr');
1019
1020 if ($_SESSION["wsp_clipboard"]) {
1021 // #11545
1022 $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
1023
1024 include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1025 $toolbar = new ilToolbarGUI();
1026 $this->ctrl->setParameter($this, "type", "");
1027 $this->ctrl->setParameter($this, "item_ref_id", "");
1028
1029 $toolbar->addFormButton(
1030 $this->lng->txt('paste_clipboard_items'),
1031 'paste'
1032 );
1033
1034 $toolbar->addFormButton(
1035 $this->lng->txt('clear_clipboard'),
1036 'clear'
1037 );
1038
1039 $main_tpl->addAdminPanelToolbar($toolbar, true, false);
1040 } elseif ($this->isActiveAdministrationPanel()) {
1041 // #11545
1042 $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
1043
1044 include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1045 $toolbar = new ilToolbarGUI();
1046 $this->ctrl->setParameter($this, "type", "");
1047 $this->ctrl->setParameter($this, "item_ref_id", "");
1048
1049 // if (!$_SESSION["clipboard"])
1050 // {
1051 if ($this->object->gotItems($this->node_id)) {
1052 $toolbar->setLeadingImage(
1053 ilUtil::getImagePath("arrow_upright.svg"),
1054 $lng->txt("actions")
1055 );
1056 $toolbar->addFormButton(
1057 $this->lng->txt('delete_selected_items'),
1058 'delete'
1059 );
1060 $toolbar->addFormButton(
1061 $this->lng->txt('move_selected_items'),
1062 'cut'
1063 );
1064 $toolbar->addFormButton(
1065 $this->lng->txt('copy_selected_items'),
1066 'copy'
1067 );
1068 $toolbar->addFormButton(
1069 $this->lng->txt('download_selected_items'),
1070 'download'
1071 );
1072 // add download button if multi download enabled
1073
1074 //@todo download
1075 /*
1076 $folder_set = new ilSetting("fold");
1077 if ($folder_set->get("enable_multi_download") == true)
1078 {
1079 $toolbar->addSeparator();
1080
1081 if(!$folder_set->get("bgtask_download", 0))
1082 {
1083 $toolbar->addFormButton(
1084 $this->lng->txt('download_selected_items'),
1085 'download'
1086 );
1087 }
1088 else
1089 {
1090
1091 $url = $this->ctrl->getLinkTargetByClass(array("ilrepositorygui", "ilobjfoldergui", "ilbackgroundtaskhub"), "", "", true, false);
1092 $main_tpl->addJavaScript("Services/BackgroundTask/js/BgTask.js");
1093 $main_tpl->addOnLoadCode("il.BgTask.initMultiForm('ilFolderDownloadBackgroundTaskHandler');");
1094 $main_tpl->addOnLoadCode('il.BgTask.setAjax("'.$url.'");');
1095
1096 include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
1097 $button = ilSubmitButton::getInstance();
1098 $button->setCaption("download_selected_items");
1099 $button->addCSSClass("ilbgtasksubmit");
1100 $button->setCommand("download");
1101 $toolbar->addButtonInstance($button);
1102 }
1103 }*/
1104 }
1105
1106 $main_tpl->addAdminPanelToolbar(
1107 $toolbar,
1108 ($this->object->gotItems($this->node_id) && !$_SESSION["wsp_clipboard"]) ? true : false,
1109 ($this->object->gotItems($this->node_id) && !$_SESSION["wsp_clipboard"]) ? true : false
1110 );
1111
1112 // form action needed, see http://www.ilias.de/mantis/view.php?id=9630
1113 if ($this->object->gotItems($this->node_id)) {
1114 $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
1115 }
1116 }
1117 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $_SESSION, ilObjectGUI\$access, $DIC, ilObjectGUI\$lng, ilObjectGUI\$toolbar, ilUtil\getImagePath(), and isActiveAdministrationPanel().

Referenced by render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showMoveIntoObjectTree()

ilObjWorkspaceFolderGUI::showMoveIntoObjectTree (   $repo_switch_allowed = false)

Move node: select target (via explorer)

Definition at line 503 of file class.ilObjWorkspaceFolderGUI.php.

504 {
505 $ilTabs = $this->tabs;
507
508 $ilTabs->clearTargets();
509
510 if (!$_SESSION['clipboard']['shared']) {
511 $ilTabs->setBackTarget(
512 $this->lng->txt('back'),
513 $this->ctrl->getLinkTarget($this)
514 );
515 } else {
516 $ilTabs->setBackTarget(
517 $this->lng->txt('back'),
518 $this->ctrl->getLinkTarget($this, 'share')
519 );
520 }
521
522 $mode = $_SESSION['clipboard']['cmd'];
523
524 ilUtil::sendInfo($this->lng->txt('msg_' . $mode . '_clipboard'));
525
526 $this->tpl->addBlockfile(
527 'ADM_CONTENT',
528 'adm_content',
529 'tpl.paste_into_multiple_objects.html',
530 "Services/Object"
531 );
532
533 // move/copy in personal workspace
534 if (!$_SESSION['clipboard']['wsp2repo']) {
535 include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorerGUI.php");
536 $exp = new ilWorkspaceExplorerGUI($this->user->getId(), $this, "showMoveIntoObjectTree", $this, "");
537 $exp->setTypeWhiteList(array("wsrt", "wfld"));
538 $exp->setSelectableTypes(array("wsrt", "wfld"));
539 $exp->setSelectMode("node", false);
540 if ($exp->handleCommand()) {
541 return;
542 }
543 $this->tpl->setVariable('OBJECT_TREE', $exp->getHTML());
544
545 // switch to repo?
546 if ($repo_switch_allowed) {
547 $switch_cmd = ($mode == "cut")
548 ? "cut_for_repository"
549 : "copy_to_repository";
550 $this->tpl->setCurrentBlock("switch_button");
551 $this->tpl->setVariable('CMD_SWITCH', $switch_cmd);
552 $this->tpl->setVariable('TXT_SWITCH', $this->lng->txt('wsp_switch_to_repo_tree'));
553 $this->tpl->parseCurrentBlock();
554
555 foreach ($this->getRequestItemIds() as $id) {
556 $this->tpl->setCurrentBlock("hidden");
557 $this->tpl->setVariable('VALUE', $id);
558 $this->tpl->parseCurrentBlock();
559 }
560 }
561 }
562 // move/copy to repository
563 else {
564 require_once './Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php';
567 '',
568 'paste_' . $mode . '_repexpand'
569 );
570 $exp->setTargetGet('ref_id');
571
572 if ($_GET['paste_' . $mode . '_repexpand'] == '') {
573 $expanded = $tree->readRootId();
574 } else {
575 $expanded = $_GET['paste_' . $mode . '_repexpand'];
576 }
577 $exp->setCheckedItems(array((int) $_POST['node']));
578 $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'showMoveIntoObjectTree'));
579 $exp->setPostVar('node');
580 $exp->setExpand($expanded);
581 $exp->setOutput(0);
582 $this->tpl->setVariable('OBJECT_TREE', $exp->getOutput());
583
584 if (in_array($mode, ["copy", "cut"])) {
585 $switch_cmd = ($mode == "cut")
586 ? "cut_for_workspace"
587 : "copy_to_workspace";
588 $this->tpl->setCurrentBlock("switch_button");
589 $this->tpl->setVariable('CMD_SWITCH', $switch_cmd);
590 $this->tpl->setVariable('TXT_SWITCH', $this->lng->txt('wsp_switch_to_wsp_tree'));
591 $this->tpl->parseCurrentBlock();
592
593 foreach ($this->getRequestItemIds() as $id) {
594 $this->tpl->setCurrentBlock("hidden");
595 $this->tpl->setVariable('VALUE', $id);
596 $this->tpl->parseCurrentBlock();
597 }
598 }
599 }
600
601
602 unset($exp);
603
604 $this->tpl->setVariable('FORM_TARGET', '_top');
605 $this->tpl->setVariable(
606 'FORM_ACTION',
607 $this->ctrl->getFormAction($this, 'performPasteIntoMultipleObjects')
608 );
609
610 $this->tpl->setVariable('CMD_SUBMIT', 'performPasteIntoMultipleObjects');
611 $this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('paste'));
612 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_GET, $_POST, $_SESSION, $tabs, ilObject2GUI\$tree, getRequestItemIds(), ilPasteIntoMultipleItemsExplorer\SEL_TYPE_RADIO, ilUtil\sendInfo(), and user().

Referenced by copy(), copyShared(), and cut().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilObjWorkspaceFolderGUI::update ( )

Reimplemented from ilObject2GUI.

Definition at line 300 of file class.ilObjWorkspaceFolderGUI.php.

301 {
302 parent::update();
303
304 $this->tabs_gui->activateTab("wsp");
305 $this->tabs_gui->activateSubTab("settings");
306 }

Field Documentation

◆ $help

ilObjWorkspaceFolderGUI::$help
protected

◆ $requested_sortation

ilObjWorkspaceFolderGUI::$requested_sortation
protected

Definition at line 43 of file class.ilObjWorkspaceFolderGUI.php.

◆ $tabs

ilObjWorkspaceFolderGUI::$tabs
protected

◆ $ui

ilObjWorkspaceFolderGUI::$ui
protected

Definition at line 33 of file class.ilObjWorkspaceFolderGUI.php.

◆ $user_folder_settings

ilObjWorkspaceFolderGUI::$user_folder_settings
protected

Definition at line 38 of file class.ilObjWorkspaceFolderGUI.php.

◆ $wsp_log

ilObjWorkspaceFolderGUI::$wsp_log
protected

Definition at line 48 of file class.ilObjWorkspaceFolderGUI.php.


The documentation for this class was generated from the following file: