ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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

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
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
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
 
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
 
ilObjectCustomIconFactory $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 43 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().

44  {
45  global $DIC;
46  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
47 
48  $this->lng = $DIC->language();
49  $this->help = $DIC["ilHelp"];
50  $this->tpl = $DIC->ui()->mainTemplate();
51  $this->user = $DIC->user();
52  $this->tabs = $DIC->tabs();
53  $this->ctrl = $DIC->ctrl();
54  $this->ui = $DIC->ui();
55  $this->session_repo = new WorkspaceSessionRepository();
56 
57  $this->std_request = new StandardGUIRequest(
58  $DIC->http(),
59  $DIC->refinery()
60  );
61 
62  $this->wsp_log = ilLoggerFactory::getLogger("pwsp");
63 
64  $this->user_folder_settings = new ilWorkspaceFolderUserSettings(
65  $this->user->getId(),
67  );
68 
69  $this->requested_sortation = $this->std_request->getSortation();
70 
71  $this->lng->loadLanguageModule("cntr");
72  }
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:22
__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 770 of file class.ilObjWorkspaceFolderGUI.php.

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

770  : void
771  {
772  global $DIC;
773  $ctrl = $DIC->ctrl();
774  $id = explode("_", $a_target);
776  "ilsharedresourceGUI",
777  "wsp_id",
778  $id[0]
779  );
780  $ctrl->redirectByClass("ilsharedresourceGUI");
781  }
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:22
+ Here is the call graph for this function:

◆ addContentSubTabs()

ilObjWorkspaceFolderGUI::addContentSubTabs ( bool  $a_show_settings)
protected

Definition at line 132 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().

132  : void
133  {
134  $tabs = $this->tabs;
135  $ctrl = $this->ctrl;
136  $lng = $this->lng;
137 
138  if ($this->checkPermissionBool("read")) {
139  $tabs->addSubTab("content", $lng->txt("view"), $ctrl->getLinkTarget($this, "disableAdminPanel"));
140  $tabs->addSubTab("manage", $lng->txt("cntr_manage"), $ctrl->getLinkTarget($this, "enableAdminPanel"));
141  }
142 
143  if ($this->checkPermissionBool("write") && $a_show_settings) {
144  $this->tabs_gui->addSubTab(
145  "settings",
146  $lng->txt("settings"),
147  $this->ctrl->getLinkTarget($this, "edit")
148  );
149  }
150 
151  if ($this->isActiveAdministrationPanel()) {
152  $tabs->activateSubTab("manage");
153  } else {
154  $tabs->activateSubTab("content");
155  }
156  }
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 674 of file class.ilObjWorkspaceFolderGUI.php.

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

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

◆ buildAvailableObjectTypes()

ilObjWorkspaceFolderGUI::buildAvailableObjectTypes ( )
protected

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

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

Referenced by render().

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

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

Referenced by buildAvailableObjectTypes().

993  {
994  $icon = $this->ui_factory->symbol()->icon()->custom(
995  \ilObject::_getIcon(0, 'tiny', $type),
996  ''
997  );
998 
999  $this->ctrl->setParameterByClass(self::class, 'new_type', $type);
1000  $element = new AddNewItemElement(
1001  AddNewItemElementTypes::Object,
1002  $this->lng->txt('wsp_type_' . $type),
1003  $icon,
1004  new \ILIAS\Data\URI(ILIAS_HTTP_PATH . '/' . $this->ctrl->getLinkTargetByClass(self::class, 'create'))
1005  );
1006  $this->ctrl->clearParameterByClass(self::class, 'new_type', $type);
1007  return $element;
1008  }
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 845 of file class.ilObjWorkspaceFolderGUI.php.

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

◆ checkPassword()

ilObjWorkspaceFolderGUI::checkPassword ( )
protected

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

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

739  : void
740  {
741  $lng = $this->lng;
742 
743  $ids = $this->std_request->getItemIds();
744  if (count($ids) != 1) {
745  $this->ctrl->redirect($this, "share");
746  }
747  $node_id = current($ids);
748 
749  $form = $this->initPasswordForm($node_id);
750  if ($form->checkInput()) {
752  $input = md5($form->getInput("password"));
753  if ($input == $password) {
754  // we save password and start over
756 
757  $this->ctrl->setParameter($this, "item_ref_id", $node_id);
758  $this->ctrl->redirect($this, "copyShared");
759  } else {
760  $item = $form->getItemByPostVar("password");
761  $item->setAlert($lng->txt("wsp_invalid_password"));
762  $this->tpl->setOnScreenMessage('failure', $lng->txt("form_input_not_valid"));
763  }
764  }
765 
766  $form->setValuesByPost();
767  $this->passwordForm($node_id, $form);
768  }
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 314 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().

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

References copy().

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

◆ copy_to_workspace()

ilObjWorkspaceFolderGUI::copy_to_workspace ( )

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

References copy().

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

◆ copyShared()

ilObjWorkspaceFolderGUI::copyShared ( )

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

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

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

◆ cut()

ilObjWorkspaceFolderGUI::cut ( )

Definition at line 267 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().

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

References cut().

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

◆ cut_for_workspace()

ilObjWorkspaceFolderGUI::cut_for_workspace ( )

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

References cut().

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

◆ deleteConfirmation()

ilObjWorkspaceFolderGUI::deleteConfirmation ( )
protected

Definition at line 792 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().

792  : void
793  {
794  global $DIC;
795 
796  $tpl = $DIC["tpl"];
797  $lng = $DIC["lng"];
798 
799  $item_ids = $this->std_request->getItemIds();
800 
801  if (count($item_ids) == 0) {
802  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
803  $this->ctrl->redirect($this, "");
804  }
805 
806  // on cancel or fail we return to parent node
807  //$parent_node = $this->tree->getParentId($node_id);
808  //$this->ctrl->setParameter($this, "wsp_id", $parent_node);
809 
810  $cgui = new ilConfirmationGUI();
811  $cgui->setHeaderText($lng->txt("info_delete_sure") . "<br/>" .
812  $lng->txt("info_delete_warning_no_trash"));
813 
814  $cgui->setFormAction($this->ctrl->getFormAction($this));
815  $cgui->setCancel($lng->txt("cancel"), "cancelDeletion");
816  $cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
817 
818  foreach ($item_ids as $node_id) {
819  $children = $this->tree->getSubTree($this->tree->getNodeData($node_id));
820  foreach ($children as $child) {
821  $node_id = $child["wsp_id"];
822  $obj_id = $this->tree->lookupObjectId($node_id);
824  $title = call_user_func(array(ilObjectFactory::getClassByType($type),'_lookupTitle'), $obj_id);
825 
826  // if anything fails, abort the whole process
827  if (!$this->checkPermissionBool("delete", "", "", $node_id)) {
828  $this->tpl->setOnScreenMessage('failure', $lng->txt("msg_no_perm_delete") . " " . $title, true);
829  $this->ctrl->redirect($this);
830  }
831 
832  $cgui->addItem(
833  "id[]",
834  $node_id,
835  $title,
836  ilObject::_getIcon($obj_id, "small", $type),
837  $lng->txt("icon") . " " . $lng->txt("obj_" . $type)
838  );
839  }
840  }
841 
842  $tpl->setContent($cgui->getHTML());
843  }
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:22
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 164 of file class.ilObjWorkspaceFolderGUI.php.

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

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

◆ download()

ilObjWorkspaceFolderGUI::download ( )

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

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

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

◆ edit()

ilObjWorkspaceFolderGUI::edit ( )

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

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

◆ enableAdminPanel()

ilObjWorkspaceFolderGUI::enableAdminPanel ( )
protected

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

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

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

◆ executeCommand()

ilObjWorkspaceFolderGUI::executeCommand ( )

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

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

170  : void
171  {
172  $next_class = $this->ctrl->getNextClass($this);
173  $cmd = $this->ctrl->getCmd();
174 
175  switch ($next_class) {
176  case "ilcommonactiondispatchergui":
178  $this->ctrl->forwardCommand($gui);
179  break;
180 
181  case "ilobjectownershipmanagementgui":
182  $this->prepareOutput();
183  $this->tabs_gui->activateTab("ownership");
184  $gui = new ilObjectOwnershipManagementGUI();
185  $this->ctrl->forwardCommand($gui);
186  break;
187 
188  default:
189  $this->prepareOutput();
190  if ($this->type != "wsrt") {
191  $this->addHeaderAction();
192  }
193  if (!$cmd) {
194  $cmd = "render";
195  }
196  $this->$cmd();
197  break;
198  }
199  }
prepareOutput(bool $show_sub_objects=true)
Class ilObjectOwnershipManagementGUI.
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 961 of file class.ilObjWorkspaceFolderGUI.php.

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

Referenced by download().

961  : string
962  {
963  $title = ilFileUtils::getASCIIFilename($this->object->getTitle());
964  if ($title === '') { // $this->>object->getTitle() is empty in root of personal and shared resources
965  $title = $this->lng->txt('personal_resources');
966  }
967  return $title;
968  }
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 74 of file class.ilObjWorkspaceFolderGUI.php.

74  : string
75  {
76  return "wfld";
77  }

◆ initPasswordForm()

ilObjWorkspaceFolderGUI::initPasswordForm ( int  $a_node_id)
protected

Definition at line 714 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().

715  {
716  $ilCtrl = $this->ctrl;
717  $lng = $this->lng;
718 
719  $this->ctrl->setParameter($this, "item_ref_id", $a_node_id);
720 
721  $object_data = $this->getAccessHandler()->getObjectDataFromNode($a_node_id);
722 
723  $form = new ilPropertyFormGUI();
724  $form->setFormAction($ilCtrl->getFormAction($this, "checkPassword"));
725  $form->setTitle($lng->txt("wsp_password_for") . ": " . $object_data["title"]);
726 
727  $password = new ilPasswordInputGUI($lng->txt("password"), "password");
728  $password->setRetype(false);
729  $password->setRequired(true);
730  $password->setSkipSyntaxCheck(true);
731  $form->addItem($password);
732 
733  $form->addCommandButton("checkPassword", $lng->txt("submit"));
734  $form->addCommandButton("share", $lng->txt("cancel"));
735 
736  return $form;
737  }
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 122 of file class.ilObjWorkspaceFolderGUI.php.

References ilSession\get().

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

122  : bool
123  {
124  return (bool) ilSession::get("il_wsp_admin_panel");
125  }
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 783 of file class.ilObjWorkspaceFolderGUI.php.

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

783  : void
784  {
785  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
786  $tbl->resetOffset();
787  $tbl->resetFilter();
788  $tbl->writeFilterToSession();
789  $this->share();
790  }
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 692 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().

692  : void
693  {
694  $tpl = $this->tpl;
695  $lng = $this->lng;
696  $ilTabs = $this->tabs;
697 
698  $tpl->setTitle($lng->txt("wsp_password_protected_resource"));
699  $tpl->setDescription($lng->txt("wsp_password_protected_resource_info"));
700 
701  $ilTabs->clearTargets();
702  $ilTabs->setBackTarget(
703  $lng->txt("back"),
704  $this->ctrl->getLinkTarget($this, "share")
705  );
706 
707  if (!$form) {
708  $form = $this->initPasswordForm($a_node_id);
709  }
710 
711  $tpl->setContent($form->getHTML());
712  }
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 498 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().

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

201  : void
202  {
203  $tpl = $this->tpl;
204  $ilUser = $this->user;
205  $ilCtrl = $this->ctrl;
206 
207  //$this->addContentSubTabs();
208  $this->showAdministrationPanel();
209 
210  $this->session_repo->clearClipboard();
211 
212  // add new item
215  );
216  $gui->render();
217 
219  "",
220  "",
221  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
222  );
223 
224  $gui = new ilWorkspaceContentGUI(
225  $this,
226  $this->node_id,
228  $this->getAccessHandler(),
229  $this->ui,
230  $this->lng,
231  $this->user,
232  $this->obj_definition,
233  $this->ctrl,
234  $this->user_folder_settings
235  );
236  $tpl->setContent($gui->render());
237 
238  $exp = new ilWorkspaceExplorerGUI($ilUser->getId(), $this, "render", $this, "", "wsp_id");
239  $exp->setTypeWhiteList(array("wsrt", "wfld"));
240  $exp->setSelectableTypes(array("wsrt", "wfld"));
241  $exp->setLinkToNodeClass(true);
242  $exp->setActivateHighlighting(true);
243  if ($exp->handleCommand()) {
244  return;
245  }
246  $left = $exp->getHTML();
247 
248  $tpl->setLeftNavContent($left);
249  }
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 683 of file class.ilObjWorkspaceFolderGUI.php.

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

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

◆ setAdministrationPanel()

ilObjWorkspaceFolderGUI::setAdministrationPanel ( bool  $active)

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

References ilSession\set().

Referenced by disableAdminPanel(), and enableAdminPanel().

127  : void
128  {
129  ilSession::set("il_wsp_admin_panel", $active);
130  }
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 934 of file class.ilObjWorkspaceFolderGUI.php.

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

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

◆ setTabs()

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

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

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

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

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

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

666  : void
667  {
668  $tpl = $this->tpl;
669 
670  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id, $a_load_data);
671  $tpl->setContent($tbl->getHTML());
672  }
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 661 of file class.ilObjWorkspaceFolderGUI.php.

References share().

Referenced by resetShareFilter().

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

◆ showAdministrationPanel()

ilObjWorkspaceFolderGUI::showAdministrationPanel ( )

Definition at line 856 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().

856  : void
857  {
858  global $DIC;
859 
860  $lng = $this->lng;
861 
862  $main_tpl = $DIC->ui()->mainTemplate();
863 
864  $lng->loadLanguageModule('cntr');
865 
866  if (!$this->session_repo->isClipboardEmpty()) {
867  // #11545
868  $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
869 
870  $toolbar = new ilToolbarGUI();
871  $this->ctrl->setParameter($this, "type", "");
872  $this->ctrl->setParameter($this, "item_ref_id", "");
873 
875  $this->lng->txt('paste_clipboard_items'),
876  'paste'
877  );
878 
880  $this->lng->txt('clear_clipboard'),
881  'clear'
882  );
883 
884  $main_tpl->addAdminPanelToolbar($toolbar, true, false);
885  } elseif ($this->isActiveAdministrationPanel()) {
886  // #11545
887  $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
888 
889  $toolbar = new ilToolbarGUI();
890  $this->ctrl->setParameter($this, "type", "");
891  $this->ctrl->setParameter($this, "item_ref_id", "");
892 
893  if ($this->object->gotItems($this->node_id)) {
895  ilUtil::getImagePath("nav/arrow_upright.svg"),
896  $lng->txt("actions")
897  );
899  $this->lng->txt('delete_selected_items'),
900  'delete'
901  );
903  $this->lng->txt('move_selected_items'),
904  'cut'
905  );
907  $this->lng->txt('copy_selected_items'),
908  'copy'
909  );
911  $this->lng->txt('download_selected_items'),
912  'download'
913  );
914  // add download button if multi download enabled
915  }
916 
917  $main_tpl->addAdminPanelToolbar(
918  $toolbar,
919  $this->object->gotItems($this->node_id) && $this->session_repo->isClipboardEmpty(),
920  ($this->object->gotItems($this->node_id) && $this->session_repo->isClipboardEmpty())
921  );
922 
923  // form action needed, see http://www.ilias.de/mantis/view.php?id=9630
924  if ($this->object->gotItems($this->node_id)) {
925  $main_tpl->setPageFormAction($this->ctrl->getFormAction($this));
926  }
927  }
928  }
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:22
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 389 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().

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

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

Field Documentation

◆ $help

ilHelpGUI ilObjWorkspaceFolderGUI::$help
protected

◆ $requested_sortation

int ilObjWorkspaceFolderGUI::$requested_sortation
protected

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

Referenced by setSortation().

◆ $session_repo

WorkspaceSessionRepository ilObjWorkspaceFolderGUI::$session_repo
protected

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

◆ $std_request

StandardGUIRequest ilObjWorkspaceFolderGUI::$std_request
protected

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

◆ $tabs

ilTabsGUI ilObjWorkspaceFolderGUI::$tabs
protected

◆ $ui

ILIAS DI UIServices ilObjWorkspaceFolderGUI::$ui
protected

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

◆ $user_folder_settings

ilWorkspaceFolderUserSettings ilObjWorkspaceFolderGUI::$user_folder_settings
protected

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

◆ $wsp_log

ilLogger ilObjWorkspaceFolderGUI::$wsp_log
protected

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


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