ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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)
 Constructor. More...
 
 getType ()
 Functions that must be overwritten. More...
 
 setTabs ($a_show_settings=true)
 
 executeCommand ()
 execute command More...
 
 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)
 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...
 
 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...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. 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 @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object 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...
 
 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)
 Init creation froms. More...
 
 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 ()
 called by prepare output More...
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 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...
 
 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...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) 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...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 showActions ()
 
 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...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. 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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access 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...
 
 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...
 

Protected Attributes

 $help
 
 $tabs
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Reimplemented from ilObject2GUI.

Reimplemented in ilObjWorkspaceRootFolderGUI.

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

35 {
36 global $DIC;
37 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
38
39 $this->lng = $DIC->language();
40 $this->help = $DIC["ilHelp"];
41 $this->tpl = $DIC["tpl"];
42 $this->user = $DIC->user();
43 $this->tabs = $DIC->tabs();
44 $this->ctrl = $DIC->ctrl();
45 }
user()
Definition: user.php:4
global $DIC
Definition: saml.php:7

References $DIC, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjWorkspaceFolderGUI::_goto (   $a_target)
static

Deep link.

Parameters
string$a_target

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

716 {
717 $id = explode("_", $a_target);
718
719 $_GET["baseClass"] = "ilsharedresourceGUI";
720 $_GET["wsp_id"] = $id[0];
721 include("ilias.php");
722 exit;
723 }
$_GET["client_id"]
if(!array_key_exists('StateId', $_REQUEST)) $id

References $_GET, $id, and exit.

◆ applyShareFilter()

ilObjWorkspaceFolderGUI::applyShareFilter ( )

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

612 {
613 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
614 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
615 $tbl->resetOffset();
616 $tbl->writeFilterToSession();
617
618 $this->share();
619 }
getAccessHandler()
Get access handler.
Workspace share handler table GUI class.
$tbl
Definition: example_048.php:81

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

+ Here is the call graph for this function:

◆ checkPassword()

ilObjWorkspaceFolderGUI::checkPassword ( )
protected

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

680 {
682
683 $node_id = $_REQUEST["item_ref_id"];
684 if (!$node_id) {
685 $this->ctrl->redirect($this, "share");
686 }
687
689 if ($form->checkInput()) {
690 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
692 $input = md5($form->getInput("password"));
693 if ($input == $password) {
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 } else {
700 $item = $form->getItemByPostVar("password");
701 $item->setAlert($lng->txt("wsp_invalid_password"));
702 ilUtil::sendFailure($lng->txt("form_input_not_valid"));
703 }
704 }
705
706 $form->setValuesByPost();
707 $this->passwordForm($node_id, $form);
708 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static keepSharedSessionPassword($a_node_id, $a_password)
$password
Definition: pwgen.php:17
if(isset($_POST['submit'])) $form

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

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

280 {
282
283 if (!$_REQUEST["item_ref_id"]) {
284 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
285 $this->ctrl->redirect($this);
286 }
287
288 $current_node = $_REQUEST["item_ref_id"];
289 $owner = $this->tree->lookupOwner($current_node);
290 if ($owner == $ilUser->getId()) {
291 $parent_node = $this->tree->getParentId($current_node);
292
293 // on cancel or fail we return to parent node
294 $this->ctrl->setParameter($this, "wsp_id", $parent_node);
295
296 // open current position
297 // using the explorer session storage directly is basically a hack
298 // as we do not use setExpanded() [see below]
299 $_SESSION['paste_copy_wspexpand'] = array();
300 foreach ((array) $this->tree->getPathId($parent_node) as $node_id) {
301 $_SESSION['paste_copy_wspexpand'][] = $node_id;
302 }
303 } else {
304 // see copyShared()
305 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
306 $this->ctrl->redirect($this);
307 }
308
309 // remember source node
310 $_SESSION['clipboard']['source_id'] = $current_node;
311 $_SESSION['clipboard']['cmd'] = 'copy';
312
313 return $this->showMoveIntoObjectTree();
314 }
$_SESSION["AccountId"]
showMoveIntoObjectTree()
Move node: select target (via explorer)
$ilUser
Definition: imgupload.php:18

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

Referenced by copy_to_repository().

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

350 {
351 $_SESSION['clipboard']['wsp2repo'] = true;
352 $this->copy();
353 }

References $_SESSION, and copy().

+ Here is the call graph for this function:

◆ copyShared()

ilObjWorkspaceFolderGUI::copyShared ( )

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

317 {
318 if (!$_REQUEST["item_ref_id"]) {
319 $this->ctrl->redirect($this, "share");
320 }
321
322 $current_node = $_REQUEST["item_ref_id"];
323 $handler = $this->getAccessHandler();
324
325 // see ilSharedRessourceGUI::hasAccess()
326 if ($handler->checkAccess("read", "", $current_node)) {
327 // remember source node
328 $_SESSION['clipboard']['source_id'] = $current_node;
329 $_SESSION['clipboard']['cmd'] = 'copy';
330 $_SESSION['clipboard']['shared'] = true;
331
332 return $this->showMoveIntoObjectTree();
333 } else {
334 $perms = $handler->getPermissions($current_node);
335 if (in_array(ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD, $perms)) {
336 return $this->passwordForm($current_node);
337 }
338 }
339
340 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
341 $this->ctrl->redirect($this, "share");
342 }
$handler

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

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

222 {
223 if (!$_REQUEST["item_ref_id"]) {
224 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
225 $this->ctrl->redirect($this);
226 }
227
228 $current_node = $_REQUEST["item_ref_id"];
229 $parent_node = $this->tree->getParentId($current_node);
230
231 // on cancel or fail we return to parent node
232 $this->ctrl->setParameter($this, "wsp_id", $parent_node);
233
234 // check permission
235 $no_cut = array();
236 foreach ($this->tree->getSubTree($this->tree->getNodeData($current_node)) as $node) {
237 if (!$this->checkPermissionBool("delete", "", "", $node["wsp_id"])) {
238 $obj = ilObjectFactory::getInstanceByObjId($node["obj_id"]);
239 $no_cut[$node["wsp_id"]] = $obj->getTitle();
240 unset($obj);
241 }
242 }
243 if (count($no_cut)) {
244 ilUtil::sendFailure($this->lng->txt("msg_no_perm_cut") . " " . implode(',', $no_cut), true);
245 $this->ctrl->redirect($this);
246 }
247
248 // open current position
249 // using the explorer session storage directly is basically a hack
250 // as we do not use setExpanded() [see below]
251 $_SESSION['paste_cut_wspexpand'] = array();
252 foreach ((array) $this->tree->getPathId($parent_node) as $node_id) {
253 $_SESSION['paste_cut_wspexpand'][] = $node_id;
254 }
255
256 // remember source node
257 $_SESSION['clipboard']['source_id'] = $current_node;
258 $_SESSION['clipboard']['cmd'] = 'cut';
259
260 return $this->showMoveIntoObjectTree();
261 }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id

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

Referenced by cut_for_repository().

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

269 {
270 $_SESSION['clipboard']['wsp2repo'] = true;
271 $this->cut();
272 }

References $_SESSION, and cut().

+ Here is the call graph for this function:

◆ edit()

ilObjWorkspaceFolderGUI::edit ( )

Reimplemented from ilObject2GUI.

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

201 {
202 parent::edit();
203
204 $this->tabs_gui->activateTab("wsp");
205 $this->tabs_gui->activateSubTab("settings");
206 }

◆ executeCommand()

ilObjWorkspaceFolderGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

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

113 {
114 $next_class = $this->ctrl->getNextClass($this);
115 $cmd = $this->ctrl->getCmd();
116
117 switch ($next_class) {
118 case "ilcommonactiondispatchergui":
119 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
121 $this->ctrl->forwardCommand($gui);
122 break;
123
124 case "ilobjectownershipmanagementgui":
125 $this->prepareOutput();
126 $this->tabs_gui->activateTab("ownership");
127 include_once("Services/Object/classes/class.ilObjectOwnershipManagementGUI.php");
129 $this->ctrl->forwardCommand($gui);
130 break;
131
132 default:
133 $this->prepareOutput();
134 if ($this->type != "wsrt") {
135 $this->addHeaderAction();
136 }
137 if (!$cmd) {
138 $cmd = "render";
139 }
140 $this->$cmd();
141 break;
142 }
143
144 return true;
145 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
prepareOutput($a_show_subobjects=true)
prepare output
addHeaderAction()
Add header action menu.
Class ilObjectOwnershipManagementGUI.

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

+ Here is the call graph for this function:

◆ getType()

ilObjWorkspaceFolderGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

Reimplemented in ilObjWorkspaceRootFolderGUI.

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

48 {
49 return "wfld";
50 }

◆ initCreationForms()

ilObjWorkspaceFolderGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObject2GUI.

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

148 {
149 $forms = array(
150 self::CFORM_NEW => $this->initCreateForm($a_new_type)
151 );
152
153 return $forms;
154 }
initCreateForm($a_new_type)
Init object creation form.

References ilObjectGUI\initCreateForm().

+ Here is the call graph for this function:

◆ initPasswordForm()

ilObjWorkspaceFolderGUI::initPasswordForm (   $a_node_id)
protected

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

654 {
657
658 $this->ctrl->setParameter($this, "item_ref_id", $a_node_id);
659
660 $object_data = $this->getAccessHandler()->getObjectDataFromNode($a_node_id);
661
662 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
663 $form = new ilPropertyFormGUI();
664 $form->setFormAction($ilCtrl->getFormAction($this, "checkPassword"));
665 $form->setTitle($lng->txt("wsp_password_for") . ": " . $object_data["title"]);
666
667 $password = new ilPasswordInputGUI($lng->txt("password"), "password");
668 $password->setRetype(false);
669 $password->setRequired(true);
670 $password->setSkipSyntaxCheck(true);
671 $form->addItem($password);
672
673 $form->addCommandButton("checkPassword", $lng->txt("submit"));
674 $form->addCommandButton("share", $lng->txt("cancel"));
675
676 return $form;
677 }
This class represents a password property in a property form.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18

References ilObjectGUI\$ctrl, $form, $ilCtrl, ilObjectGUI\$lng, $password, and ilObject2GUI\getAccessHandler().

Referenced by checkPassword(), and passwordForm().

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

729 {
731
732 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
733 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
734 $tbl->resetOffset();
735 $tbl->resetFilter();
736 $_POST["user"] = $_GET["user"];
737 $tbl->writeFilterToSession();
738 $this->share();
739 }
$_POST["username"]

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

+ Here is the call graph for this function:

◆ passwordForm()

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

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

632 {
635 $ilTabs = $this->tabs;
636
637 $tpl->setTitle($lng->txt("wsp_password_protected_resource"));
638 $tpl->setDescription($lng->txt("wsp_password_protected_resource_info"));
639
640 $ilTabs->clearTargets();
641 $ilTabs->setBackTarget(
642 $lng->txt("back"),
643 $this->ctrl->getLinkTarget($this, "share")
644 );
645
646 if (!$form) {
647 $form = $this->initPasswordForm($a_node_id);
648 }
649
650 $tpl->setContent($form->getHTML());
651 }

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

Referenced by checkPassword(), and copyShared().

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

440 {
442
443 $mode = $_SESSION['clipboard']['cmd'];
444 $source_node_id = $_SESSION['clipboard']['source_id'];
445 $target_node_id = $_REQUEST['node'];
446
447 if (!$source_node_id) {
448 ilUtil::sendFailure($this->lng->txt('select_at_least_one_object'), true);
449 $this->ctrl->redirect($this);
450 }
451 if (!$target_node_id) {
452 ilUtil::sendFailure($this->lng->txt('select_at_least_one_object'), true);
453 $this->ctrl->redirect($this, "showMoveIntoObjectTree");
454 }
455
456 // object instances
457 $source_obj_id = $this->tree->lookupObjectId($source_node_id);
458 $source_object = ilObjectFactory::getInstanceByObjId($source_obj_id);
459
460 if (!$_SESSION['clipboard']['wsp2repo']) {
461 $target_obj_id = $this->tree->lookupObjectId($target_node_id);
462 } else {
463 $target_obj_id = ilObject::_lookupObjId($target_node_id);
464 }
465 $target_object = ilObjectFactory::getInstanceByObjId($target_obj_id);
466
467
468 // sanity checks
469
470 $fail = array();
471
472 if ($source_node_id == $target_node_id) {
473 $fail[] = sprintf(
474 $this->lng->txt('msg_obj_exists_in_folder'),
475 $source_object->getTitle(),
476 $target_object->getTitle()
477 );
478 }
479
480 if (!in_array($source_object->getType(), array_keys($target_object->getPossibleSubObjects()))) {
481 $fail[] = sprintf(
482 $this->lng->txt('msg_obj_may_not_contain_objects_of_type'),
483 $target_object->getTitle(),
484 $source_object->getType()
485 );
486 }
487
488 // if object is shared permission to copy has been checked above
489 $owner = $this->tree->lookupOwner($source_node_id);
490 if ($mode == "copy" && $ilUser->getId() == $owner && !$this->checkPermissionBool('copy', '', '', $source_node_id)) {
491 $fail[] = $this->lng->txt('permission_denied');
492 }
493
494 if (!$_SESSION['clipboard']['wsp2repo']) {
495 if ($mode == "cut" && $this->tree->isGrandChild($source_node_id, $target_node_id)) {
496 $fail[] = sprintf(
497 $this->lng->txt('msg_paste_object_not_in_itself'),
498 $source_object->getTitle()
499 );
500 }
501 }
502
503 if ($_SESSION['clipboard']['wsp2repo'] == true) { // see #22959
504 global $ilAccess;
505 if (!$ilAccess->checkAccess("create", "", $target_node_id, $source_object->getType())) {
506 $fail[] = sprintf(
507 $this->lng->txt('msg_no_perm_paste_object_in_folder'),
508 $source_object->getTitle(),
509 $target_object->getTitle()
510 );
511 }
512 } else {
513 if (!$this->checkPermissionBool('create', '', $source_object->getType(), $target_node_id)) {
514 $fail[] = sprintf(
515 $this->lng->txt('msg_no_perm_paste_object_in_folder'),
516 $source_object->getTitle(),
517 $target_object->getTitle()
518 );
519 }
520 }
521
522 if (sizeof($fail)) {
523 ilUtil::sendFailure(implode("<br />", $fail), true);
524 $this->ctrl->redirect($this);
525 }
526
527
528 // move the node
529 if ($mode == "cut") {
530 if (!$_SESSION['clipboard']['wsp2repo']) {
531 $this->tree->moveTree($source_node_id, $target_node_id);
532 } else {
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 elseif ($mode == "copy") {
551 include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
553 $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
554
555 if (!$_SESSION['clipboard']['wsp2repo']) {
556 $wizard_options->disableTreeCopy();
557 }
558 $wizard_options->saveOwner($ilUser->getId());
559 $wizard_options->saveRoot($source_node_id);
560 $wizard_options->read();
561
562 $new_obj = $source_object->cloneObject($target_node_id, $copy_id);
563
564 // insert into workspace tree
565 if ($new_obj && !$_SESSION['clipboard']['wsp2repo']) {
566 $new_obj_node_id = $this->tree->insertObject($target_node_id, $new_obj->getId());
567 $this->getAccessHandler()->setPermissions($target_node_id, $new_obj_node_id);
568 }
569
570 $wizard_options->deleteAll();
571 }
572
573 // redirect to target if not repository
574 if (!$_SESSION['clipboard']['wsp2repo']) {
575 $redirect_node = $target_node_id;
576 } else {
577 // reload current folder
578 $redirect_node = $this->node_id;
579 }
580
581 unset($_SESSION['clipboard']['cmd']);
582 unset($_SESSION['clipboard']['source_id']);
583 unset($_SESSION['clipboard']['wsp2repo']);
584 unset($_SESSION['clipboard']['shared']);
585
586 // #17746
587 if ($mode == 'cut') {
588 ilUtil::sendSuccess($this->lng->txt('msg_cut_copied'), true);
589 } else {
590 ilUtil::sendSuccess($this->lng->txt('msg_cloned'), true);
591 }
592
593 $this->ctrl->setParameter($this, "wsp_id", $redirect_node);
594 $this->ctrl->redirect($this);
595 }
sprintf('%.4f', $callTime)
static _allocateCopyId()
Allocate a copy for further entries.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static _lookupObjId($a_id)
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

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

+ Here is the call graph for this function:

◆ render()

ilObjWorkspaceFolderGUI::render ( )

Render folder.

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

160 {
163 $ilTabs = $this->tabs;
165
166 unset($_SESSION['clipboard']['wsp2repo']);
167
168 // add new item
169 include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
170 $gui = new ilObjectAddNewItemGUI($this->node_id);
172 $gui->setCreationUrl($ilCtrl->getLinkTarget($this, "create"));
173 $gui->render();
174
175 include_once "Services/Object/classes/class.ilObjectListGUI.php";
177 "",
178 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
179 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
180 );
181
182 include_once "Modules/WorkspaceFolder/classes/class.ilObjWorkspaceFolderTableGUI.php";
183 $table = new ilObjWorkspaceFolderTableGUI($this, "render", $this->node_id, $this->getAccessHandler());
184 $tpl->setContent($table->getHTML());
185
186 include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorerGUI.php");
187 $exp = new ilWorkspaceExplorerGUI($ilUser->getId(), $this, "render", $this, "", "wsp_id");
188 $exp->setTypeWhiteList(array("wsrt", "wfld"));
189 $exp->setSelectableTypes(array("wsrt", "wfld"));
190 $exp->setLinkToNodeClass(true);
191 $exp->setActivateHighlighting(true);
192 if ($exp->handleCommand()) {
193 return;
194 }
195 $left = $exp->getHTML();
196
197 $tpl->setLeftNavContent($left);
198 }
Class ilObjWorkspaceFolderTableGUI.
Render add new item selector.
static prepareJsLinks($a_redraw_url, $a_notes_url, $a_tags_url, $a_tpl=null)
Insert js/ajax links into template.
Explorer for selecting a personal workspace item.
if(empty($password)) $table
Definition: pwgen.php:24

References $_SESSION, ilObjectGUI\$ctrl, $ilCtrl, $ilUser, $table, $tabs, ilObjectGUI\$tpl, ilObjectGUI\$user, ilObject2GUI\getAccessHandler(), ilObjectDefinition\MODE_WORKSPACE, and ilObjectListGUI\prepareJsLinks().

+ Here is the call graph for this function:

◆ resetShareFilter()

ilObjWorkspaceFolderGUI::resetShareFilter ( )

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

622 {
623 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
624 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
625 $tbl->resetOffset();
626 $tbl->resetFilter();
627
628 $this->shareFilter();
629 }

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

+ Here is the call graph for this function:

◆ setTabs()

ilObjWorkspaceFolderGUI::setTabs (   $a_show_settings = true)

Reimplemented in ilObjWorkspaceRootFolderGUI.

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

53 {
55 $ilHelp = $this->help;
56
57 $ilHelp->setScreenIdComponent("wfld");
58
59 $this->ctrl->setParameter($this, "wsp_id", $this->node_id);
60
61 $this->tabs_gui->addTab(
62 "wsp",
63 $lng->txt("wsp_tab_personal"),
64 $this->ctrl->getLinkTarget($this, "")
65 );
66
67 $this->ctrl->setParameterByClass(
68 "ilObjWorkspaceRootFolderGUI",
69 "wsp_id",
70 $this->getAccessHandler()->getTree()->getRootId()
71 );
72
73 $this->tabs_gui->addTab(
74 "share",
75 $lng->txt("wsp_tab_shared"),
76 $this->ctrl->getLinkTargetByClass("ilObjWorkspaceRootFolderGUI", "shareFilter")
77 );
78
79 $this->tabs_gui->addTab(
80 "ownership",
81 $lng->txt("wsp_tab_ownership"),
82 $this->ctrl->getLinkTargetByClass(array("ilObjWorkspaceRootFolderGUI", "ilObjectOwnershipManagementGUI"), "listObjects")
83 );
84
85 if (!$this->ctrl->getNextClass($this)) {
86 if (stristr($this->ctrl->getCmd(), "share")) {
87 $this->tabs_gui->activateTab("share");
88 } else {
89 $this->tabs_gui->activateTab("wsp");
90
91 if ($a_show_settings) {
92 if ($this->checkPermissionBool("read")) {
93 $this->tabs_gui->addSubTab(
94 "content",
95 $lng->txt("content"),
96 $this->ctrl->getLinkTarget($this, "")
97 );
98 }
99
100 if ($this->checkPermissionBool("write")) {
101 $this->tabs_gui->addSubTab(
102 "settings",
103 $lng->txt("settings"),
104 $this->ctrl->getLinkTarget($this, "edit")
105 );
106 }
107 }
108 }
109 }
110 }

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

+ Here is the call graph for this function:

◆ share()

ilObjWorkspaceFolderGUI::share (   $a_load_data = true)

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

603 {
605
606 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
607 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id, $a_load_data);
608 $tpl->setContent($tbl->getHTML());
609 }

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

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

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

◆ shareFilter()

ilObjWorkspaceFolderGUI::shareFilter ( )

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

598 {
599 $this->share(false);
600 }

References share().

Referenced by resetShareFilter().

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

359 {
360 $ilTabs = $this->tabs;
362
363 $ilTabs->clearTargets();
364
365 if (!$_SESSION['clipboard']['shared']) {
366 $ilTabs->setBackTarget(
367 $this->lng->txt('back'),
368 $this->ctrl->getLinkTarget($this)
369 );
370 } else {
371 $ilTabs->setBackTarget(
372 $this->lng->txt('back'),
373 $this->ctrl->getLinkTarget($this, 'share')
374 );
375 }
376
377 $mode = $_SESSION['clipboard']['cmd'];
378
379 ilUtil::sendInfo($this->lng->txt('msg_' . $mode . '_clipboard'));
380
381 $this->tpl->addBlockfile(
382 'ADM_CONTENT',
383 'adm_content',
384 'tpl.paste_into_multiple_objects.html',
385 "Services/Object"
386 );
387
388 // move/copy in personal workspace
389 if (!$_SESSION['clipboard']['wsp2repo']) {
390 include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorerGUI.php");
391 $exp = new ilWorkspaceExplorerGUI($this->user->getId(), $this, "showMoveIntoObjectTree", $this, "");
392 $exp->setTypeWhiteList(array("wsrt", "wfld"));
393 $exp->setSelectableTypes(array("wsrt", "wfld"));
394 $exp->setSelectMode("node", false);
395 if ($exp->handleCommand()) {
396 return;
397 }
398 $this->tpl->setVariable('OBJECT_TREE', $exp->getHTML());
399 }
400 // move/copy to repository
401 else {
402 require_once './Services/Object/classes/class.ilPasteIntoMultipleItemsExplorer.php';
405 '',
406 'paste_' . $mode . '_repexpand'
407 );
408 $exp->setTargetGet('ref_id');
409
410 if ($_GET['paste_' . $mode . '_repexpand'] == '') {
411 $expanded = $tree->readRootId();
412 } else {
413 $expanded = $_GET['paste_' . $mode . '_repexpand'];
414 }
415 $exp->setCheckedItems(array((int) $_POST['node']));
416 $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'showMoveIntoObjectTree'));
417 $exp->setPostVar('node');
418 $exp->setExpand($expanded);
419 $exp->setOutput(0);
420 $this->tpl->setVariable('OBJECT_TREE', $exp->getOutput());
421 }
422
423
424 unset($exp);
425
426 $this->tpl->setVariable('FORM_TARGET', '_top');
427 $this->tpl->setVariable(
428 'FORM_ACTION',
429 $this->ctrl->getFormAction($this, 'performPasteIntoMultipleObjects')
430 );
431
432 $this->tpl->setVariable('CMD_SUBMIT', 'performPasteIntoMultipleObjects');
433 $this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('paste'));
434 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_GET, $_POST, $_SESSION, $tabs, ilObject2GUI\$tree, ilPasteIntoMultipleItemsExplorer\SEL_TYPE_RADIO, ilUtil\sendInfo(), and user().

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

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

◆ update()

ilObjWorkspaceFolderGUI::update ( )

Reimplemented from ilObject2GUI.

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

209 {
211
212 $this->tabs_gui->activateTab("wsp");
213 $this->tabs_gui->activateSubTab("settings");
214 }
update($pash, $contents, Config $config)

References League\Flysystem\Adapter\Polyfill\update().

+ Here is the call graph for this function:

Field Documentation

◆ $help

ilObjWorkspaceFolderGUI::$help
protected

◆ $tabs

ilObjWorkspaceFolderGUI::$tabs
protected

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

Referenced by passwordForm(), render(), and showMoveIntoObjectTree().


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