ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjWorkspaceFolderGUI Class Reference

Class ilObjWorkspaceFolderGUI. More...

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

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

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

Additional Inherited Members

- Data Fields inherited from ilObject2GUI
 $tree
 
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjWorkspaceFolderGUI::_goto (   $a_target)
static

Deep link.

Parameters
string$a_target

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

References $_GET, and exit.

726  {
727  $id = explode("_", $a_target);
728 
729  $_GET["baseClass"] = "ilsharedresourceGUI";
730  $_GET["wsp_id"] = $id[0];
731  include("ilias.php");
732  exit;
733  }
$_GET["client_id"]

◆ applyShareFilter()

ilObjWorkspaceFolderGUI::applyShareFilter ( )

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

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

621  {
622  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
623  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
624  $tbl->resetOffset();
625  $tbl->writeFilterToSession();
626 
627  $this->share();
628  }
$tbl
Definition: example_048.php:81
getAccessHandler()
Get access handler.
Workspace share handler table GUI class.
+ Here is the call graph for this function:

◆ checkPassword()

ilObjWorkspaceFolderGUI::checkPassword ( )
protected

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

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

685  {
686  global $lng;
687 
688  $node_id = $_REQUEST["item_ref_id"];
689  if(!$node_id)
690  {
691  $this->ctrl->redirect($this, "share");
692  }
693 
694  $form = $this->initPasswordForm($node_id);
695  if($form->checkInput())
696  {
697  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
699  $input = md5($form->getInput("password"));
700  if($input == $password)
701  {
702  // we save password and start over
704 
705  $this->ctrl->setParameter($this, "item_ref_id", $node_id);
706  $this->ctrl->redirect($this, "copyShared");
707  }
708  else
709  {
710  $item = $form->getItemByPostVar("password");
711  $item->setAlert($lng->txt("wsp_invalid_password"));
712  ilUtil::sendFailure($lng->txt("form_input_not_valid"));
713  }
714  }
715 
716  $form->setValuesByPost();
717  $this->passwordForm($node_id, $form);
718  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static keepSharedSessionPassword($a_node_id, $a_password)
+ Here is the call graph for this function:

◆ copy()

ilObjWorkspaceFolderGUI::copy ( )

Copy node preparation.

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

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

References $_SESSION, $ilUser, ilObject2GUI\$node_id, array, ilUtil\sendFailure(), and showMoveIntoObjectTree().

Referenced by copy_to_repository().

264  {
265  global $ilUser;
266 
267  if (!$_REQUEST["item_ref_id"])
268  {
269  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
270  $this->ctrl->redirect($this);
271  }
272 
273  $current_node = $_REQUEST["item_ref_id"];
274  $owner = $this->tree->lookupOwner($current_node);
275  if($owner == $ilUser->getId())
276  {
277  $parent_node = $this->tree->getParentId($current_node);
278 
279  // on cancel or fail we return to parent node
280  $this->ctrl->setParameter($this, "wsp_id", $parent_node);
281 
282  // open current position
283  // using the explorer session storage directly is basically a hack
284  // as we do not use setExpanded() [see below]
285  $_SESSION['paste_copy_wspexpand'] = array();
286  foreach((array)$this->tree->getPathId($parent_node) as $node_id)
287  {
288  $_SESSION['paste_copy_wspexpand'][] = $node_id;
289  }
290  }
291  else
292  {
293  // see copyShared()
294  ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
295  $this->ctrl->redirect($this);
296  }
297 
298  // remember source node
299  $_SESSION['clipboard']['source_id'] = $current_node;
300  $_SESSION['clipboard']['cmd'] = 'copy';
301 
302  return $this->showMoveIntoObjectTree();
303  }
$_SESSION["AccountId"]
showMoveIntoObjectTree()
Move node: select target (via explorer)
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_to_repository()

ilObjWorkspaceFolderGUI::copy_to_repository ( )

Copy node preparation (to repository)

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

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

References $_SESSION, and copy().

344  {
345  $_SESSION['clipboard']['wsp2repo'] = true;
346  $this->copy();
347  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:

◆ copyShared()

ilObjWorkspaceFolderGUI::copyShared ( )

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

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

306  {
307  if (!$_REQUEST["item_ref_id"])
308  {
309  $this->ctrl->redirect($this, "share");
310  }
311 
312  $current_node = $_REQUEST["item_ref_id"];
313  $handler = $this->getAccessHandler();
314 
315  // see ilSharedRessourceGUI::hasAccess()
316  if($handler->checkAccess("read", "", $current_node))
317  {
318  // remember source node
319  $_SESSION['clipboard']['source_id'] = $current_node;
320  $_SESSION['clipboard']['cmd'] = 'copy';
321  $_SESSION['clipboard']['shared'] = true;
322 
323  return $this->showMoveIntoObjectTree();
324  }
325  else
326  {
327  $perms = $handler->getPermissions($current_node);
329  {
330  return $this->passwordForm($current_node);
331  }
332  }
333 
334  ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
335  $this->ctrl->redirect($this, "share");
336  }
$_SESSION["AccountId"]
getAccessHandler()
Get access handler.
showMoveIntoObjectTree()
Move node: select target (via explorer)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ cut()

ilObjWorkspaceFolderGUI::cut ( )

Move node preparation.

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

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

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

Referenced by cut_for_repository().

201  {
202  if (!$_REQUEST["item_ref_id"])
203  {
204  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
205  $this->ctrl->redirect($this);
206  }
207 
208  $current_node = $_REQUEST["item_ref_id"];
209  $parent_node = $this->tree->getParentId($current_node);
210 
211  // on cancel or fail we return to parent node
212  $this->ctrl->setParameter($this, "wsp_id", $parent_node);
213 
214  // check permission
215  $no_cut = array();
216  foreach ($this->tree->getSubTree($this->tree->getNodeData($current_node)) as $node)
217  {
218  if (!$this->checkPermissionBool("delete", "", "", $node["wsp_id"]))
219  {
220  $obj = ilObjectFactory::getInstanceByObjId($node["obj_id"]);
221  $no_cut[$node["wsp_id"]] = $obj->getTitle();
222  unset($obj);
223  }
224  }
225  if (count($no_cut))
226  {
227  ilUtil::sendFailure($this->lng->txt("msg_no_perm_cut")." ".implode(',', $no_cut), true);
228  $this->ctrl->redirect($this);
229  }
230 
231  // open current position
232  // using the explorer session storage directly is basically a hack
233  // as we do not use setExpanded() [see below]
234  $_SESSION['paste_cut_wspexpand'] = array();
235  foreach((array)$this->tree->getPathId($parent_node) as $node_id)
236  {
237  $_SESSION['paste_cut_wspexpand'][] = $node_id;
238  }
239 
240  // remember source node
241  $_SESSION['clipboard']['source_id'] = $current_node;
242  $_SESSION['clipboard']['cmd'] = 'cut';
243 
244  return $this->showMoveIntoObjectTree();
245  }
$_SESSION["AccountId"]
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
showMoveIntoObjectTree()
Move node: select target (via explorer)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cut_for_repository()

ilObjWorkspaceFolderGUI::cut_for_repository ( )

Move node preparation (to repository)

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

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

References $_SESSION, and cut().

253  {
254  $_SESSION['clipboard']['wsp2repo'] = true;
255  $this->cut();
256  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:

◆ edit()

ilObjWorkspaceFolderGUI::edit ( )

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

180  {
181  parent::edit();
182 
183  $this->tabs_gui->activateTab("wsp");
184  $this->tabs_gui->activateSubTab("settings");
185  }

◆ executeCommand()

ilObjWorkspaceFolderGUI::executeCommand ( )

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

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

76  {
77  $next_class = $this->ctrl->getNextClass($this);
78  $cmd = $this->ctrl->getCmd();
79 
80  switch($next_class)
81  {
82  case "ilcommonactiondispatchergui":
83  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
85  $this->ctrl->forwardCommand($gui);
86  break;
87 
88  case "ilobjectownershipmanagementgui":
89  $this->prepareOutput();
90  $this->tabs_gui->activateTab("ownership");
91  include_once("Services/Object/classes/class.ilObjectOwnershipManagementGUI.php");
92  $gui = new ilObjectOwnershipManagementGUI();
93  $this->ctrl->forwardCommand($gui);
94  break;
95 
96  default:
97  $this->prepareOutput();
98  if($this->type != "wsrt")
99  {
100  $this->addHeaderAction();
101  }
102  if(!$cmd)
103  {
104  $cmd = "render";
105  }
106  $this->$cmd();
107  break;
108  }
109 
110  return true;
111  }
$cmd
Definition: sahs_server.php:35
Class ilObjectOwnershipManagementGUI.
prepareOutput($a_show_subobjects=true)
addHeaderAction()
Add header action menu.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ getType()

ilObjWorkspaceFolderGUI::getType ( )

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

21  {
22  return "wfld";
23  }

◆ initCreationForms()

ilObjWorkspaceFolderGUI::initCreationForms (   $a_new_type)
protected

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

References array, and ilObjectGUI\initCreateForm().

114  {
115  $forms = array(
116  self::CFORM_NEW => $this->initCreateForm($a_new_type)
117  );
118 
119  return $forms;
120  }
initCreateForm($a_new_type)
Init object creation form.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ initPasswordForm()

ilObjWorkspaceFolderGUI::initPasswordForm (   $a_node_id)
protected

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

References $ilCtrl, ilObjectGUI\$lng, ilObject2GUI\getAccessHandler(), and ilPasswordInputGUI\setRetype().

Referenced by checkPassword(), and passwordForm().

660  {
661  global $ilCtrl, $lng;
662 
663  $this->ctrl->setParameter($this, "item_ref_id", $a_node_id);
664 
665  $object_data = $this->getAccessHandler()->getObjectDataFromNode($a_node_id);
666 
667  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
668  $form = new ilPropertyFormGUI();
669  $form->setFormAction($ilCtrl->getFormAction($this, "checkPassword"));
670  $form->setTitle($lng->txt("wsp_password_for").": ".$object_data["title"]);
671 
672  $password = new ilPasswordInputGUI($lng->txt("password"), "password");
673  $password->setRetype(false);
674  $password->setRequired(true);
675  $password->setSkipSyntaxCheck(true);
676  $form->addItem($password);
677 
678  $form->addCommandButton("checkPassword", $lng->txt("submit"));
679  $form->addCommandButton("share", $lng->txt("cancel"));
680 
681  return $form;
682  }
This class represents a property form user interface.
getAccessHandler()
Get access handler.
setRetype($a_val)
Set retype on/off.
global $ilCtrl
Definition: ilias.php:18
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:

◆ listSharedResourcesOfOtherUser()

ilObjWorkspaceFolderGUI::listSharedResourcesOfOtherUser ( )

Entry point for awareness tool.

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

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

739  {
740  global $ilCtrl;
741 
742  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
743  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
744  $tbl->resetOffset();
745  $tbl->resetFilter();
746  $_POST["user"] = $_GET["user"];
747  $tbl->writeFilterToSession();
748  $this->share();
749  }
$_GET["client_id"]
$tbl
Definition: example_048.php:81
getAccessHandler()
Get access handler.
global $ilCtrl
Definition: ilias.php:18
Workspace share handler table GUI class.
$_POST["username"]
+ Here is the call graph for this function:

◆ passwordForm()

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

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

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

Referenced by checkPassword(), and copyShared().

641  {
642  global $tpl, $lng, $ilTabs;
643 
644  $tpl->setTitle($lng->txt("wsp_password_protected_resource"));
645  $tpl->setDescription($lng->txt("wsp_password_protected_resource_info"));
646 
647  $ilTabs->clearTargets();
648  $ilTabs->setBackTarget($lng->txt("back"),
649  $this->ctrl->getLinkTarget($this, "share"));
650 
651  if(!$form)
652  {
653  $form = $this->initPasswordForm($a_node_id);
654  }
655 
656  $tpl->setContent($form->getHTML());
657  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performPasteIntoMultipleObjects()

ilObjWorkspaceFolderGUI::performPasteIntoMultipleObjects ( )

Move node: target has been selected, execute.

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

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

434  {
435  global $ilUser;
436 
437  $mode = $_SESSION['clipboard']['cmd'];
438  $source_node_id = $_SESSION['clipboard']['source_id'];
439  $target_node_id = $_REQUEST['node'];
440 
441  if(!$source_node_id)
442  {
443  ilUtil::sendFailure($this->lng->txt('select_at_least_one_object'), true);
444  $this->ctrl->redirect($this);
445  }
446  if(!$target_node_id)
447  {
448  ilUtil::sendFailure($this->lng->txt('select_at_least_one_object'), true);
449  $this->ctrl->redirect($this, "showMoveIntoObjectTree");
450  }
451 
452  // object instances
453  $source_obj_id = $this->tree->lookupObjectId($source_node_id);
454  $source_object = ilObjectFactory::getInstanceByObjId($source_obj_id);
455 
456  if(!$_SESSION['clipboard']['wsp2repo'])
457  {
458  $target_obj_id = $this->tree->lookupObjectId($target_node_id);
459  }
460  else
461  {
462  $target_obj_id = ilObject::_lookupObjId($target_node_id);
463  }
464  $target_object = ilObjectFactory::getInstanceByObjId($target_obj_id);
465 
466 
467  // sanity checks
468 
469  $fail = array();
470 
471  if($source_node_id == $target_node_id)
472  {
473  $fail[] = sprintf($this->lng->txt('msg_obj_exists_in_folder'),
474  $source_object->getTitle(), $target_object->getTitle());
475  }
476 
477  if(!in_array($source_object->getType(), array_keys($target_object->getPossibleSubObjects())))
478  {
479  $fail[] = sprintf($this->lng->txt('msg_obj_may_not_contain_objects_of_type'),
480  $target_object->getTitle(), $source_object->getType());
481  }
482 
483  // if object is shared permission to copy has been checked above
484  $owner = $this->tree->lookupOwner($source_node_id);
485  if($mode == "copy" && $ilUser->getId() == $owner && !$this->checkPermissionBool('copy', '', '', $source_node_id))
486  {
487  $fail[] = $this->lng->txt('permission_denied');
488  }
489 
490  if(!$_SESSION['clipboard']['wsp2repo'])
491  {
492  if($mode == "cut" && $this->tree->isGrandChild($source_node_id, $target_node_id))
493  {
494  $fail[] = sprintf($this->lng->txt('msg_paste_object_not_in_itself'),
495  $source_object->getTitle());
496  }
497  }
498 
499  if ($_SESSION['clipboard']['wsp2repo'] == true) // see #22959
500  {
501  global $ilAccess;
502  if (!$ilAccess->checkAccess("create", "", $target_node_id, $source_object->getType()))
503  {
504  $fail[] = sprintf($this->lng->txt('msg_no_perm_paste_object_in_folder'),
505  $source_object->getTitle(), $target_object->getTitle());
506  }
507  }
508  else
509  {
510  if (!$this->checkPermissionBool('create', '', $source_object->getType(), $target_node_id))
511  {
512  $fail[] = sprintf($this->lng->txt('msg_no_perm_paste_object_in_folder'),
513  $source_object->getTitle(), $target_object->getTitle());
514  }
515  }
516 
517  if(sizeof($fail))
518  {
519  ilUtil::sendFailure(implode("<br />", $fail), true);
520  $this->ctrl->redirect($this);
521  }
522 
523 
524  // move the node
525  if($mode == "cut")
526  {
527  if(!$_SESSION['clipboard']['wsp2repo'])
528  {
529  $this->tree->moveTree($source_node_id, $target_node_id);
530  }
531  else
532  {
533  $parent_id = $this->tree->getParentId($source_node_id);
534 
535  // remove from personal workspace
536  $this->getAccessHandler()->removePermission($source_node_id);
537  $this->tree->deleteReference($source_node_id);
538  $source_node = $this->tree->getNodeData($source_node_id);
539  $this->tree->deleteTree($source_node);
540 
541  // add to repository
542  $source_object->createReference();
543  $source_object->putInTree($target_node_id);
544  $source_object->setPermissions($target_node_id);
545 
546  $source_node_id = $parent_id;
547  }
548  }
549  // copy the node
550  else if($mode == "copy")
551  {
552  include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
554  $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
555 
556  if(!$_SESSION['clipboard']['wsp2repo'])
557  {
558  $wizard_options->disableTreeCopy();
559  }
560  $wizard_options->saveOwner($ilUser->getId());
561  $wizard_options->saveRoot($source_node_id);
562  $wizard_options->read();
563 
564  $new_obj = $source_object->cloneObject($target_node_id, $copy_id);
565 
566  // insert into workspace tree
567  if($new_obj && !$_SESSION['clipboard']['wsp2repo'])
568  {
569  $new_obj_node_id = $this->tree->insertObject($target_node_id, $new_obj->getId());
570  $this->getAccessHandler()->setPermissions($target_node_id, $new_obj_node_id);
571  }
572 
573  $wizard_options->deleteAll();
574  }
575 
576  // redirect to target if not repository
577  if(!$_SESSION['clipboard']['wsp2repo'])
578  {
579  $redirect_node = $target_node_id;
580  }
581  else
582  {
583  // reload current folder
584  $redirect_node = $this->node_id;
585  }
586 
587  unset($_SESSION['clipboard']['cmd']);
588  unset($_SESSION['clipboard']['source_id']);
589  unset($_SESSION['clipboard']['wsp2repo']);
590  unset($_SESSION['clipboard']['shared']);
591 
592  // #17746
593  if($mode == 'cut')
594  {
595  ilUtil::sendSuccess($this->lng->txt('msg_cut_copied'), true);
596  }
597  else
598  {
599  ilUtil::sendSuccess($this->lng->txt('msg_cloned'), true);
600  }
601 
602  $this->ctrl->setParameter($this, "wsp_id", $redirect_node);
603  $this->ctrl->redirect($this);
604  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_SESSION["AccountId"]
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getAccessHandler()
Get access handler.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static _lookupObjId($a_id)
$ilUser
Definition: imgupload.php:18
static _allocateCopyId()
Allocate a copy for further entries.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ render()

ilObjWorkspaceFolderGUI::render ( )

Render folder.

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

References $_GET, $_SESSION, $ilCtrl, $ilUser, ilObjectGUI\$tpl, array, ilObject2GUI\getAccessHandler(), ilObjectDefinition\MODE_WORKSPACE, ilObjectListGUI\prepareJsLinks(), and ilExplorer\setTargetGet().

126  {
127  global $tpl, $ilUser, $ilTabs, $ilCtrl;
128 
129  unset($_SESSION['clipboard']['wsp2repo']);
130 
131  // add new item
132  include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
133  $gui = new ilObjectAddNewItemGUI($this->node_id);
134  $gui->setMode(ilObjectDefinition::MODE_WORKSPACE);
135  $gui->setCreationUrl($ilCtrl->getLinkTarget($this, "create"));
136  $gui->render();
137 
138  include_once "Services/Object/classes/class.ilObjectListGUI.php";
140  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
141  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false));
142 
143  include_once "Modules/WorkspaceFolder/classes/class.ilObjWorkspaceFolderTableGUI.php";
144  $table = new ilObjWorkspaceFolderTableGUI($this, "render", $this->node_id, $this->getAccessHandler());
145  $tpl->setContent($table->getHTML());
146 
147  include_once "Modules/WorkspaceFolder/classes/class.ilWorkspaceFolderExplorer.php";
148  $exp = new ilWorkspaceFolderExplorer($this->ctrl->getLinkTarget($this), $ilUser->getId());
149 
150  if($this->node_id != $exp->getRoot())
151  {
152  $ilTabs->activateSubTab("content");
153  }
154 
155  $left = "";
156 
157  // sub-folders
158  if($this->node_id != $exp->getRoot() || $exp->hasFolders($this->node_id))
159  {
160  $exp->setTargetGet("wsp_id");
161  $exp->setSessionExpandVariable('wspexpand');
162  $exp->setExpand($this->node_id);
163  $exp->setExpandTarget($this->ctrl->getLinkTarget($this));
164 
165  if ($_GET["wspexpand"] != "")
166  {
167  $exp->setExpand($_GET["wspexpand"]);
168  }
169 
170  $exp->highlightNode($this->node_id);
171  $exp->setOutput(0);
172 
173  $left .= $exp->getOutput();
174  }
175 
176  $tpl->setLeftNavContent($left);
177  }
$_SESSION["AccountId"]
setTargetGet($a_target_get)
set the varname in Get-string public
$_GET["client_id"]
getAccessHandler()
Get access handler.
global $ilCtrl
Definition: ilias.php:18
static prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl=null)
Insert js/ajax links into template.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
Render add new item selector.
Class ilObjWorkspaceFolderTableGUI.
+ Here is the call graph for this function:

◆ resetShareFilter()

ilObjWorkspaceFolderGUI::resetShareFilter ( )

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

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

631  {
632  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
633  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
634  $tbl->resetOffset();
635  $tbl->resetFilter();
636 
637  $this->shareFilter();
638  }
$tbl
Definition: example_048.php:81
getAccessHandler()
Get access handler.
Workspace share handler table GUI class.
+ Here is the call graph for this function:

◆ setTabs()

ilObjWorkspaceFolderGUI::setTabs (   $a_show_settings = true)

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

References ilObjectGUI\$lng, array, ilObject2GUI\checkPermissionBool(), and ilObject2GUI\getAccessHandler().

26  {
27  global $lng, $ilHelp;
28 
29  $ilHelp->setScreenIdComponent("wfld");
30 
31  $this->ctrl->setParameter($this,"wsp_id",$this->node_id);
32 
33  $this->tabs_gui->addTab("wsp", $lng->txt("wsp_tab_personal"),
34  $this->ctrl->getLinkTarget($this, ""));
35 
36  $this->ctrl->setParameterByClass("ilObjWorkspaceRootFolderGUI", "wsp_id",
37  $this->getAccessHandler()->getTree()->getRootId());
38 
39  $this->tabs_gui->addTab("share", $lng->txt("wsp_tab_shared"),
40  $this->ctrl->getLinkTargetByClass("ilObjWorkspaceRootFolderGUI", "shareFilter"));
41 
42  $this->tabs_gui->addTab("ownership", $lng->txt("wsp_tab_ownership"),
43  $this->ctrl->getLinkTargetByClass(array("ilObjWorkspaceRootFolderGUI", "ilObjectOwnershipManagementGUI"), "listObjects"));
44 
45  if(!$this->ctrl->getNextClass($this))
46  {
47  if(stristr($this->ctrl->getCmd(), "share"))
48  {
49  $this->tabs_gui->activateTab("share");
50  }
51  else
52  {
53  $this->tabs_gui->activateTab("wsp");
54 
55  if($a_show_settings)
56  {
57  if ($this->checkPermissionBool("read"))
58  {
59  $this->tabs_gui->addSubTab("content",
60  $lng->txt("content"),
61  $this->ctrl->getLinkTarget($this, ""));
62  }
63 
64  if ($this->checkPermissionBool("write"))
65  {
66  $this->tabs_gui->addSubTab("settings",
67  $lng->txt("settings"),
68  $this->ctrl->getLinkTarget($this, "edit"));
69  }
70  }
71  }
72  }
73  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getAccessHandler()
Get access handler.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ share()

ilObjWorkspaceFolderGUI::share (   $a_load_data = true)

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

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

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

612  {
613  global $tpl;
614 
615  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
616  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id, $a_load_data);
617  $tpl->setContent($tbl->getHTML());
618  }
$tbl
Definition: example_048.php:81
getAccessHandler()
Get access handler.
Workspace share handler table GUI class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shareFilter()

ilObjWorkspaceFolderGUI::shareFilter ( )

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

References share().

Referenced by resetShareFilter().

607  {
608  $this->share(false);
609  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showMoveIntoObjectTree()

ilObjWorkspaceFolderGUI::showMoveIntoObjectTree ( )

Move node: select target (via explorer)

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

References $_GET, $_POST, $_SESSION, ilObject2GUI\$tree, array, ilPasteIntoMultipleItemsExplorer\SEL_TYPE_RADIO, ilWorkspaceExplorer\SEL_TYPE_RADIO, ilUtil\sendInfo(), and ilExplorer\setTargetGet().

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

353  {
354  global $ilTabs, $tree;
355 
356  $ilTabs->clearTargets();
357 
358  if(!$_SESSION['clipboard']['shared'])
359  {
360  $ilTabs->setBackTarget($this->lng->txt('back'),
361  $this->ctrl->getLinkTarget($this));
362  }
363  else
364  {
365  $ilTabs->setBackTarget($this->lng->txt('back'),
366  $this->ctrl->getLinkTarget($this, 'share'));
367  }
368 
369  $mode = $_SESSION['clipboard']['cmd'];
370 
371  ilUtil::sendInfo($this->lng->txt('msg_'.$mode.'_clipboard'));
372 
373  $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content',
374  'tpl.paste_into_multiple_objects.html', "Services/Object");
375 
376  // move/copy in personal workspace
377  if(!$_SESSION['clipboard']['wsp2repo'])
378  {
379  require_once 'Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php';
381  'paste_'.$mode.'_wspexpand', $this->tree, $this->getAccessHandler());
382  $exp->setTargetGet('wsp_id');
383 
384  if($_GET['paste_'.$mode.'_wspexpand'] == '')
385  {
386  // not really used as session is already set [see above]
387  $expanded = $this->tree->readRootId();
388  }
389  else
390  {
391  $expanded = $_GET['paste_'.$mode.'_wspexpand'];
392  }
393 
394  }
395  // move/copy to repository
396  else
397  {
398  require_once './Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php';
400  '', 'paste_'.$mode.'_repexpand');
401  $exp->setTargetGet('ref_id');
402 
403  if($_GET['paste_'.$mode.'_repexpand'] == '')
404  {
405  $expanded = $tree->readRootId();
406  }
407  else
408  {
409  $expanded = $_GET['paste_'.$mode.'_repexpand'];
410  }
411  }
412 
413  $exp->setCheckedItems(array((int)$_POST['node']));
414  $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'showMoveIntoObjectTree'));
415  $exp->setPostVar('node');
416  $exp->setExpand($expanded);
417  $exp->setOutput(0);
418 
419  $this->tpl->setVariable('OBJECT_TREE', $exp->getOutput());
420  unset($exp);
421 
422  $this->tpl->setVariable('FORM_TARGET', '_top');
423  $this->tpl->setVariable('FORM_ACTION',
424  $this->ctrl->getFormAction($this, 'performPasteIntoMultipleObjects'));
425 
426  $this->tpl->setVariable('CMD_SUBMIT', 'performPasteIntoMultipleObjects');
427  $this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('paste'));
428  }
$_SESSION["AccountId"]
setTargetGet($a_target_get)
set the varname in Get-string public
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilObjWorkspaceFolderGUI::update ( )

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

188  {
189  parent::update();
190 
191  $this->tabs_gui->activateTab("wsp");
192  $this->tabs_gui->activateSubTab("settings");
193  }

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