ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 ()
 
 isActiveAdministrationPanel ()
 
 setAdministrationPanel (bool $active)
 
 executeCommand ()
 
 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)
 
 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="")
 
 setTargetFrame (string $cmd, string $target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId (int $ref_id, string $cmd="")
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 
 showActions ()
 
 getTabs ()
 
 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 ()
 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.

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().

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

Member Function Documentation

◆ _goto()

static ilObjWorkspaceFolderGUI::_goto ( string  $a_target)
static

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

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

772  : void
773  {
774  global $DIC;
775  $ctrl = $DIC->ctrl();
776  $id = explode("_", $a_target);
778  "ilsharedresourceGUI",
779  "wsp_id",
780  $id[0]
781  );
782  $ctrl->redirectByClass("ilsharedresourceGUI");
783  }
setParameterByClass(string $a_class, string $a_parameter, $a_value)
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

◆ addContentSubTabs()

ilObjWorkspaceFolderGUI::addContentSubTabs ( bool  $a_show_settings)
protected

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

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

Referenced by setTabs().

134  : void
135  {
136  $tabs = $this->tabs;
137  $ctrl = $this->ctrl;
138  $lng = $this->lng;
139 
140  if ($this->checkPermissionBool("read")) {
141  $tabs->addSubTab("content", $lng->txt("view"), $ctrl->getLinkTarget($this, "disableAdminPanel"));
142  $tabs->addSubTab("manage", $lng->txt("cntr_manage"), $ctrl->getLinkTarget($this, "enableAdminPanel"));
143  }
144 
145  if ($this->checkPermissionBool("write") && $a_show_settings) {
146  $this->tabs_gui->addSubTab(
147  "settings",
148  $lng->txt("settings"),
149  $this->ctrl->getLinkTarget($this, "edit")
150  );
151  }
152 
153  if ($this->isActiveAdministrationPanel()) {
154  $tabs->activateSubTab("manage");
155  } else {
156  $tabs->activateSubTab("content");
157  }
158  }
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...
activateSubTab(string $a_id)
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
addSubTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyShareFilter()

ilObjWorkspaceFolderGUI::applyShareFilter ( )

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

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

676  : void
677  {
678  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
679  $tbl->resetOffset();
680  $tbl->writeFilterToSession();
681 
682  $this->share();
683  }
Workspace share handler table GUI class.
+ Here is the call graph for this function:

◆ buildAvailableObjectTypes()

ilObjWorkspaceFolderGUI::buildAvailableObjectTypes ( )
protected

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

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

Referenced by render().

972  : array
973  {
974  $settings_map = [
975  'blog' => 'blogs',
976  'file' => 'files',
977  'webr' => 'links',
978  ];
979 
980  $object_types = $this->obj_definition->getCreatableSubObjects("wfld", ilObjectDefinition::MODE_WORKSPACE);
981  $filtered_object_types = [];
982  foreach (array_keys($object_types) as $type) {
983  if (isset($settings_map[$type])
984  && $this->settings->get("disable_wsp_" . $settings_map[$type])) {
985  continue;
986  }
987 
988  $filtered_object_types[] = $this->buildObjectType($type);
989  }
990 
991  return $filtered_object_types;
992  }
+ 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 994 of file class.ilObjWorkspaceFolderGUI.php.

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

Referenced by buildAvailableObjectTypes().

995  {
996  $icon = $this->ui_factory->symbol()->icon()->custom(
997  \ilObject::_getIcon(0, 'tiny', $type),
998  ''
999  );
1000 
1001  $this->ctrl->setParameterByClass(self::class, 'new_type', $type);
1002  $element = new AddNewItemElement(
1003  AddNewItemElementTypes::Object,
1004  $this->lng->txt('wsp_type_' . $type),
1005  $icon,
1006  new \ILIAS\Data\URI(ILIAS_HTTP_PATH . '/' . $this->ctrl->getLinkTargetByClass(self::class, 'create'))
1007  );
1008  $this->ctrl->clearParameterByClass(self::class, 'new_type', $type);
1009  return $element;
1010  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancelDeletion()

ilObjWorkspaceFolderGUI::cancelDeletion ( )

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

848  {
849  $this->session_repo->clearClipboard();
850  parent::cancelDelete();
851  }

◆ checkPassword()

ilObjWorkspaceFolderGUI::checkPassword ( )
protected

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

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

741  : void
742  {
743  $lng = $this->lng;
744 
745  $ids = $this->std_request->getItemIds();
746  if (count($ids) != 1) {
747  $this->ctrl->redirect($this, "share");
748  }
749  $node_id = current($ids);
750 
751  $form = $this->initPasswordForm($node_id);
752  if ($form->checkInput()) {
754  $input = md5($form->getInput("password"));
755  if ($input == $password) {
756  // we save password and start over
758 
759  $this->ctrl->setParameter($this, "item_ref_id", $node_id);
760  $this->ctrl->redirect($this, "copyShared");
761  } else {
762  $item = $form->getItemByPostVar("password");
763  $item->setAlert($lng->txt("wsp_invalid_password"));
764  $this->tpl->setOnScreenMessage('failure', $lng->txt("form_input_not_valid"));
765  }
766  }
767 
768  $form->setValuesByPost();
769  $this->passwordForm($node_id, $form);
770  }
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...
passwordForm(int $a_node_id, ?ilPropertyFormGUI $form=null)
static getSharedNodePassword(int $a_node_id)
static keepSharedSessionPassword(int $a_node_id, string $a_password)
+ Here is the call graph for this function:

◆ copy()

ilObjWorkspaceFolderGUI::copy ( )

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

References ilObject2GUI\$user, ilObject\_lookupType(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and showMoveIntoObjectTree().

Referenced by copy_to_repository(), and copy_to_workspace().

316  : void
317  {
318  $ilUser = $this->user;
319 
320  $item_ids = $this->std_request->getItemIds();
321  if (count($item_ids) == 0) {
322  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
323  $this->ctrl->redirect($this);
324  }
325 
326  // on cancel or fail we return to parent node
327  $this->ctrl->setParameter($this, "wsp_id", $this->node_id);
328 
329  $repo_switch_allowed = true;
330  foreach ($item_ids as $item_id) {
331  $node = $this->tree->getNodeData($item_id);
332  if (ilObject::_lookupType($node["obj_id"]) != "file") {
333  $repo_switch_allowed = false;
334  }
335  $current_node = $item_id;
336  $owner = $this->tree->lookupOwner($current_node);
337  if ($owner != $ilUser->getId()) {
338  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
339  $this->ctrl->redirect($this);
340  }
341  }
342 
343  // remember source node
344  $this->session_repo->setClipboardSourceIds($item_ids);
345  $this->session_repo->setClipboardCmd('copy');
346 
347  $this->showMoveIntoObjectTree($repo_switch_allowed);
348  }
showMoveIntoObjectTree(bool $repo_switch_allowed=false)
static _lookupType(int $id, bool $reference=false)
+ 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 379 of file class.ilObjWorkspaceFolderGUI.php.

References copy().

379  : void
380  {
381  $this->session_repo->setClipboardWsp2Repo(true);
382  $this->copy();
383  }
+ Here is the call graph for this function:

◆ copy_to_workspace()

ilObjWorkspaceFolderGUI::copy_to_workspace ( )

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

References copy().

385  : void
386  {
387  $this->session_repo->setClipboardWsp2Repo(false);
388  $this->copy();
389  }
+ Here is the call graph for this function:

◆ copyShared()

ilObjWorkspaceFolderGUI::copyShared ( )

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

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

350  : void
351  {
352  $ids = $this->std_request->getItemIds();
353  if (count($ids) != 1) {
354  $this->ctrl->redirect($this, "share");
355  }
356 
357  $current_node = current($ids);
358  $handler = $this->getAccessHandler();
359  // see ilSharedRessourceGUI::hasAccess()
360  if ($handler->checkAccess("read", "", $current_node)) {
361  // remember source node
362  $this->session_repo->setClipboardSourceIds([$current_node]);
363  $this->session_repo->setClipboardCmd('copy');
364  $this->session_repo->setClipboardShared(true);
365  $this->showMoveIntoObjectTree();
366  return;
367  } else {
368  $perms = $handler->getPermissions($current_node);
369  if (in_array(ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD, $perms)) {
370  $this->passwordForm($current_node);
371  return;
372  }
373  }
374 
375  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
376  $this->ctrl->redirect($this, "share");
377  }
passwordForm(int $a_node_id, ?ilPropertyFormGUI $form=null)
$handler
Definition: oai.php:29
showMoveIntoObjectTree(bool $repo_switch_allowed=false)
+ Here is the call graph for this function:

◆ cut()

ilObjWorkspaceFolderGUI::cut ( )

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

References ilObject\_lookupType(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilObjectFactory\getInstanceByObjId(), ILIAS\Repository\lng(), and showMoveIntoObjectTree().

Referenced by cut_for_repository(), and cut_for_workspace().

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

References cut().

304  : void
305  {
306  $this->session_repo->setClipboardWsp2Repo(true);
307  $this->cut();
308  }
+ Here is the call graph for this function:

◆ cut_for_workspace()

ilObjWorkspaceFolderGUI::cut_for_workspace ( )

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

References cut().

310  : void
311  {
312  $this->session_repo->setClipboardWsp2Repo(false);
313  $this->cut();
314  }
+ Here is the call graph for this function:

◆ deleteConfirmation()

ilObjWorkspaceFolderGUI::deleteConfirmation ( )
protected

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

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().

794  : void
795  {
796  global $DIC;
797 
798  $tpl = $DIC["tpl"];
799  $lng = $DIC["lng"];
800 
801  $item_ids = $this->std_request->getItemIds();
802 
803  if (count($item_ids) == 0) {
804  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
805  $this->ctrl->redirect($this, "");
806  }
807 
808  // on cancel or fail we return to parent node
809  //$parent_node = $this->tree->getParentId($node_id);
810  //$this->ctrl->setParameter($this, "wsp_id", $parent_node);
811 
812  $cgui = new ilConfirmationGUI();
813  $cgui->setHeaderText($lng->txt("info_delete_sure") . "<br/>" .
814  $lng->txt("info_delete_warning_no_trash"));
815 
816  $cgui->setFormAction($this->ctrl->getFormAction($this));
817  $cgui->setCancel($lng->txt("cancel"), "cancelDeletion");
818  $cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
819 
820  foreach ($item_ids as $node_id) {
821  $children = $this->tree->getSubTree($this->tree->getNodeData($node_id));
822  foreach ($children as $child) {
823  $node_id = $child["wsp_id"];
824  $obj_id = $this->tree->lookupObjectId($node_id);
826  $title = call_user_func(array(ilObjectFactory::getClassByType($type),'_lookupTitle'), $obj_id);
827 
828  // if anything fails, abort the whole process
829  if (!$this->checkPermissionBool("delete", "", "", $node_id)) {
830  $this->tpl->setOnScreenMessage('failure', $lng->txt("msg_no_perm_delete") . " " . $title, true);
831  $this->ctrl->redirect($this);
832  }
833 
834  $cgui->addItem(
835  "id[]",
836  $node_id,
837  $title,
838  ilObject::_getIcon($obj_id, "small", $type),
839  $lng->txt("icon") . " " . $lng->txt("obj_" . $type)
840  );
841  }
842  }
843 
844  $tpl->setContent($cgui->getHTML());
845  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
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...
setContent(string $a_html)
Sets content for standard template.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
global $DIC
Definition: shib_login.php:26
ilGlobalTemplateInterface $tpl
static getClassByType(string $obj_type)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ disableAdminPanel()

ilObjWorkspaceFolderGUI::disableAdminPanel ( )
protected

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

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

166  : void
167  {
168  $this->setAdministrationPanel(false);
169  $this->ctrl->redirect($this, "");
170  }
+ Here is the call graph for this function:

◆ download()

ilObjWorkspaceFolderGUI::download ( )

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

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

942  : void
943  {
944  // This variable determines whether the task has been initiated by a folder's action drop-down to prevent a folder
945  // duplicate inside the zip.
946  $initiated_by_folder_action = false;
947 
948  $ids = $this->std_request->getItemIds();
949 
950  if (count($ids) == 0) {
951  $this->ctrl->redirect($this, "");
952  }
953 
954  $download_job = new ilDownloadWorkspaceFolderBackgroundTask($GLOBALS['DIC']->user()->getId(), $ids, $initiated_by_folder_action);
955 
956  $download_job->setBucketTitle($this->getBucketTitle());
957  if ($download_job->run()) {
958  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_bt_download_started'), true);
959  }
960  $this->ctrl->redirect($this);
961  }
$GLOBALS["DIC"]
Definition: wac.php:53
+ Here is the call graph for this function:

◆ edit()

ilObjWorkspaceFolderGUI::edit ( )

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

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

◆ enableAdminPanel()

ilObjWorkspaceFolderGUI::enableAdminPanel ( )
protected

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

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

160  : void
161  {
162  $this->setAdministrationPanel(true);
163  $this->ctrl->redirect($this, "");
164  }
+ Here is the call graph for this function:

◆ executeCommand()

ilObjWorkspaceFolderGUI::executeCommand ( )

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

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

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

◆ getBucketTitle()

ilObjWorkspaceFolderGUI::getBucketTitle ( )

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

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

Referenced by download().

963  : string
964  {
965  $title = ilFileUtils::getASCIIFilename($this->object->getTitle());
966  if ($title === '') { // $this->>object->getTitle() is empty in root of personal and shared resources
967  $title = $this->lng->txt('personal_resources');
968  }
969  return $title;
970  }
static getASCIIFilename(string $a_filename)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilObjWorkspaceFolderGUI::getType ( )

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

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

◆ initPasswordForm()

ilObjWorkspaceFolderGUI::initPasswordForm ( int  $a_node_id)
protected

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

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

Referenced by checkPassword(), and passwordForm().

717  {
718  $ilCtrl = $this->ctrl;
719  $lng = $this->lng;
720 
721  $this->ctrl->setParameter($this, "item_ref_id", $a_node_id);
722 
723  $object_data = $this->getAccessHandler()->getObjectDataFromNode($a_node_id);
724 
725  $form = new ilPropertyFormGUI();
726  $form->setFormAction($ilCtrl->getFormAction($this, "checkPassword"));
727  $form->setTitle($lng->txt("wsp_password_for") . ": " . $object_data["title"]);
728 
729  $password = new ilPasswordInputGUI($lng->txt("password"), "password");
730  $password->setRetype(false);
731  $password->setRequired(true);
732  $password->setSkipSyntaxCheck(true);
733  $form->addItem($password);
734 
735  $form->addCommandButton("checkPassword", $lng->txt("submit"));
736  $form->addCommandButton("share", $lng->txt("cancel"));
737 
738  return $form;
739  }
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...
This class represents a password property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActiveAdministrationPanel()

ilObjWorkspaceFolderGUI::isActiveAdministrationPanel ( )

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

References ilSession\get().

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

124  : bool
125  {
126  return (bool) ilSession::get("il_wsp_admin_panel");
127  }
static get(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listSharedResourcesOfOtherUser()

ilObjWorkspaceFolderGUI::listSharedResourcesOfOtherUser ( )

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

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

785  : void
786  {
787  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
788  $tbl->resetOffset();
789  $tbl->resetFilter();
790  $tbl->writeFilterToSession();
791  $this->share();
792  }
Workspace share handler table GUI class.
+ Here is the call graph for this function:

◆ passwordForm()

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

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

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

Referenced by checkPassword(), and copyShared().

694  : void
695  {
696  $tpl = $this->tpl;
697  $lng = $this->lng;
698  $ilTabs = $this->tabs;
699 
700  $tpl->setTitle($lng->txt("wsp_password_protected_resource"));
701  $tpl->setDescription($lng->txt("wsp_password_protected_resource_info"));
702 
703  $ilTabs->clearTargets();
704  $ilTabs->setBackTarget(
705  $lng->txt("back"),
706  $this->ctrl->getLinkTarget($this, "share")
707  );
708 
709  if (!$form) {
710  $form = $this->initPasswordForm($a_node_id);
711  }
712 
713  $tpl->setContent($form->getHTML());
714  }
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...
setContent(string $a_html)
Sets content for standard template.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
ilGlobalTemplateInterface $tpl
setDescription(string $a_descr)
Sets description below title in standard template.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performPasteIntoMultipleObjects()

ilObjWorkspaceFolderGUI::performPasteIntoMultipleObjects ( )

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

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().

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

◆ render()

ilObjWorkspaceFolderGUI::render ( )

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

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(), ilTreeExplorerGUI\setTypeWhiteList(), showAdministrationPanel(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

203  : void
204  {
205  $tpl = $this->tpl;
206  $ilUser = $this->user;
207  $ilCtrl = $this->ctrl;
208 
209  //$this->addContentSubTabs();
210  $this->showAdministrationPanel();
211 
212  $this->session_repo->clearClipboard();
213 
214  // add new item
217  );
218  $gui->render();
219 
221  "",
222  "",
223  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
224  );
225 
226  $gui = new ilWorkspaceContentGUI(
227  $this,
228  $this->node_id,
230  $this->getAccessHandler(),
231  $this->ui,
232  $this->lng,
233  $this->user,
234  $this->obj_definition,
235  $this->ctrl,
236  $this->user_folder_settings
237  );
238  $tpl->setContent($gui->render());
239 
240  $exp = new ilWorkspaceExplorerGUI($ilUser->getId(), $this, "render", $this, "", "wsp_id");
241  $exp->setTypeWhiteList(array("wsrt", "wfld"));
242  $exp->setSelectableTypes(array("wsrt", "wfld"));
243  $exp->setLinkToNodeClass(true);
244  $exp->setActivateHighlighting(true);
245  if ($exp->handleCommand()) {
246  return;
247  }
248  $left = $exp->getHTML();
249 
250  $tpl->setLeftNavContent($left);
251  }
setTypeWhiteList(array $a_val)
Set type white list.
setContent(string $a_html)
Sets content for standard template.
Explorer for selecting a personal workspace item.
ilGlobalTemplateInterface $tpl
setLeftNavContent(string $a_content)
Sets content of left navigation column.
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...
+ Here is the call graph for this function:

◆ resetShareFilter()

ilObjWorkspaceFolderGUI::resetShareFilter ( )

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

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

685  : void
686  {
687  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
688  $tbl->resetOffset();
689  $tbl->resetFilter();
690 
691  $this->shareFilter();
692  }
Workspace share handler table GUI class.
+ Here is the call graph for this function:

◆ setAdministrationPanel()

ilObjWorkspaceFolderGUI::setAdministrationPanel ( bool  $active)

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

References ilSession\set().

Referenced by disableAdminPanel(), and enableAdminPanel().

129  : void
130  {
131  ilSession::set("il_wsp_admin_panel", $active);
132  }
static set(string $a_var, $a_val)
Set a value.
+ 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 936 of file class.ilObjWorkspaceFolderGUI.php.

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

936  : void
937  {
938  $this->user_folder_settings->updateSortation($this->object->getId(), $this->requested_sortation);
939  $this->ctrl->redirect($this, "");
940  }
+ Here is the call graph for this function:

◆ setTabs()

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

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

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

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

◆ share()

ilObjWorkspaceFolderGUI::share ( bool  $a_load_data = true)

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

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

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

668  : void
669  {
670  $tpl = $this->tpl;
671 
672  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id, $a_load_data);
673  $tpl->setContent($tbl->getHTML());
674  }
setContent(string $a_html)
Sets content for standard template.
Workspace share handler table GUI class.
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shareFilter()

ilObjWorkspaceFolderGUI::shareFilter ( )

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

References share().

Referenced by resetShareFilter().

663  : void
664  {
665  $this->share(false);
666  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showAdministrationPanel()

ilObjWorkspaceFolderGUI::showAdministrationPanel ( )

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

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().

858  : void
859  {
860  global $DIC;
861 
862  $lng = $this->lng;
863 
864  $main_tpl = $DIC->ui()->mainTemplate();
865 
866  $lng->loadLanguageModule('cntr');
867 
868  if (!$this->session_repo->isClipboardEmpty()) {
869  // #11545
870  $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
871 
872  $toolbar = new ilToolbarGUI();
873  $this->ctrl->setParameter($this, "type", "");
874  $this->ctrl->setParameter($this, "item_ref_id", "");
875 
877  $this->lng->txt('paste_clipboard_items'),
878  'paste'
879  );
880 
882  $this->lng->txt('clear_clipboard'),
883  'clear'
884  );
885 
886  $main_tpl->addAdminPanelToolbar($toolbar, true, false);
887  } elseif ($this->isActiveAdministrationPanel()) {
888  // #11545
889  $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
890 
891  $toolbar = new ilToolbarGUI();
892  $this->ctrl->setParameter($this, "type", "");
893  $this->ctrl->setParameter($this, "item_ref_id", "");
894 
895  if ($this->object->gotItems($this->node_id)) {
897  ilUtil::getImagePath("nav/arrow_upright.svg"),
898  $lng->txt("actions")
899  );
901  $this->lng->txt('delete_selected_items'),
902  'delete'
903  );
905  $this->lng->txt('move_selected_items'),
906  'cut'
907  );
909  $this->lng->txt('copy_selected_items'),
910  'copy'
911  );
913  $this->lng->txt('download_selected_items'),
914  'download'
915  );
916  // add download button if multi download enabled
917  }
918 
919  $main_tpl->addAdminPanelToolbar(
920  $toolbar,
921  $this->object->gotItems($this->node_id) && $this->session_repo->isClipboardEmpty(),
922  ($this->object->gotItems($this->node_id) && $this->session_repo->isClipboardEmpty())
923  );
924 
925  // form action needed, see http://www.ilias.de/mantis/view.php?id=9630
926  if ($this->object->gotItems($this->node_id)) {
927  $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
928  }
929  }
930  }
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...
setLeadingImage(string $a_img, string $a_alt)
loadLanguageModule(string $a_module)
Load language module.
ilToolbarGUI $toolbar
global $DIC
Definition: shib_login.php:26
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
addFormButton(string $a_txt, string $a_cmd, ?int $a_acc_key=null, bool $a_primary=false, ?string $a_class=null)
+ 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 391 of file class.ilObjWorkspaceFolderGUI.php.

References ilObjectGUI\$id, $tabs, ilObjectGUI\$tree, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilTree\readRootId(), ilPasteIntoMultipleItemsExplorer\SEL_TYPE_RADIO, ilTreeExplorerGUI\setTypeWhiteList(), and ILIAS\Repository\user().

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

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

◆ update()

ilObjWorkspaceFolderGUI::update ( )

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

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

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.

Referenced by setSortation().

◆ $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: