ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilObjWorkspaceFolderGUI Class Reference

Class ilObjWorkspaceFolderGUI. More...

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

Public Member Functions

 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 ()
 
- 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...
 
 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 @access 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 @access 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...
 
 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...
 
 prepareOutput ()
 prepare output 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 ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="")
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 redirectToRefId ()
 
 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 ()
 
 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)
 Activate rating automatically if parent container setting. More...
 
- 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 @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...
 
 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)
 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
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjWorkspaceFolderGUI::_goto (   $a_target)
static

Deep link.

Parameters
string$a_target

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

708 {
709 $id = explode("_", $a_target);
710
711 $_GET["baseClass"] = "ilsharedresourceGUI";
712 $_GET["wsp_id"] = $id[0];
713 include("ilias.php");
714 exit;
715 }
$_GET["client_id"]
exit
Definition: login.php:54

References $_GET, and exit.

◆ applyShareFilter()

ilObjWorkspaceFolderGUI::applyShareFilter ( )

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

603 {
604 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
605 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id);
606 $tbl->resetOffset();
607 $tbl->writeFilterToSession();
608
609 $this->share();
610 }
getAccessHandler()
Get access handler.
Workspace share handler table GUI class.

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

+ Here is the call graph for this function:

◆ checkPassword()

ilObjWorkspaceFolderGUI::checkPassword ( )
protected

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

667 {
668 global $lng;
669
670 $node_id = $_REQUEST["item_ref_id"];
671 if(!$node_id)
672 {
673 $this->ctrl->redirect($this, "share");
674 }
675
676 $form = $this->initPasswordForm($node_id);
677 if($form->checkInput())
678 {
679 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
681 $input = md5($form->getInput("password"));
682 if($input == $password)
683 {
684 // we save password and start over
686
687 $this->ctrl->setParameter($this, "item_ref_id", $node_id);
688 $this->ctrl->redirect($this, "copyShared");
689 }
690 else
691 {
692 $item = $form->getItemByPostVar("password");
693 $item->setAlert($lng->txt("wsp_invalid_password"));
694 ilUtil::sendFailure($lng->txt("form_input_not_valid"));
695 }
696 }
697
698 $form->setValuesByPost();
699 $this->passwordForm($node_id, $form);
700 }
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

References $_REQUEST, ilObjectGUI\$lng, ilObject2GUI\$node_id, 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 262 of file class.ilObjWorkspaceFolderGUI.php.

263 {
264 global $ilUser;
265
266 if (!$_REQUEST["item_ref_id"])
267 {
268 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
269 $this->ctrl->redirect($this);
270 }
271
272 $current_node = $_REQUEST["item_ref_id"];
273 $owner = $this->tree->lookupOwner($current_node);
274 if($owner == $ilUser->getId())
275 {
276 $parent_node = $this->tree->getParentId($current_node);
277
278 // on cancel or fail we return to parent node
279 $this->ctrl->setParameter($this, "wsp_id", $parent_node);
280
281 // open current position
282 // using the explorer session storage directly is basically a hack
283 // as we do not use setExpanded() [see below]
284 $_SESSION['paste_copy_wspexpand'] = array();
285 foreach((array)$this->tree->getPathId($parent_node) as $node_id)
286 {
287 $_SESSION['paste_copy_wspexpand'][] = $node_id;
288 }
289 }
290 else
291 {
292 // see copyShared()
293 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
294 $this->ctrl->redirect($this);
295 }
296
297 // remember source node
298 $_SESSION['clipboard']['source_id'] = $current_node;
299 $_SESSION['clipboard']['cmd'] = 'copy';
300
301 return $this->showMoveIntoObjectTree();
302 }
showMoveIntoObjectTree()
Move node: select target (via explorer)
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
global $ilUser
Definition: imgupload.php:15

References $_REQUEST, $_SESSION, $ilUser, ilObject2GUI\$node_id, 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 342 of file class.ilObjWorkspaceFolderGUI.php.

343 {
344 $_SESSION['clipboard']['wsp2repo'] = true;
345 $this->copy();
346 }

References $_SESSION, and copy().

+ Here is the call graph for this function:

◆ copyShared()

ilObjWorkspaceFolderGUI::copyShared ( )

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

305 {
306 if (!$_REQUEST["item_ref_id"])
307 {
308 $this->ctrl->redirect($this, "share");
309 }
310
311 $current_node = $_REQUEST["item_ref_id"];
312 $handler = $this->getAccessHandler();
313
314 // see ilSharedRessourceGUI::hasAccess()
315 if($handler->checkAccess("read", "", $current_node))
316 {
317 // remember source node
318 $_SESSION['clipboard']['source_id'] = $current_node;
319 $_SESSION['clipboard']['cmd'] = 'copy';
320 $_SESSION['clipboard']['shared'] = true;
321
322 return $this->showMoveIntoObjectTree();
323 }
324 else
325 {
326 $perms = $handler->getPermissions($current_node);
328 {
329 return $this->passwordForm($current_node);
330 }
331 }
332
333 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
334 $this->ctrl->redirect($this, "share");
335 }

References $_REQUEST, $_SESSION, 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 199 of file class.ilObjWorkspaceFolderGUI.php.

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

References $_REQUEST, $_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 251 of file class.ilObjWorkspaceFolderGUI.php.

252 {
253 $_SESSION['clipboard']['wsp2repo'] = true;
254 $this->cut();
255 }

References $_SESSION, and cut().

+ Here is the call graph for this function:

◆ edit()

ilObjWorkspaceFolderGUI::edit ( )

Reimplemented from ilObject2GUI.

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

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

◆ executeCommand()

& ilObjWorkspaceFolderGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

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

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

References $cmd, 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 19 of file class.ilObjWorkspaceFolderGUI.php.

20 {
21 return "wfld";
22 }

◆ 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 112 of file class.ilObjWorkspaceFolderGUI.php.

113 {
114 $forms = array(
115 self::CFORM_NEW => $this->initCreateForm($a_new_type)
116 );
117
118 return $forms;
119 }
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 641 of file class.ilObjWorkspaceFolderGUI.php.

642 {
643 global $ilCtrl, $lng;
644
645 $this->ctrl->setParameter($this, "item_ref_id", $a_node_id);
646
647 $object_data = $this->getAccessHandler()->getObjectDataFromNode($a_node_id);
648
649 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
650 $form = new ilPropertyFormGUI();
651 $form->setFormAction($ilCtrl->getFormAction($this, "checkPassword"));
652 $form->setTitle($lng->txt("wsp_password_for").": ".$object_data["title"]);
653
654 $password = new ilPasswordInputGUI($lng->txt("password"), "password");
655 $password->setRetype(false);
656 $password->setRequired(true);
657 $password->setSkipSyntaxCheck(true);
658 $form->addItem($password);
659
660 $form->addCommandButton("checkPassword", $lng->txt("submit"));
661 $form->addCommandButton("share", $lng->txt("cancel"));
662
663 return $form;
664 }
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 $ilCtrl, ilObjectGUI\$lng, and ilObject2GUI\getAccessHandler().

Referenced by checkPassword(), and passwordForm().

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

◆ passwordForm()

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

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

623 {
624 global $tpl, $lng, $ilTabs;
625
626 $tpl->setTitle($lng->txt("wsp_password_protected_resource"));
627 $tpl->setDescription($lng->txt("wsp_password_protected_resource_info"));
628
629 $ilTabs->clearTargets();
630 $ilTabs->setBackTarget($lng->txt("back"),
631 $this->ctrl->getLinkTarget($this, "share"));
632
633 if(!$form)
634 {
635 $form = $this->initPasswordForm($a_node_id);
636 }
637
638 $tpl->setContent($form->getHTML());
639 }

References ilObjectGUI\$lng, 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 432 of file class.ilObjWorkspaceFolderGUI.php.

433 {
434 global $objDefinition, $ilAccess, $ilUser;
435
436 $mode = $_SESSION['clipboard']['cmd'];
437 $source_node_id = $_SESSION['clipboard']['source_id'];
438 $target_node_id = $_REQUEST['node'];
439
440 if(!$source_node_id)
441 {
442 ilUtil::sendFailure($this->lng->txt('select_at_least_one_object'), true);
443 $this->ctrl->redirect($this);
444 }
445 if(!$target_node_id)
446 {
447 ilUtil::sendFailure($this->lng->txt('select_at_least_one_object'), true);
448 $this->ctrl->redirect($this, "showMoveIntoObjectTree");
449 }
450
451 // object instances
452 $source_obj_id = $this->tree->lookupObjectId($source_node_id);
453 $source_object = ilObjectFactory::getInstanceByObjId($source_obj_id);
454
455 if(!$_SESSION['clipboard']['wsp2repo'])
456 {
457 $target_obj_id = $this->tree->lookupObjectId($target_node_id);
458 }
459 else
460 {
461 $target_obj_id = ilObject::_lookupObjId($target_node_id);
462 }
463 $target_object = ilObjectFactory::getInstanceByObjId($target_obj_id);
464
465
466 // sanity checks
467
468 $fail = array();
469
470 if($source_node_id == $target_node_id)
471 {
472 $fail[] = sprintf($this->lng->txt('msg_obj_exists_in_folder'),
473 $source_object->getTitle(), $target_object->getTitle());
474 }
475
476 if(!in_array($source_object->getType(), array_keys($objDefinition->getSubObjects($target_object->getType()))))
477 {
478 $fail[] = sprintf($this->lng->txt('msg_obj_may_not_contain_objects_of_type'),
479 $target_object->getTitle(), $source_object->getType());
480 }
481
482 // if object is shared permission to copy has been checked above
483 $owner = $this->tree->lookupOwner($source_node_id);
484 if($mode == "copy" && $ilUser->getId() == $owner && !$this->checkPermissionBool('copy', '', '', $source_node_id))
485 {
486 $fail[] = $this->lng->txt('permission_denied');
487 }
488
489 if(!$_SESSION['clipboard']['wsp2repo'])
490 {
491 if($mode == "cut" && $this->tree->isGrandChild($source_node_id, $target_node_id))
492 {
493 $fail[] = sprintf($this->lng->txt('msg_paste_object_not_in_itself'),
494 $source_object->getTitle());
495 }
496
497 if(!$this->checkPermissionBool('create', '', $source_object->getType(), $target_node_id))
498 {
499 $fail[] = sprintf($this->lng->txt('msg_no_perm_paste_object_in_folder'),
500 $source_object->getTitle(), $target_object->getTitle());
501 }
502
503 }
504 else
505 {
506 if(!$ilAccess->checkAccess('create', '', $target_node_id, $source_object->getType()))
507 {
508 $fail[] = sprintf($this->lng->txt('msg_no_perm_paste_object_in_folder'),
509 $source_object->getTitle(), $target_object->getTitle());
510 }
511 }
512
513 if(sizeof($fail))
514 {
515 ilUtil::sendFailure(implode("<br />", $fail), true);
516 $this->ctrl->redirect($this);
517 }
518
519
520 // move the node
521 if($mode == "cut")
522 {
523 if(!$_SESSION['clipboard']['wsp2repo'])
524 {
525 $this->tree->moveTree($source_node_id, $target_node_id);
526 }
527 else
528 {
529 $parent_id = $this->tree->getParentId($source_node_id);
530
531 // remove from personal workspace
532 $this->getAccessHandler()->removePermission($source_node_id);
533 $this->tree->deleteReference($source_node_id);
534 $source_node = $this->tree->getNodeData($source_node_id);
535 $this->tree->deleteTree($source_node);
536
537 // add to repository
538 $source_object->createReference();
539 $source_object->putInTree($target_node_id);
540 $source_object->setPermissions($target_node_id);
541
542 $source_node_id = $parent_id;
543 }
544 }
545 // copy the node
546 else if($mode == "copy")
547 {
548 include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
550 $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
551 $wizard_options->saveOwner($ilUser->getId());
552 $wizard_options->saveRoot($source_node_id);
553 $wizard_options->read();
554
555 $new_obj = $source_object->cloneObject($target_node_id, $copy_id, !$_SESSION['clipboard']['wsp2repo']);
556
557 // insert into workspace tree
558 if($new_obj && !$_SESSION['clipboard']['wsp2repo'])
559 {
560 $new_obj_node_id = $this->tree->insertObject($target_node_id, $new_obj->getId());
561 $this->getAccessHandler()->setPermissions($target_node_id, $new_obj_node_id);
562 }
563
564 $wizard_options->deleteAll();
565 }
566
567 // redirect to target if not repository
568 if(!$_SESSION['clipboard']['wsp2repo'])
569 {
570 $redirect_node = $target_node_id;
571 }
572 else
573 {
574 // reload current folder
575 $redirect_node = $this->node_id;
576 }
577
578 unset($_SESSION['clipboard']['cmd']);
579 unset($_SESSION['clipboard']['source_id']);
580 unset($_SESSION['clipboard']['wsp2repo']);
581 unset($_SESSION['clipboard']['shared']);
582
583 ilUtil::sendSuccess($this->lng->txt('msg_cut_copied'), true);
584 $this->ctrl->setParameter($this, "wsp_id", $redirect_node);
585 $this->ctrl->redirect($this);
586 }
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 $_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().

+ Here is the call graph for this function:

◆ render()

ilObjWorkspaceFolderGUI::render ( )

Render folder.

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

125 {
126 global $tpl, $ilUser, $ilTabs, $ilCtrl;
127
128 unset($_SESSION['clipboard']['wsp2repo']);
129
130 // add new item
131 include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
132 $gui = new ilObjectAddNewItemGUI($this->node_id);
134 $gui->setCreationUrl($ilCtrl->getLinkTarget($this, "create"));
135 $gui->render();
136
137 include_once "Services/Object/classes/class.ilObjectListGUI.php";
139 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
140 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false));
141
142 include_once "Modules/WorkspaceFolder/classes/class.ilObjWorkspaceFolderTableGUI.php";
143 $table = new ilObjWorkspaceFolderTableGUI($this, "render", $this->node_id, $this->getAccessHandler());
144 $tpl->setContent($table->getHTML());
145
146 include_once "Modules/WorkspaceFolder/classes/class.ilWorkspaceFolderExplorer.php";
147 $exp = new ilWorkspaceFolderExplorer($this->ctrl->getLinkTarget($this), $ilUser->getId());
148
149 if($this->node_id != $exp->getRoot())
150 {
151 $ilTabs->activateSubTab("content");
152 }
153
154 $left = "";
155
156 // sub-folders
157 if($this->node_id != $exp->getRoot() || $exp->hasFolders($this->node_id))
158 {
159 $exp->setTargetGet("wsp_id");
160 $exp->setSessionExpandVariable('wspexpand');
161 $exp->setExpand($this->node_id);
162 $exp->setExpandTarget($this->ctrl->getLinkTarget($this));
163
164 if ($_GET["wspexpand"] != "")
165 {
166 $exp->setExpand($_GET["wspexpand"]);
167 }
168
169 $exp->highlightNode($this->node_id);
170 $exp->setOutput(0);
171
172 $left .= $exp->getOutput();
173 }
174
175 $tpl->setLeftNavContent($left);
176 }
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

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

+ Here is the call graph for this function:

◆ resetShareFilter()

ilObjWorkspaceFolderGUI::resetShareFilter ( )

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

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->resetFilter();
618
619 $this->share();
620 }

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

+ Here is the call graph for this function:

◆ setTabs()

ilObjWorkspaceFolderGUI::setTabs (   $a_show_settings = true)

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

25 {
26 global $lng, $ilHelp;
27
28 $ilHelp->setScreenIdComponent("wfld");
29
30 $this->ctrl->setParameter($this,"wsp_id",$this->node_id);
31
32 $this->tabs_gui->addTab("wsp", $lng->txt("wsp_tab_personal"),
33 $this->ctrl->getLinkTarget($this, ""));
34
35 $this->ctrl->setParameterByClass("ilObjWorkspaceRootFolderGUI", "wsp_id",
36 $this->getAccessHandler()->getTree()->getRootId());
37
38 $this->tabs_gui->addTab("share", $lng->txt("wsp_tab_shared"),
39 $this->ctrl->getLinkTargetByClass("ilObjWorkspaceRootFolderGUI", "shareFilter"));
40
41 $this->tabs_gui->addTab("ownership", $lng->txt("wsp_tab_ownership"),
42 $this->ctrl->getLinkTargetByClass(array("ilObjWorkspaceRootFolderGUI", "ilObjectOwnershipManagementGUI"), "listObjects"));
43
44 if(!$this->ctrl->getNextClass($this))
45 {
46 if(stristr($this->ctrl->getCmd(), "share"))
47 {
48 $this->tabs_gui->activateTab("share");
49 }
50 else
51 {
52 $this->tabs_gui->activateTab("wsp");
53
54 if($a_show_settings)
55 {
56 if ($this->checkPermissionBool("read"))
57 {
58 $this->tabs_gui->addSubTab("content",
59 $lng->txt("content"),
60 $this->ctrl->getLinkTarget($this, ""));
61 }
62
63 if ($this->checkPermissionBool("write"))
64 {
65 $this->tabs_gui->addSubTab("settings",
66 $lng->txt("settings"),
67 $this->ctrl->getLinkTarget($this, "edit"));
68 }
69 }
70 }
71 }
72 }

References 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 593 of file class.ilObjWorkspaceFolderGUI.php.

594 {
595 global $tpl;
596
597 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceShareTableGUI.php";
598 $tbl = new ilWorkspaceShareTableGUI($this, "share", $this->getAccessHandler(), $this->node_id, $a_load_data);
599 $tpl->setContent($tbl->getHTML());
600 }

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

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

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

◆ shareFilter()

ilObjWorkspaceFolderGUI::shareFilter ( )

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

589 {
590 $this->share(false);
591 }

References share().

+ Here is the call graph for this function:

◆ showMoveIntoObjectTree()

ilObjWorkspaceFolderGUI::showMoveIntoObjectTree ( )

Move node: select target (via explorer)

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

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

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

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

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

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