ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 
 getType ()
 Functions that must be overwritten. More...
 
 isActiveAdministrationPanel ()
 
 setAdministrationPanel (bool $active)
 
 executeCommand ()
 execute command More...
 
 render ()
 
 edit ()
 
 update ()
 
 cut ()
 
 cut_for_repository ()
 
 cut_for_workspace ()
 
 copy ()
 
 copyShared ()
 
 copy_to_repository ()
 
 copy_to_workspace ()
 
 showMoveIntoObjectTree (bool $repo_switch_allowed=false)
 
 performPasteIntoMultipleObjects ()
 
 shareFilter ()
 
 share (bool $a_load_data=true)
 
 applyShareFilter ()
 
 resetShareFilter ()
 
 listSharedResourcesOfOtherUser ()
 
 cancelDeletion ()
 
 showAdministrationPanel ()
 
 download ()
 
 getBucketTitle ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 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 (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 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...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target)
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Protected Member Functions

 setTabs (bool $a_show_settings=true)
 
 addContentSubTabs (bool $a_show_settings)
 
 enableAdminPanel ()
 
 disableAdminPanel ()
 
 passwordForm (int $a_node_id, ?ilPropertyFormGUI $form=null)
 
 initPasswordForm (int $a_node_id)
 
 checkPassword ()
 
 deleteConfirmation ()
 
 setSortation ()
 Set sortation. More...
 
 buildAvailableObjectTypes ()
 
 buildObjectType (string $type)
 
- 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 ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 addAdminLocatorItems (bool $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 (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 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 More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

ILIAS Repository ExternalGUIService $repo_gui_service
 
ilHelpGUI $help
 
ilTabsGUI $tabs
 
ILIAS DI UIServices $ui
 
ilWorkspaceFolderUserSettings $user_folder_settings
 
int $requested_sortation
 
ilLogger $wsp_log
 
StandardGUIRequest $std_request
 
WorkspaceSessionRepository $session_repo
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = []
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Additional Inherited Members

- Data Fields inherited from ilObject2GUI
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 ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

45 {
46 global $DIC;
47 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
48
49 $this->lng = $DIC->language();
50 $this->lng->loadLanguageModule("pwsp");
51 $this->help = $DIC["ilHelp"];
52 $this->tpl = $DIC->ui()->mainTemplate();
53 $this->user = $DIC->user();
54 $this->tabs = $DIC->tabs();
55 $this->ctrl = $DIC->ctrl();
56 $this->ui = $DIC->ui();
57 $this->session_repo = new WorkspaceSessionRepository();
58 $this->repo_gui_service = $DIC->repository()->gui();
59
60 $this->std_request = new StandardGUIRequest(
61 $DIC->http(),
62 $DIC->refinery()
63 );
64
65 $this->wsp_log = ilLoggerFactory::getLogger("pwsp");
66
67 $this->user_folder_settings = new ilWorkspaceFolderUserSettings(
68 $this->user->getId(),
70 );
71
72 $this->requested_sortation = $this->std_request->getSortation();
73
74 $this->lng->loadLanguageModule("cntr");
75 }
static getLogger(string $a_component_id)
Get component logger.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjWorkspaceFolderGUI::_goto ( string  $a_target)
static

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

785 : void
786 {
787 global $DIC;
788 $ctrl = $DIC->ctrl();
789 $id = explode("_", $a_target);
791 "ilsharedresourceGUI",
792 "wsp_id",
793 $id[0]
794 );
795 $ctrl->redirectByClass("ilsharedresourceGUI");
796 }
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc

References ilObject2GUI\$ctrl, $DIC, ilObjectGUI\$id, ilCtrl\redirectByClass(), and ilCtrl\setParameterByClass().

+ Here is the call graph for this function:

◆ addContentSubTabs()

ilObjWorkspaceFolderGUI::addContentSubTabs ( bool  $a_show_settings)
protected

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

135 : void
136 {
140
141 if ($this->checkPermissionBool("read")) {
142 $tabs->addSubTab("content", $lng->txt("view"), $ctrl->getLinkTarget($this, "disableAdminPanel"));
143 $tabs->addSubTab("manage", $lng->txt("cntr_manage"), $ctrl->getLinkTarget($this, "enableAdminPanel"));
144 }
145
146 if ($this->checkPermissionBool("write") && $a_show_settings) {
147 $this->tabs_gui->addSubTab(
148 "settings",
149 $lng->txt("settings"),
150 $this->ctrl->getLinkTarget($this, "edit")
151 );
152 }
153
154 if ($this->isActiveAdministrationPanel()) {
155 $tabs->activateSubTab("manage");
156 } else {
157 $tabs->activateSubTab("content");
158 }
159 }
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
activateSubTab(string $a_id)
addSubTab(string $a_id, string $a_text, string $a_link, string $a_frame="")

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, $tabs, ilTabsGUI\activateSubTab(), ilTabsGUI\addSubTab(), ilObject2GUI\checkPermissionBool(), ilCtrl\getLinkTarget(), isActiveAdministrationPanel(), and ilLanguage\txt().

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 689 of file class.ilObjWorkspaceFolderGUI.php.

689 : void
690 {
691 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
692 $tbl->resetOffset();
693 $tbl->writeFilterToSession();
694
695 $this->share();
696 }
Workspace share handler table GUI class.

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

+ Here is the call graph for this function:

◆ buildAvailableObjectTypes()

ilObjWorkspaceFolderGUI::buildAvailableObjectTypes ( )
protected

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

985 : array
986 {
987 $settings_map = [
988 'blog' => 'blogs',
989 'file' => 'files',
990 'webr' => 'links',
991 ];
992
993 $object_types = $this->obj_definition->getCreatableSubObjects("wfld", ilObjectDefinition::MODE_WORKSPACE);
994 $filtered_object_types = [];
995 foreach (array_keys($object_types) as $type) {
996 if (isset($settings_map[$type])
997 && $this->settings->get("disable_wsp_" . $settings_map[$type])) {
998 continue;
999 }
1000
1001 $filtered_object_types[] = $this->buildObjectType($type);
1002 }
1003
1004 return $filtered_object_types;
1005 }

References ilObject2GUI\$type, buildObjectType(), ilObjectDefinition\MODE_WORKSPACE, and ILIAS\Repository\settings().

Referenced by render().

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

◆ buildObjectType()

ilObjWorkspaceFolderGUI::buildObjectType ( string  $type)
protected

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

1008 {
1009 $icon = $this->ui_factory->symbol()->icon()->custom(
1010 \ilObject::_getIcon(0, 'tiny', $type),
1011 ''
1012 );
1013
1014 $this->ctrl->setParameterByClass(self::class, 'new_type', $type);
1015 $element = new AddNewItemElement(
1016 AddNewItemElementTypes::Object,
1017 $this->lng->txt('wsp_type_' . $type),
1018 $icon,
1019 new \ILIAS\Data\URI(ILIAS_HTTP_PATH . '/' . $this->ctrl->getLinkTargetByClass(self::class, 'create'))
1020 );
1021 $this->ctrl->clearParameterByClass(self::class, 'new_type', $type);
1022 return $element;
1023 }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

References ilObject2GUI\$type, ilObject\_getIcon(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by buildAvailableObjectTypes().

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

◆ cancelDeletion()

ilObjWorkspaceFolderGUI::cancelDeletion ( )

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

861 {
862 $this->session_repo->clearClipboard();
863 parent::cancelDelete();
864 }

◆ checkPassword()

ilObjWorkspaceFolderGUI::checkPassword ( )
protected

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

754 : void
755 {
757
758 $ids = $this->std_request->getItemIds();
759 if (count($ids) != 1) {
760 $this->ctrl->redirect($this, "share");
761 }
762 $node_id = current($ids);
763
764 $form = $this->initPasswordForm($node_id);
765 if ($form->checkInput()) {
767 $input = md5($form->getInput("password"));
768 if ($input == $password) {
769 // we save password and start over
771
772 $this->ctrl->setParameter($this, "item_ref_id", $node_id);
773 $this->ctrl->redirect($this, "copyShared");
774 } else {
775 $item = $form->getItemByPostVar("password");
776 $item->setAlert($lng->txt("wsp_invalid_password"));
777 $this->tpl->setOnScreenMessage('failure', $lng->txt("form_input_not_valid"));
778 }
779 }
780
781 $form->setValuesByPost();
782 $this->passwordForm($node_id, $form);
783 }
passwordForm(int $a_node_id, ?ilPropertyFormGUI $form=null)
static getSharedNodePassword(int $a_node_id)
static keepSharedSessionPassword(int $a_node_id, string $a_password)

References ilObject2GUI\$lng, ilObject2GUI\$node_id, ILIAS\Repository\ctrl(), ilWorkspaceAccessHandler\getSharedNodePassword(), initPasswordForm(), ilWorkspaceAccessHandler\keepSharedSessionPassword(), passwordForm(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ copy()

ilObjWorkspaceFolderGUI::copy ( )

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

317 : void
318 {
319 $ilUser = $this->user;
320
321 $item_ids = $this->std_request->getItemIds();
322 if (count($item_ids) == 0) {
323 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
324 $this->ctrl->redirect($this);
325 }
326
327 // on cancel or fail we return to parent node
328 $this->ctrl->setParameter($this, "wsp_id", $this->node_id);
329
330 $repo_switch_allowed = true;
331 foreach ($item_ids as $item_id) {
332 $node = $this->tree->getNodeData($item_id);
333 if (ilObject::_lookupType($node["obj_id"]) != "file") {
334 $repo_switch_allowed = false;
335 }
336 $current_node = $item_id;
337 $owner = $this->tree->lookupOwner($current_node);
338 if ($owner != $ilUser->getId()) {
339 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
340 $this->ctrl->redirect($this);
341 }
342 if (!$this->obj_definition->allowCopy($node["type"])) {
343 $this->tpl->setOnScreenMessage(
344 'failure',
345 str_replace(
346 "%s",
347 $this->lng->txt("obj_" . $node["type"]),
348 $this->lng->txt("pwsp_type_cannot_be_copied")
349 ),
350 true
351 );
352 $this->ctrl->redirect($this);
353 }
354 }
355
356 // remember source node
357 $this->session_repo->setClipboardSourceIds($item_ids);
358 $this->session_repo->setClipboardCmd('copy');
359
360 $this->showMoveIntoObjectTree($repo_switch_allowed);
361 }
showMoveIntoObjectTree(bool $repo_switch_allowed=false)
static _lookupType(int $id, bool $reference=false)

References ilObject2GUI\$user, ilObject\_lookupType(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), 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 ( )

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

392 : void
393 {
394 $this->session_repo->setClipboardWsp2Repo(true);
395 $this->copy();
396 }

References copy().

+ Here is the call graph for this function:

◆ copy_to_workspace()

ilObjWorkspaceFolderGUI::copy_to_workspace ( )

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

398 : void
399 {
400 $this->session_repo->setClipboardWsp2Repo(false);
401 $this->copy();
402 }

References copy().

+ Here is the call graph for this function:

◆ copyShared()

ilObjWorkspaceFolderGUI::copyShared ( )

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

363 : void
364 {
365 $ids = $this->std_request->getItemIds();
366 if (count($ids) != 1) {
367 $this->ctrl->redirect($this, "share");
368 }
369
370 $current_node = current($ids);
371 $handler = $this->getAccessHandler();
372 // see ilSharedRessourceGUI::hasAccess()
373 if ($handler->checkAccess("read", "", $current_node)) {
374 // remember source node
375 $this->session_repo->setClipboardSourceIds([$current_node]);
376 $this->session_repo->setClipboardCmd('copy');
377 $this->session_repo->setClipboardShared(true);
378 $this->showMoveIntoObjectTree();
379 return;
380 } else {
381 $perms = $handler->getPermissions($current_node);
382 if (in_array(ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD, $perms)) {
383 $this->passwordForm($current_node);
384 return;
385 }
386 }
387
388 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
389 $this->ctrl->redirect($this, "share");
390 }
$handler
Definition: oai.php:29

References $handler, ILIAS\Repository\ctrl(), ilObject2GUI\getAccessHandler(), ILIAS\Repository\lng(), passwordForm(), ilWorkspaceAccessGUI\PERMISSION_ALL_PASSWORD, and showMoveIntoObjectTree().

+ Here is the call graph for this function:

◆ cut()

ilObjWorkspaceFolderGUI::cut ( )

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

270 : void
271 {
272 $item_ids = $this->std_request->getItemIds();
273 if (count($item_ids) == 0) {
274 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
275 $this->ctrl->redirect($this);
276 }
277
278 // check permission
279 $no_cut = array();
280 $repo_switch_allowed = true;
281 foreach ($item_ids as $item_id) {
282 foreach ($this->tree->getSubTree($this->tree->getNodeData($item_id)) as $node) {
283 if (ilObject::_lookupType($node["obj_id"]) != "file") {
284 $repo_switch_allowed = false;
285 }
286 if (!$this->checkPermissionBool("delete", "", "", $node["wsp_id"])) {
287 $obj = ilObjectFactory::getInstanceByObjId($node["obj_id"]);
288 $no_cut[$node["wsp_id"]] = $obj->getTitle();
289 unset($obj);
290 }
291 }
292 }
293 if (count($no_cut)) {
294 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("msg_no_perm_cut") . " " . implode(',', $no_cut), true);
295 $this->ctrl->redirect($this);
296 }
297
298 // remember source node
299 $this->session_repo->setClipboardSourceIds($item_ids);
300 $this->session_repo->setClipboardCmd('cut');
301
302 $this->showMoveIntoObjectTree($repo_switch_allowed);
303 }
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id

References ilObject\_lookupType(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilObjectFactory\getInstanceByObjId(), ILIAS\Repository\lng(), 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 ( )

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

305 : void
306 {
307 $this->session_repo->setClipboardWsp2Repo(true);
308 $this->cut();
309 }

References cut().

+ Here is the call graph for this function:

◆ cut_for_workspace()

ilObjWorkspaceFolderGUI::cut_for_workspace ( )

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

311 : void
312 {
313 $this->session_repo->setClipboardWsp2Repo(false);
314 $this->cut();
315 }

References cut().

+ Here is the call graph for this function:

◆ deleteConfirmation()

ilObjWorkspaceFolderGUI::deleteConfirmation ( )
protected

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

807 : void
808 {
809 global $DIC;
810
811 $tpl = $DIC["tpl"];
812 $lng = $DIC["lng"];
813
814 $item_ids = $this->std_request->getItemIds();
815
816 if (count($item_ids) == 0) {
817 $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
818 $this->ctrl->redirect($this, "");
819 }
820
821 // on cancel or fail we return to parent node
822 //$parent_node = $this->tree->getParentId($node_id);
823 //$this->ctrl->setParameter($this, "wsp_id", $parent_node);
824
825 $cgui = new ilConfirmationGUI();
826 $cgui->setHeaderText($lng->txt("info_delete_sure") . "<br/>" .
827 $lng->txt("info_delete_warning_no_trash"));
828
829 $cgui->setFormAction($this->ctrl->getFormAction($this));
830 $cgui->setCancel($lng->txt("cancel"), "cancelDeletion");
831 $cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
832
833 foreach ($item_ids as $node_id) {
834 $children = $this->tree->getSubTree($this->tree->getNodeData($node_id));
835 foreach ($children as $child) {
836 $node_id = $child["wsp_id"];
837 $obj_id = $this->tree->lookupObjectId($node_id);
839 $title = call_user_func(array(ilObjectFactory::getClassByType($type),'_lookupTitle'), $obj_id);
840
841 // if anything fails, abort the whole process
842 if (!$this->checkPermissionBool("delete", "", "", $node_id)) {
843 $this->tpl->setOnScreenMessage('failure', $lng->txt("msg_no_perm_delete") . " " . $title, true);
844 $this->ctrl->redirect($this);
845 }
846
847 $cgui->addItem(
848 "id[]",
849 $node_id,
850 $title,
852 $lng->txt("icon") . " " . $lng->txt("obj_" . $type)
853 );
854 }
855 }
856
857 $tpl->setContent($cgui->getHTML());
858 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
static getClassByType(string $obj_type)
setContent(string $a_html)
Sets content for standard template.

References $DIC, ilObject2GUI\$lng, ilObject2GUI\$node_id, ilObjectGUI\$obj_id, ilObject2GUI\$tpl, ilObject2GUI\$type, ilObject\_getIcon(), ilObject\_lookupType(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilObjectFactory\getClassByType(), ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ disableAdminPanel()

ilObjWorkspaceFolderGUI::disableAdminPanel ( )
protected

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

167 : void
168 {
169 $this->setAdministrationPanel(false);
170 $this->ctrl->redirect($this, "");
171 }

References ILIAS\Repository\ctrl(), and setAdministrationPanel().

+ Here is the call graph for this function:

◆ download()

ilObjWorkspaceFolderGUI::download ( )

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

955 : void
956 {
957 // This variable determines whether the task has been initiated by a folder's action drop-down to prevent a folder
958 // duplicate inside the zip.
959 $initiated_by_folder_action = false;
960
961 $ids = $this->std_request->getItemIds();
962
963 if (count($ids) == 0) {
964 $this->ctrl->redirect($this, "");
965 }
966
967 $download_job = new ilDownloadWorkspaceFolderBackgroundTask($GLOBALS['DIC']->user()->getId(), $ids, $initiated_by_folder_action);
968
969 $download_job->setBucketTitle($this->getBucketTitle());
970 if ($download_job->run()) {
971 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_bt_download_started'), true);
972 }
973 $this->ctrl->redirect($this);
974 }
$GLOBALS["DIC"]
Definition: wac.php:54

References $GLOBALS, ILIAS\Repository\ctrl(), getBucketTitle(), ILIAS\Survey\Mode\getId(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ edit()

ilObjWorkspaceFolderGUI::edit ( )

Reimplemented from ilObject2GUI.

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

254 : void
255 {
256 parent::edit();
257
258 $this->tabs_gui->activateTab("wsp");
259 $this->tabs_gui->activateSubTab("settings");
260 }

◆ enableAdminPanel()

ilObjWorkspaceFolderGUI::enableAdminPanel ( )
protected

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

161 : void
162 {
163 $this->setAdministrationPanel(true);
164 $this->ctrl->redirect($this, "");
165 }

References ILIAS\Repository\ctrl(), and setAdministrationPanel().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjWorkspaceFolderGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

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

173 : void
174 {
175 $next_class = $this->ctrl->getNextClass($this);
176 $cmd = $this->ctrl->getCmd();
177
178 switch ($next_class) {
179 case "ilcommonactiondispatchergui":
181 $this->ctrl->forwardCommand($gui);
182 break;
183
184 case "ilobjectownershipmanagementgui":
185 $this->prepareOutput();
186 $this->tabs_gui->activateTab("ownership");
187 $gui = $this->repo_gui_service->ownershipManagementGUI();
188 $this->ctrl->forwardCommand($gui);
189 break;
190
191 default:
192 $this->prepareOutput();
193 if ($this->type != "wsrt") {
194 $this->addHeaderAction();
195 }
196 if (!$cmd) {
197 $cmd = "render";
198 }
199 $this->$cmd();
200 break;
201 }
202 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
prepareOutput(bool $show_sub_objects=true)
addHeaderAction()
Add header action menu.

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

+ Here is the call graph for this function:

◆ getBucketTitle()

ilObjWorkspaceFolderGUI::getBucketTitle ( )

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

976 : string
977 {
978 $title = ilFileUtils::getASCIIFilename($this->object->getTitle());
979 if ($title === '') { // $this->>object->getTitle() is empty in root of personal and shared resources
980 $title = $this->lng->txt('personal_resources');
981 }
982 return $title;
983 }
static getASCIIFilename(string $a_filename)

References ilFileUtils\getASCIIFilename(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by download().

+ Here is the call graph for this function:
+ 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 77 of file class.ilObjWorkspaceFolderGUI.php.

77 : string
78 {
79 return "wfld";
80 }

◆ initPasswordForm()

ilObjWorkspaceFolderGUI::initPasswordForm ( int  $a_node_id)
protected

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

730 {
731 $ilCtrl = $this->ctrl;
733
734 $this->ctrl->setParameter($this, "item_ref_id", $a_node_id);
735
736 $object_data = $this->getAccessHandler()->getObjectDataFromNode($a_node_id);
737
738 $form = new ilPropertyFormGUI();
739 $form->setFormAction($ilCtrl->getFormAction($this, "checkPassword"));
740 $form->setTitle($lng->txt("wsp_password_for") . ": " . $object_data["title"]);
741
742 $password = new ilPasswordInputGUI($lng->txt("password"), "password");
743 $password->setRetype(false);
744 $password->setRequired(true);
745 $password->setSkipSyntaxCheck(true);
746 $form->addItem($password);
747
748 $form->addCommandButton("checkPassword", $lng->txt("submit"));
749 $form->addCommandButton("share", $lng->txt("cancel"));
750
751 return $form;
752 }
This class represents a password property in a property form.
This class represents a property form user interface.

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ILIAS\Repository\ctrl(), ilObject2GUI\getAccessHandler(), and ilLanguage\txt().

Referenced by checkPassword(), and passwordForm().

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

◆ isActiveAdministrationPanel()

ilObjWorkspaceFolderGUI::isActiveAdministrationPanel ( )

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

125 : bool
126 {
127 return (bool) ilSession::get("il_wsp_admin_panel");
128 }
static get(string $a_var)

References ilSession\get().

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

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

◆ listSharedResourcesOfOtherUser()

ilObjWorkspaceFolderGUI::listSharedResourcesOfOtherUser ( )

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

798 : void
799 {
800 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
801 $tbl->resetOffset();
802 $tbl->resetFilter();
803 $tbl->writeFilterToSession();
804 $this->share();
805 }

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

+ Here is the call graph for this function:

◆ passwordForm()

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

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

707 : void
708 {
711 $ilTabs = $this->tabs;
712
713 $tpl->setTitle($lng->txt("wsp_password_protected_resource"));
714 $tpl->setDescription($lng->txt("wsp_password_protected_resource_info"));
715
716 $ilTabs->clearTargets();
717 $ilTabs->setBackTarget(
718 $lng->txt("back"),
719 $this->ctrl->getLinkTarget($this, "share")
720 );
721
722 if (!$form) {
723 $form = $this->initPasswordForm($a_node_id);
724 }
725
726 $tpl->setContent($form->getHTML());
727 }
setDescription(string $a_descr)
Sets description below title in standard template.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.

References ilObject2GUI\$lng, $tabs, ilObject2GUI\$tpl, initPasswordForm(), ILIAS\UICore\GlobalTemplate\setContent(), ILIAS\UICore\GlobalTemplate\setDescription(), ILIAS\UICore\GlobalTemplate\setTitle(), and ilLanguage\txt().

Referenced by checkPassword(), and copyShared().

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

◆ performPasteIntoMultipleObjects()

ilObjWorkspaceFolderGUI::performPasteIntoMultipleObjects ( )

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

513 : void
514 {
515 $ilUser = $this->user;
516 $owner = 0;
517 $mode = $this->session_repo->getClipboardCmd();
518 $source_node_ids = $this->session_repo->getClipboardSourceIds();
519 $target_node_id = $this->std_request->getNode();
520
521 if (!is_array($source_node_ids) || count($source_node_ids) == 0) {
522 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_at_least_one_object'), true);
523 $this->ctrl->redirect($this);
524 }
525 if (!$target_node_id) {
526 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_at_least_one_object'), true);
527 $this->ctrl->redirect($this, "showMoveIntoObjectTree");
528 }
529
530 if (!$this->session_repo->getClipboardWsp2Repo()) {
531 $target_obj_id = $this->tree->lookupObjectId($target_node_id);
532 } else {
533 $target_obj_id = ilObject::_lookupObjId($target_node_id);
534 }
535 $target_object = ilObjectFactory::getInstanceByObjId($target_obj_id);
536
537 $fail = array();
538 foreach ($source_node_ids as $source_node_id) {
539 // object instances
540 $source_obj_id = $this->tree->lookupObjectId($source_node_id);
541 $source_object = ilObjectFactory::getInstanceByObjId($source_obj_id);
542
543
544 // sanity checks
545 if ($source_node_id == $target_node_id) {
546 $fail[] = sprintf(
547 $this->lng->txt('msg_obj_exists_in_folder'),
548 $source_object->getTitle(),
549 $target_object->getTitle()
550 );
551 }
552
553 if (!in_array($source_object->getType(), array_keys($target_object->getPossibleSubObjects()))) {
554 $fail[] = sprintf(
555 $this->lng->txt('msg_obj_may_not_contain_objects_of_type'),
556 $target_object->getTitle(),
557 $source_object->getType()
558 );
559 }
560
561 // if object is shared permission to copy has been checked above
562 $owner = $this->tree->lookupOwner($source_node_id);
563 if ($mode == "copy" && $ilUser->getId() == $owner && !$this->checkPermissionBool('copy', '', '', $source_node_id)) {
564 $fail[] = $this->lng->txt('permission_denied');
565 }
566
567 if (!$this->session_repo->getClipboardWsp2Repo()) {
568 if ($mode == "cut" && $this->tree->isGrandChild($source_node_id, $target_node_id)) {
569 $fail[] = sprintf(
570 $this->lng->txt('msg_paste_object_not_in_itself'),
571 $source_object->getTitle()
572 );
573 }
574 }
575
576 if ($this->session_repo->getClipboardWsp2Repo() == true) { // see #22959
577 global $ilAccess;
578 if (!$ilAccess->checkAccess("create", "", $target_node_id, $source_object->getType())) {
579 $fail[] = sprintf(
580 $this->lng->txt('msg_no_perm_paste_object_in_folder'),
581 $source_object->getTitle(),
582 $target_object->getTitle()
583 );
584 }
585 } else {
586 if (!$this->checkPermissionBool('create', '', $source_object->getType(), $target_node_id)) {
587 $fail[] = sprintf(
588 $this->lng->txt('msg_no_perm_paste_object_in_folder'),
589 $source_object->getTitle(),
590 $target_object->getTitle()
591 );
592 }
593 }
594 }
595
596 if (sizeof($fail)) {
597 $this->tpl->setOnScreenMessage('failure', implode("<br />", $fail), true);
598 $this->ctrl->redirect($this);
599 }
600
601 foreach ($source_node_ids as $source_node_id) {
602 $source_tree = $this->tree;
603 if ($ilUser->getId() != $owner && $mode == "copy") {
604 $source_tree = new ilWorkspaceTree($owner);
605 }
606 $node_data = $source_tree->getNodeData($source_node_id);
607 $source_object = ilObjectFactory::getInstanceByObjId($node_data["obj_id"]);
608
609 // move the node
610 if ($mode == "cut") {
611 if (!$this->session_repo->getClipboardWsp2Repo()) {
612 $this->tree->moveTree($source_node_id, $target_node_id);
613 } else {
614 $parent_id = $this->tree->getParentId($source_node_id);
615
616 // remove from personal workspace
617 $this->getAccessHandler()->removePermission($source_node_id);
618 $this->tree->deleteReference($source_node_id);
619 $source_node = $this->tree->getNodeData($source_node_id);
620 $this->tree->deleteTree($source_node);
621
622 // add to repository
623 $source_object->createReference();
624 $source_object->putInTree($target_node_id);
625 $source_object->setPermissions($target_node_id);
626
627 $source_node_id = $parent_id;
628 }
629 } // copy the node
630 elseif ($mode == "copy") {
632 $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
633 $this->wsp_log->debug("Copy ID: " . $copy_id . ", Source Node: " . $source_node_id
634 . ", source object: " . $source_object->getId());
635 if (!$this->session_repo->getClipboardWsp2Repo()) {
636 $wizard_options->disableTreeCopy();
637 }
638 $wizard_options->saveOwner($ilUser->getId());
639 $wizard_options->saveRoot($source_node_id);
640 $wizard_options->read();
641
642 $new_obj = $source_object->cloneObject($target_node_id, $copy_id);
643 // insert into workspace tree
644 if ($new_obj && !$this->session_repo->getClipboardWsp2Repo()) {
645 $this->wsp_log->debug("New Obj ID: " . $new_obj->getId());
646 $new_obj_node_id = $this->tree->insertObject($target_node_id, $new_obj->getId());
647 $this->getAccessHandler()->setPermissions($target_node_id, $new_obj_node_id);
648 }
649
650 $wizard_options->deleteAll();
651 }
652 }
653
654 // redirect to target if not repository
655 if (!$this->session_repo->getClipboardWsp2Repo()) {
656 //$redirect_node = $target_node_id;
657 $redirect_node = $this->node_id; // see bug 34459
658 } else {
659 // reload current folder
660 $redirect_node = $this->node_id;
661 }
662
663 $this->session_repo->clearClipboard();
664
665 // #17746
666 if ($mode == 'cut') {
667 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_cut_copied'), true);
668 } else {
669 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_cloned'), true);
670 }
671
672 $this->ctrl->setParameter($this, "wsp_id", $redirect_node);
673 $this->ctrl->redirect($this);
674 }
static _allocateCopyId()
Allocate a copy for further entries.
static _getInstance(int $a_copy_id)
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilObject2GUI\$node_id, ilObject2GUI\$parent_id, ilObjectGUI\$tree, ilObject2GUI\$user, ilCopyWizardOptions\_allocateCopyId(), ilCopyWizardOptions\_getInstance(), ilObject\_lookupObjId(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilObject2GUI\getAccessHandler(), ilObjectFactory\getInstanceByObjId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ render()

ilObjWorkspaceFolderGUI::render ( )

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

204 : void
205 {
207 $ilUser = $this->user;
208 $ilCtrl = $this->ctrl;
209
210 //$this->addContentSubTabs();
212
213 $this->session_repo->clearClipboard();
214
215 // add new item
218 );
219 $gui->render();
220
222 "",
223 "",
224 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
225 );
226
227 $gui = new ilWorkspaceContentGUI(
228 $this,
229 $this->node_id,
231 $this->getAccessHandler(),
232 $this->ui,
233 $this->lng,
234 $this->user,
235 $this->obj_definition,
236 $this->ctrl,
237 $this->user_folder_settings
238 );
239 $tpl->setContent($gui->render());
240
241 $exp = new ilWorkspaceExplorerGUI($ilUser->getId(), $this, "render", $this, "", "wsp_id");
242 $exp->setTypeWhiteList(array("wsrt", "wfld"));
243 $exp->setSelectableTypes(array("wsrt", "wfld"));
244 $exp->setLinkToNodeClass(true);
245 $exp->setActivateHighlighting(true);
246 if ($exp->handleCommand()) {
247 return;
248 }
249 $left = $exp->getHTML();
250
251 $tpl->setLeftNavContent($left);
252 }
Render add new item selector.
static prepareJsLinks(string $redraw_url, string $notes_url, string $tags_url, ?ilGlobalTemplateInterface $tpl=null)
Insert js/ajax links into template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Explorer for selecting a personal workspace item.
setLeftNavContent(string $a_content)
Sets content of left navigation column.

References ilObject2GUI\$ctrl, ilObject2GUI\$tpl, ilObject2GUI\$user, buildAvailableObjectTypes(), ILIAS\Repository\ctrl(), ilObject2GUI\getAccessHandler(), isActiveAdministrationPanel(), ILIAS\Repository\lng(), ilObjectListGUI\prepareJsLinks(), ILIAS\UICore\GlobalTemplate\setContent(), ILIAS\UICore\GlobalTemplate\setLeftNavContent(), showAdministrationPanel(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ resetShareFilter()

ilObjWorkspaceFolderGUI::resetShareFilter ( )

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

698 : void
699 {
700 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
701 $tbl->resetOffset();
702 $tbl->resetFilter();
703
704 $this->shareFilter();
705 }

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

+ Here is the call graph for this function:

◆ setAdministrationPanel()

ilObjWorkspaceFolderGUI::setAdministrationPanel ( bool  $active)

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

130 : void
131 {
132 ilSession::set("il_wsp_admin_panel", $active);
133 }
static set(string $a_var, $a_val)
Set a value.

References ilSession\set().

Referenced by disableAdminPanel(), and enableAdminPanel().

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

◆ setSortation()

ilObjWorkspaceFolderGUI::setSortation ( )
protected

Set sortation.

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

949 : void
950 {
951 $this->user_folder_settings->updateSortation($this->object->getId(), $this->requested_sortation);
952 $this->ctrl->redirect($this, "");
953 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ setTabs()

ilObjWorkspaceFolderGUI::setTabs ( bool  $a_show_settings = true)
protected

Reimplemented in ilObjWorkspaceRootFolderGUI.

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

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

References $help, ilObject2GUI\$lng, addContentSubTabs(), ILIAS\Repository\ctrl(), ilObject2GUI\getAccessHandler(), ilHelpGUI\setScreenIdComponent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ share()

ilObjWorkspaceFolderGUI::share ( bool  $a_load_data = true)

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

681 : void
682 {
684
685 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id, $a_load_data);
686 $tpl->setContent($tbl->getHTML());
687 }

References ilObject2GUI\$tpl, ilObject2GUI\getAccessHandler(), and ILIAS\UICore\GlobalTemplate\setContent().

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 676 of file class.ilObjWorkspaceFolderGUI.php.

676 : void
677 {
678 $this->share(false);
679 }

References share().

Referenced by resetShareFilter().

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

◆ showAdministrationPanel()

ilObjWorkspaceFolderGUI::showAdministrationPanel ( )

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

871 : void
872 {
873 global $DIC;
874
876
877 $main_tpl = $DIC->ui()->mainTemplate();
878
879 $lng->loadLanguageModule('cntr');
880
881 if (!$this->session_repo->isClipboardEmpty()) {
882 // #11545
883 $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
884
885 $toolbar = new ilToolbarGUI();
886 $this->ctrl->setParameter($this, "type", "");
887 $this->ctrl->setParameter($this, "item_ref_id", "");
888
890 $this->lng->txt('paste_clipboard_items'),
891 'paste'
892 );
893
895 $this->lng->txt('clear_clipboard'),
896 'clear'
897 );
898
899 $main_tpl->addAdminPanelToolbar($toolbar, true, false);
900 } elseif ($this->isActiveAdministrationPanel()) {
901 // #11545
902 $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
903
904 $toolbar = new ilToolbarGUI();
905 $this->ctrl->setParameter($this, "type", "");
906 $this->ctrl->setParameter($this, "item_ref_id", "");
907
908 if ($this->object->gotItems($this->node_id)) {
910 ilUtil::getImagePath("nav/arrow_upright.svg"),
911 $lng->txt("actions")
912 );
914 $this->lng->txt('delete_selected_items'),
915 'delete'
916 );
918 $this->lng->txt('move_selected_items'),
919 'cut'
920 );
922 $this->lng->txt('copy_selected_items'),
923 'copy'
924 );
926 $this->lng->txt('download_selected_items'),
927 'download'
928 );
929 // add download button if multi download enabled
930 }
931
932 $main_tpl->addAdminPanelToolbar(
933 $toolbar,
934 $this->object->gotItems($this->node_id) && $this->session_repo->isClipboardEmpty(),
935 ($this->object->gotItems($this->node_id) && $this->session_repo->isClipboardEmpty())
936 );
937
938 // form action needed, see http://www.ilias.de/mantis/view.php?id=9630
939 if ($this->object->gotItems($this->node_id)) {
940 $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
941 }
942 }
943 }
loadLanguageModule(string $a_module)
Load language module.
ilToolbarGUI $toolbar
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLeadingImage(string $a_img, string $a_alt)
addFormButton(string $a_txt, string $a_cmd, ?int $a_acc_key=null, bool $a_primary=false, ?string $a_class=null)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References $DIC, ilObject2GUI\$lng, ilObject2GUI\$toolbar, ilToolbarGUI\addFormButton(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), isActiveAdministrationPanel(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\object(), ilToolbarGUI\setLeadingImage(), and ilLanguage\txt().

Referenced by render().

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

◆ showMoveIntoObjectTree()

ilObjWorkspaceFolderGUI::showMoveIntoObjectTree ( bool  $repo_switch_allowed = false)

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

404 : void
405 {
406 $ilTabs = $this->tabs;
408
409 $ilTabs->clearTargets();
410
411 if (!$this->session_repo->getClipboardShared()) {
412 $ilTabs->setBackTarget(
413 $this->lng->txt('back'),
414 $this->ctrl->getLinkTarget($this)
415 );
416 } else {
417 $ilTabs->setBackTarget(
418 $this->lng->txt('back'),
419 $this->ctrl->getLinkTarget($this, 'share')
420 );
421 }
422
423 $mode = $this->session_repo->getClipboardCmd();
424
425 $this->tpl->setOnScreenMessage('info', $this->lng->txt('msg_' . $mode . '_clipboard'));
426
427 $this->tpl->addBlockFile(
428 'ADM_CONTENT',
429 'adm_content',
430 'tpl.paste_into_multiple_objects.html',
431 "components/ILIAS/WorkspaceFolder"
432 );
433
434 // move/copy in personal workspace
435 if (!$this->session_repo->getClipboardWsp2Repo()) {
436 $exp = new ilWorkspaceExplorerGUI($this->user->getId(), $this, "showMoveIntoObjectTree", $this, "");
437 $exp->setTypeWhiteList(array("wsrt", "wfld"));
438 $exp->setSelectableTypes(array("wsrt", "wfld"));
439 $exp->setSelectMode("node", false);
440 if ($exp->handleCommand()) {
441 return;
442 }
443 $this->tpl->setVariable('OBJECT_TREE', $exp->getHTML());
444
445 // switch to repo?
446 if ($repo_switch_allowed) {
447 $switch_cmd = ($mode == "cut")
448 ? "cut_for_repository"
449 : "copy_to_repository";
450 $this->tpl->setCurrentBlock("switch_button");
451 $this->tpl->setVariable('CMD_SWITCH', $switch_cmd);
452 $this->tpl->setVariable('TXT_SWITCH', $this->lng->txt('wsp_switch_to_repo_tree'));
453 $this->tpl->parseCurrentBlock();
454
455 foreach ($this->std_request->getItemIds() as $id) {
456 $this->tpl->setCurrentBlock("hidden");
457 $this->tpl->setVariable('VALUE', (string) $id);
458 $this->tpl->parseCurrentBlock();
459 }
460 }
461 }
462 // move/copy to repository
463 else {
466 '',
467 'paste_' . $mode . '_repexpand'
468 );
469 $exp->setTargetGet('ref_id');
470
471 if ($this->std_request->getPasteExpand($mode) == '') {
472 $expanded = $tree->readRootId();
473 } else {
474 $expanded = $this->std_request->getPasteExpand($mode);
475 }
476 $exp->setCheckedItems(array($this->std_request->getNode()));
477 $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'showMoveIntoObjectTree'));
478 $exp->setPostVar('node');
479 $exp->setExpand($expanded);
480 $exp->setOutput(0);
481 $this->tpl->setVariable('OBJECT_TREE', $exp->getOutput());
482
483 if (in_array($mode, ["copy", "cut"])) {
484 $switch_cmd = ($mode == "cut")
485 ? "cut_for_workspace"
486 : "copy_to_workspace";
487 $this->tpl->setCurrentBlock("switch_button");
488 $this->tpl->setVariable('CMD_SWITCH', $switch_cmd);
489 $this->tpl->setVariable('TXT_SWITCH', $this->lng->txt('wsp_switch_to_wsp_tree'));
490 $this->tpl->parseCurrentBlock();
491
492 foreach ($this->std_request->getItemIds() as $id) {
493 $this->tpl->setCurrentBlock("hidden");
494 $this->tpl->setVariable('VALUE', (string) $id);
495 $this->tpl->parseCurrentBlock();
496 }
497 }
498 }
499
500
501 unset($exp);
502
503 $this->tpl->setVariable('FORM_TARGET', '_top');
504 $this->tpl->setVariable(
505 'FORM_ACTION',
506 $this->ctrl->getFormAction($this, 'performPasteIntoMultipleObjects')
507 );
508
509 $this->tpl->setVariable('CMD_SUBMIT', 'performPasteIntoMultipleObjects');
510 $this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('paste'));
511 }
ilPasteIntoMultipleItemsExplorer Explorer

References ilObjectGUI\$id, $tabs, ilObjectGUI\$tree, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilTree\readRootId(), ilPasteIntoMultipleItemsExplorer\SEL_TYPE_RADIO, and ILIAS\Repository\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 262 of file class.ilObjWorkspaceFolderGUI.php.

262 : void
263 {
264 parent::update();
265
266 $this->tabs_gui->activateTab("wsp");
267 $this->tabs_gui->activateSubTab("settings");
268 }

Field Documentation

◆ $help

ilHelpGUI ilObjWorkspaceFolderGUI::$help
protected

◆ $repo_gui_service

ILIAS Repository ExternalGUIService ilObjWorkspaceFolderGUI::$repo_gui_service
protected

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

◆ $requested_sortation

int ilObjWorkspaceFolderGUI::$requested_sortation
protected

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

◆ $session_repo

WorkspaceSessionRepository ilObjWorkspaceFolderGUI::$session_repo
protected

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

◆ $std_request

StandardGUIRequest ilObjWorkspaceFolderGUI::$std_request
protected

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

◆ $tabs

ilTabsGUI ilObjWorkspaceFolderGUI::$tabs
protected

◆ $ui

ILIAS DI UIServices ilObjWorkspaceFolderGUI::$ui
protected

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

◆ $user_folder_settings

ilWorkspaceFolderUserSettings ilObjWorkspaceFolderGUI::$user_folder_settings
protected

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

◆ $wsp_log

ilLogger ilObjWorkspaceFolderGUI::$wsp_log
protected

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


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