ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 ()
 
 isVisible ()
 
 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
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 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...
 
 prepareOutput ()
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings ($column_gui)
 
 checkPermission ($a_perm, $a_cmd="")
 
 showPossibleSubObjects ()
 
 redirectToRefId ()
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ()
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ()
 Deprecated functions. More...
 
 setReturnLocation ()
 
 showActions ()
 
 getTitlesByRefId ()
 
 getTabs ()
 
 __showButton ()
 
 hitsperpageObject ()
 
 __initTableGUI ()
 
 __setTableGUIBasicData ()
 
 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 ()
 
 prepareOutput ()
 prepare output More...
 
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjWorkspaceFolderGUI::_goto (   $a_target)
static

Deep link.

Parameters
string$a_target

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

References $_GET, and exit.

718  {
719  $id = explode("_", $a_target);
720 
721  $_GET["baseClass"] = "ilsharedresourceGUI";
722  $_GET["wsp_id"] = $id[0];
723  include("ilias.php");
724  exit;
725  }
exit
Definition: login.php:54
$_GET["client_id"]

◆ applyShareFilter()

ilObjWorkspaceFolderGUI::applyShareFilter ( )

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

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

613  {
614  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
615  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
616  $tbl->resetOffset();
617  $tbl->writeFilterToSession();
618 
619  $this->share();
620  }
$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 676 of file class.ilObjWorkspaceFolderGUI.php.

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

677  {
678  global $lng;
679 
680  $node_id = $_REQUEST["item_ref_id"];
681  if(!$node_id)
682  {
683  $this->ctrl->redirect($this, "share");
684  }
685 
686  $form = $this->initPasswordForm($node_id);
687  if($form->checkInput())
688  {
689  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
691  $input = md5($form->getInput("password"));
692  if($input == $password)
693  {
694  // we save password and start over
696 
697  $this->ctrl->setParameter($this, "item_ref_id", $node_id);
698  $this->ctrl->redirect($this, "copyShared");
699  }
700  else
701  {
702  $item = $form->getItemByPostVar("password");
703  $item->setAlert($lng->txt("wsp_invalid_password"));
704  ilUtil::sendFailure($lng->txt("form_input_not_valid"));
705  }
706  }
707 
708  $form->setValuesByPost();
709  $this->passwordForm($node_id, $form);
710  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static keepSharedSessionPassword($a_node_id, $a_password)
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ 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 $_REQUEST, $_SESSION, $ilUser, ilObject2GUI\$node_id, 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)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilUser
Definition: imgupload.php:15
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ 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 $_REQUEST, $_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.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ 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 $_REQUEST, $_SESSION, ilObject2GUI\$node_id, 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)
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ 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.
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 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.
+ Here is the call graph for this function:

◆ initPasswordForm()

ilObjWorkspaceFolderGUI::initPasswordForm (   $a_node_id)
protected

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

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

Referenced by checkPassword(), and passwordForm().

652  {
653  global $ilCtrl, $lng;
654 
655  $this->ctrl->setParameter($this, "item_ref_id", $a_node_id);
656 
657  $object_data = $this->getAccessHandler()->getObjectDataFromNode($a_node_id);
658 
659  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
660  $form = new ilPropertyFormGUI();
661  $form->setFormAction($ilCtrl->getFormAction($this, "checkPassword"));
662  $form->setTitle($lng->txt("wsp_password_for").": ".$object_data["title"]);
663 
664  $password = new ilPasswordInputGUI($lng->txt("password"), "password");
665  $password->setRetype(false);
666  $password->setRequired(true);
667  $password->setSkipSyntaxCheck(true);
668  $form->addItem($password);
669 
670  $form->addCommandButton("checkPassword", $lng->txt("submit"));
671  $form->addCommandButton("share", $lng->txt("cancel"));
672 
673  return $form;
674  }
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 730 of file class.ilObjWorkspaceFolderGUI.php.

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

731  {
732  global $ilCtrl;
733 
734  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
735  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
736  $tbl->resetOffset();
737  $tbl->resetFilter();
738  $_POST["user"] = $_GET["user"];
739  $tbl->writeFilterToSession();
740  $this->share();
741  }
$_POST['username']
Definition: cron.php:12
$_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.
+ Here is the call graph for this function:

◆ passwordForm()

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

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

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

Referenced by checkPassword(), and copyShared().

633  {
634  global $tpl, $lng, $ilTabs;
635 
636  $tpl->setTitle($lng->txt("wsp_password_protected_resource"));
637  $tpl->setDescription($lng->txt("wsp_password_protected_resource_info"));
638 
639  $ilTabs->clearTargets();
640  $ilTabs->setBackTarget($lng->txt("back"),
641  $this->ctrl->getLinkTarget($this, "share"));
642 
643  if(!$form)
644  {
645  $form = $this->initPasswordForm($a_node_id);
646  }
647 
648  $tpl->setContent($form->getHTML());
649  }
+ 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 $_REQUEST, $_SESSION, $ilUser, ilObject2GUI\$node_id, ilObjectGUI\$objDefinition, ilObject2GUI\$parent_id, ilCopyWizardOptions\_allocateCopyId(), ilCopyWizardOptions\_getInstance(), ilObject\_lookupObjId(), ilObject2GUI\checkPermissionBool(), ilObject2GUI\getAccessHandler(), ilObjectFactory\getInstanceByObjId(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

434  {
435  global $objDefinition, $ilAccess, $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  if(!$this->checkPermissionBool('create', '', $source_object->getType(), $target_node_id))
499  {
500  $fail[] = sprintf($this->lng->txt('msg_no_perm_paste_object_in_folder'),
501  $source_object->getTitle(), $target_object->getTitle());
502  }
503 
504  }
505  else
506  {
507  if(!$ilAccess->checkAccess('create', '', $target_node_id, $source_object->getType()))
508  {
509  $fail[] = sprintf($this->lng->txt('msg_no_perm_paste_object_in_folder'),
510  $source_object->getTitle(), $target_object->getTitle());
511  }
512  }
513 
514  if(sizeof($fail))
515  {
516  ilUtil::sendFailure(implode("<br />", $fail), true);
517  $this->ctrl->redirect($this);
518  }
519 
520 
521  // move the node
522  if($mode == "cut")
523  {
524  if(!$_SESSION['clipboard']['wsp2repo'])
525  {
526  $this->tree->moveTree($source_node_id, $target_node_id);
527  }
528  else
529  {
530  $parent_id = $this->tree->getParentId($source_node_id);
531 
532  // remove from personal workspace
533  $this->getAccessHandler()->removePermission($source_node_id);
534  $this->tree->deleteReference($source_node_id);
535  $source_node = $this->tree->getNodeData($source_node_id);
536  $this->tree->deleteTree($source_node);
537 
538  // add to repository
539  $source_object->createReference();
540  $source_object->putInTree($target_node_id);
541  $source_object->setPermissions($target_node_id);
542 
543  $source_node_id = $parent_id;
544  }
545  }
546  // copy the node
547  else if($mode == "copy")
548  {
549  include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
551  $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
552  $wizard_options->saveOwner($ilUser->getId());
553  $wizard_options->saveRoot($source_node_id);
554  $wizard_options->read();
555 
556  $new_obj = $source_object->cloneObject($target_node_id, $copy_id, !$_SESSION['clipboard']['wsp2repo']);
557 
558  // insert into workspace tree
559  if($new_obj && !$_SESSION['clipboard']['wsp2repo'])
560  {
561  $new_obj_node_id = $this->tree->insertObject($target_node_id, $new_obj->getId());
562  $this->getAccessHandler()->setPermissions($target_node_id, $new_obj_node_id);
563  }
564 
565  $wizard_options->deleteAll();
566  }
567 
568  // redirect to target if not repository
569  if(!$_SESSION['clipboard']['wsp2repo'])
570  {
571  $redirect_node = $target_node_id;
572  }
573  else
574  {
575  // reload current folder
576  $redirect_node = $this->node_id;
577  }
578 
579  unset($_SESSION['clipboard']['cmd']);
580  unset($_SESSION['clipboard']['source_id']);
581  unset($_SESSION['clipboard']['wsp2repo']);
582  unset($_SESSION['clipboard']['shared']);
583 
584  // #17746
585  if($mode == 'cut')
586  {
587  ilUtil::sendSuccess($this->lng->txt('msg_cut_copied'), true);
588  }
589  else
590  {
591  ilUtil::sendSuccess($this->lng->txt('msg_cloned'), true);
592  }
593 
594  $this->ctrl->setParameter($this, "wsp_id", $redirect_node);
595  $this->ctrl->redirect($this);
596  }
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)
static _allocateCopyId()
Allocate a copy for further entries.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilUser
Definition: imgupload.php:15
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ 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, 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.
global $ilUser
Definition: imgupload.php:15
Render add new item selector.
Class ilObjWorkspaceFolderTableGUI.
+ Here is the call graph for this function:

◆ resetShareFilter()

ilObjWorkspaceFolderGUI::resetShareFilter ( )

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

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

623  {
624  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
625  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
626  $tbl->resetOffset();
627  $tbl->resetFilter();
628 
629  $this->shareFilter();
630  }
$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, 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.
+ Here is the call graph for this function:

◆ share()

ilObjWorkspaceFolderGUI::share (   $a_load_data = true)

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

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

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

604  {
605  global $tpl;
606 
607  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
608  $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id, $a_load_data);
609  $tpl->setContent($tbl->getHTML());
610  }
$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 598 of file class.ilObjWorkspaceFolderGUI.php.

References share().

Referenced by resetShareFilter().

599  {
600  $this->share(false);
601  }
+ 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, ilWorkspaceExplorer\SEL_TYPE_RADIO, ilPasteIntoMultipleItemsExplorer\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  }
$_POST['username']
Definition: cron.php:12
$_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.
+ 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: