ILIAS  trunk Revision v5.2.0beta1-34132-g2d4d73d4a0
ilAdministrationCommandGUI Class Reference

Handles Administration commands (cut, delete paste) More...

+ Collaboration diagram for ilAdministrationCommandGUI:

Public Member Functions

 getContainer ()
 
 delete ()
 
 performDelete ()
 
 cut ()
 
 showMoveIntoObjectTree ()
 
 showLinkIntoMultipleObjectsTree ()
 
 link ()
 
 paste ()
 
 performPasteIntoMultipleObjects ()
 

Protected Attributes

ilGlobalTemplateInterface $tpl
 
ilSetting $settings
 
ilErrorHandling $error
 
ilTree $tree
 
ilObjectDefinition $obj_definition
 
ilCtrl $ctrl = null
 
ilLanguage $lng = null
 
AdminGUIRequest $request
 

Private Attributes

ilAdministrationCommandHandling $container
 

Detailed Description

Handles Administration commands (cut, delete paste)

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

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

Member Function Documentation

◆ cut()

ilAdministrationCommandGUI::cut ( )

Definition at line 120 of file class.ilAdministrationCommandGUI.php.

References $ref_id, $tree, ILIAS\Repository\ctrl(), getContainer(), and ilTree\getParentId().

120  : void
121  {
122  $tree = $this->tree;
123 
124  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
125 
126  $ref_id = $tree->getParentId($this->request->getItemRefId());
127 
128  $container = new ilContainerGUI(array(), $ref_id, true, false);
129  $container->cutObject();
130  }
$ref_id
Definition: ltiauth.php:65
getParentId(int $a_node_id)
get parent id of given node
ilAdministrationCommandHandling $container
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder...
+ Here is the call graph for this function:

◆ delete()

ilAdministrationCommandGUI::delete ( )

Definition at line 68 of file class.ilAdministrationCommandGUI.php.

References $error, $ilErr, $ilSetting, $settings, $tpl, ilObject\_getIcon(), ilObject\_lookupObjId(), ilObject\_lookupType(), ILIAS\Repository\ctrl(), ilObjectFactory\getClassByType(), getContainer(), ILIAS\Repository\lng(), and ilGlobalTemplateInterface\setContent().

68  : void
69  {
70  $tpl = $this->tpl;
73 
74  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
75 
76  $to_delete = $this->request->getSelectedIds();
77 
78  if (count($to_delete) === 0) {
79  $ilErr->raiseError($this->lng->txt('no_checkbox'), $ilErr->MESSAGE);
80  }
81 
82  $confirm = new ilConfirmationGUI();
83  $confirm->setFormAction($this->ctrl->getFormActionByClass(get_class($this->getContainer()), 'cancel'));
84  $confirm->setHeaderText('');
85  $confirm->setCancel($this->lng->txt('cancel'), 'cancelDelete');
86  $confirm->setConfirm($this->lng->txt('delete'), 'performDelete');
87 
88  foreach ($to_delete as $delete) {
89  $obj_id = ilObject::_lookupObjId($delete);
90  $type = ilObject::_lookupType($obj_id);
91 
92  $confirm->addItem(
93  'id[]',
94  (string) $delete,
95  call_user_func(array(ilObjectFactory::getClassByType($type),'_lookupTitle'), $obj_id),
96  ilObject::_getIcon($obj_id, 'small', $type)
97  );
98  }
99 
100  $msg = $this->lng->txt("info_delete_sure");
101 
102  if (!$ilSetting->get('enable_trash')) {
103  $msg .= "<br/>" . $this->lng->txt("info_delete_warning_no_trash");
104  }
105  $this->tpl->setOnScreenMessage('question', $msg);
106 
107  $tpl->setContent($confirm->getHTML());
108  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
$ilErr
Definition: raiseError.php:17
static _lookupObjId(int $ref_id)
setContent(string $a_html)
Sets content for standard template.
static getClassByType(string $obj_type)
global $ilSetting
Definition: privfeed.php:16
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ getContainer()

ilAdministrationCommandGUI::getContainer ( )

Definition at line 63 of file class.ilAdministrationCommandGUI.php.

References $container.

Referenced by cut(), delete(), link(), paste(), performDelete(), performPasteIntoMultipleObjects(), showLinkIntoMultipleObjectsTree(), and showMoveIntoObjectTree().

64  {
65  return $this->container;
66  }
ilAdministrationCommandHandling $container
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ link()

ilAdministrationCommandGUI::link ( )

Definition at line 167 of file class.ilAdministrationCommandGUI.php.

References $ref_id, $tree, ILIAS\Repository\ctrl(), getContainer(), and ilTree\getParentId().

167  : void
168  {
169  $tree = $this->tree;
170 
171  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
172 
173  $ref_id = $tree->getParentId($this->request->getItemRefId());
174 
175  $container = new ilContainerGUI(array(), $ref_id, true, false);
176  $container->linkObject();
177  }
$ref_id
Definition: ltiauth.php:65
getParentId(int $a_node_id)
get parent id of given node
ilAdministrationCommandHandling $container
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder...
+ Here is the call graph for this function:

◆ paste()

ilAdministrationCommandGUI::paste ( )

Definition at line 180 of file class.ilAdministrationCommandGUI.php.

References $obj_definition, ilObject\_lookupObjId(), ilObject\_lookupType(), ILIAS\Repository\ctrl(), and getContainer().

180  : void
181  {
182  $objDefinition = $this->obj_definition;
183 
184  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
185 
186  $obj_id = ilObject::_lookupObjId($this->request->getItemRefId());
187  $type = ilObject::_lookupType($obj_id);
188 
189  $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
190 
191  // create instance
192  $container = new $class_name(array(), $this->request->getItemRefId(), true, false);
193  $container->pasteObject();
194  }
static _lookupObjId(int $ref_id)
ilAdministrationCommandHandling $container
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ performDelete()

ilAdministrationCommandGUI::performDelete ( )

Definition at line 110 of file class.ilAdministrationCommandGUI.php.

References ILIAS\Repository\ctrl(), getContainer(), and ilSession\set().

110  : void
111  {
112  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
113 
114  ilSession::set("saved_post", $this->request->getSelectedIds());
115 
116  $object = new ilObjectGUI(array(), 0, false, false);
117  $object->confirmedDeleteObject();
118  }
Class ilObjectGUI Basic methods of all Output classes.
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ performPasteIntoMultipleObjects()

ilAdministrationCommandGUI::performPasteIntoMultipleObjects ( )

Definition at line 196 of file class.ilAdministrationCommandGUI.php.

References $obj_definition, ilObject\_lookupObjId(), ilObject\_lookupType(), ILIAS\Repository\ctrl(), and getContainer().

196  : void
197  {
198  $objDefinition = $this->obj_definition;
199 
200  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
201 
202  $obj_id = ilObject::_lookupObjId($this->request->getRefId());
203  $type = ilObject::_lookupType($obj_id);
204 
205  $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
206 
207  // create instance
208  $container = new $class_name(array(), $this->request->getRefId(), true, false);
209  $container->performPasteIntoMultipleObjectsObject();
210  }
static _lookupObjId(int $ref_id)
ilAdministrationCommandHandling $container
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ showLinkIntoMultipleObjectsTree()

ilAdministrationCommandGUI::showLinkIntoMultipleObjectsTree ( )

Definition at line 150 of file class.ilAdministrationCommandGUI.php.

References $obj_definition, ilObject\_lookupObjId(), ilObject\_lookupType(), ILIAS\Repository\ctrl(), and getContainer().

150  : void
151  {
152  $objDefinition = $this->obj_definition;
153 
154  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
155 
156  $obj_id = ilObject::_lookupObjId($this->request->getRefId());
157  $type = ilObject::_lookupType($obj_id);
158 
159  $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
160 
161  // create instance
162  $container = new $class_name(array(), $this->request->getRefId(), true, false);
163  $container->showLinkIntoMultipleObjectsTreeObject();
164  }
static _lookupObjId(int $ref_id)
ilAdministrationCommandHandling $container
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ showMoveIntoObjectTree()

ilAdministrationCommandGUI::showMoveIntoObjectTree ( )

Definition at line 133 of file class.ilAdministrationCommandGUI.php.

References $obj_definition, ilObject\_lookupObjId(), ilObject\_lookupType(), ILIAS\Repository\ctrl(), and getContainer().

133  : void
134  {
135  $objDefinition = $this->obj_definition;
136 
137  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
138 
139  $obj_id = ilObject::_lookupObjId($this->request->getRefId());
140  $type = ilObject::_lookupType($obj_id);
141 
142  $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
143 
144  // create instance
145  $container = new $class_name(array(), $this->request->getRefId(), true, false);
146  $container->showMoveIntoObjectTreeObject();
147  }
static _lookupObjId(int $ref_id)
ilAdministrationCommandHandling $container
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

Field Documentation

◆ $container

ilAdministrationCommandHandling ilAdministrationCommandGUI::$container
private

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

Referenced by getContainer().

◆ $ctrl

ilCtrl ilAdministrationCommandGUI::$ctrl = null
protected

Definition at line 35 of file class.ilAdministrationCommandGUI.php.

◆ $error

ilErrorHandling ilAdministrationCommandGUI::$error
protected

Definition at line 32 of file class.ilAdministrationCommandGUI.php.

Referenced by delete().

◆ $lng

ilLanguage ilAdministrationCommandGUI::$lng = null
protected

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

◆ $obj_definition

ilObjectDefinition ilAdministrationCommandGUI::$obj_definition
protected

◆ $request

AdminGUIRequest ilAdministrationCommandGUI::$request
protected

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

◆ $settings

ilSetting ilAdministrationCommandGUI::$settings
protected

Definition at line 31 of file class.ilAdministrationCommandGUI.php.

Referenced by delete().

◆ $tpl

ilGlobalTemplateInterface ilAdministrationCommandGUI::$tpl
protected

Definition at line 30 of file class.ilAdministrationCommandGUI.php.

Referenced by delete().

◆ $tree

ilTree ilAdministrationCommandGUI::$tree
protected

Definition at line 33 of file class.ilAdministrationCommandGUI.php.

Referenced by cut(), and link().


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