ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAdministrationCommandGUI Class Reference

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

+ Collaboration diagram for ilAdministrationCommandGUI:

Public Member Functions

 __construct ($a_container)
 Constructor. More...
 
 getContainer ()
 Get container object. More...
 
 delete ()
 Show delete confirmation. More...
 
 performDelete ()
 Perform delete. More...
 
 cut ()
 Cut object. More...
 
 showPasteTree ()
 Show target selection. More...
 
 showLinkIntoMultipleObjectsTree ()
 Target selection. More...
 
 link ()
 Start linking object. More...
 
 paste ()
 Paste object. More...
 
 performPasteIntoMultipleObjects ()
 

Protected Attributes

 $tpl
 
 $settings
 
 $error
 
 $tree
 
 $obj_definition
 
 $ctrl = null
 
 $lng = null
 

Private Attributes

 $container = null
 

Detailed Description

Handles Administration commands (cut, delete paste)

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

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

Constructor & Destructor Documentation

◆ __construct()

ilAdministrationCommandGUI::__construct (   $a_container)

Constructor.

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

69 {
70 global $DIC;
71
72 $this->tpl = $DIC["tpl"];
73 $this->settings = $DIC->settings();
74 $this->error = $DIC["ilErr"];
75 $this->tree = $DIC->repositoryTree();
76 $this->obj_definition = $DIC["objDefinition"];
77 $ilCtrl = $DIC->ctrl();
78 $lng = $DIC->language();
79
80 $this->container = $a_container;
81 $this->ctrl = $ilCtrl;
82 $this->lng = $lng;
83 }
error($a_errmsg)
set error message @access public
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2

References $DIC, $ilCtrl, $lng, error(), and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ cut()

ilAdministrationCommandGUI::cut ( )

Cut object.

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

166 {
168
169 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
170
171 $_GET['ref_id'] = $tree->getParentId((int) $_GET['item_ref_id']);
172
173 include_once './Services/Container/classes/class.ilContainerGUI.php';
174 $container = new ilContainerGUI(array(), 0, false, false);
175 $container->cutObject();
176 return true;
177 }
$_GET["client_id"]
Class ilContainerGUI.

References $_GET, $container, $tree, and getContainer().

+ Here is the call graph for this function:

◆ delete()

ilAdministrationCommandGUI::delete ( )

Show delete confirmation.

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

97 {
101
102 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
103
104 $to_delete = array();
105 if ((int) $_GET['item_ref_id']) {
106 $to_delete = array(
107 (int) $_GET['item_ref_id']
108 );
109 }
110
111 if (isset($_POST['id']) and is_array($_POST['id'])) {
112 $to_delete = $_POST['id'];
113 }
114
115 if (!$to_delete) {
116 $ilErr->raiseError($this->lng->txt('no_checkbox'), $ilErr->MESSAGE);
117 }
118
119 include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
120 $confirm = new ilConfirmationGUI();
121 $confirm->setFormAction($this->ctrl->getFormActionByClass(get_class($this->getContainer()), 'cancel'));
122 $confirm->setHeaderText('');
123 $confirm->setCancel($this->lng->txt('cancel'), 'cancelDelete');
124 $confirm->setConfirm($this->lng->txt('delete'), 'performDelete');
125
126 foreach ($to_delete as $delete) {
127 $obj_id = ilObject :: _lookupObjId($delete);
129
130 $confirm->addItem(
131 'id[]',
132 $delete,
133 call_user_func(array(ilObjectFactory::getClassByType($type),'_lookupTitle'), $obj_id),
135 );
136 }
137
138 $msg = $this->lng->txt("info_delete_sure");
139
140 if (!$ilSetting->get('enable_trash')) {
141 $msg .= "<br/>" . $this->lng->txt("info_delete_warning_no_trash");
142 }
144
145 $tpl->setContent($confirm->getHTML());
146 }
$_POST["username"]
Confirmation screen class.
static getClassByType($a_obj_type)
Get class by type.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...
global $ilSetting
Definition: privfeed.php:17
$type
$ilErr
Definition: raiseError.php:18

References $_GET, $_POST, $error, $ilErr, $ilSetting, $settings, $tpl, $type, ilObject\_lookupObjId(), ilObject\_lookupType(), ilObjectFactory\getClassByType(), getContainer(), ilUtil\getTypeIconPath(), and ilUtil\sendQuestion().

+ Here is the call graph for this function:

◆ getContainer()

ilAdministrationCommandGUI::getContainer ( )

Get container object.

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

89 {
90 return $this->container;
91 }

References $container.

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

+ Here is the caller graph for this function:

◆ link()

ilAdministrationCommandGUI::link ( )

Start linking object.

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

229 {
231
232 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
233
234 $_GET['ref_id'] = $tree->getParentId((int) $_GET['item_ref_id']);
235
236 include_once './Services/Container/classes/class.ilContainerGUI.php';
237 $container = new ilContainerGUI(array(), 0, false, false);
238 $container->linkObject();
239 return true;
240 }

References $_GET, $container, $tree, and getContainer().

+ Here is the call graph for this function:

◆ paste()

ilAdministrationCommandGUI::paste ( )

Paste object.

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

246 {
247 $objDefinition = $this->obj_definition;
248
249 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
250 $_GET['ref_id'] = (int) $_GET['item_ref_id'];
251
252 $obj_id = ilObject :: _lookupObjId((int) $_GET['item_ref_id']);
254
255 $location = $objDefinition->getLocation($type);
256 $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
257
258 // create instance
259 include_once($location . "/class." . $class_name . ".php");
260 $container = new $class_name(array(), (int) $_GET['item_ref_id'], true, false);
261 $container->pasteObject();
262 return true;
263 }
$location
Definition: buildRTE.php:44

References $_GET, $container, $location, $obj_definition, $type, ilObject\_lookupObjId(), ilObject\_lookupType(), and getContainer().

+ Here is the call graph for this function:

◆ performDelete()

ilAdministrationCommandGUI::performDelete ( )

Perform delete.

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

152 {
153 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
154
155 include_once './Services/Object/classes/class.ilObjectGUI.php';
156 $_SESSION['saved_post'] = $_POST['id'];
157 $object = new ilObjectGUI(array(), 0, false, false);
158 $object->confirmedDeleteObject();
159 return true;
160 }
$_SESSION["AccountId"]
Class ilObjectGUI Basic methods of all Output classes.

References $_POST, $_SESSION, and getContainer().

+ Here is the call graph for this function:

◆ performPasteIntoMultipleObjects()

ilAdministrationCommandGUI::performPasteIntoMultipleObjects ( )

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

266 {
267 $objDefinition = $this->obj_definition;
268
269 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
270
271 $obj_id = ilObject :: _lookupObjId((int) $_GET['ref_id']);
273
274 $location = $objDefinition->getLocation($type);
275 $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
276
277 // create instance
278 include_once($location . "/class." . $class_name . ".php");
279 $container = new $class_name(array(), (int) $_GET['ref_id'], true, false);
280 $container->performPasteIntoMultipleObjectsObject();
281 return true;
282 }

References $_GET, $container, $location, $obj_definition, $type, ilObject\_lookupObjId(), ilObject\_lookupType(), and getContainer().

+ Here is the call graph for this function:

◆ showLinkIntoMultipleObjectsTree()

ilAdministrationCommandGUI::showLinkIntoMultipleObjectsTree ( )

Target selection.

Returns

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

207 {
208 $objDefinition = $this->obj_definition;
209
210 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
211
212 $obj_id = ilObject :: _lookupObjId((int) $_GET['ref_id']);
214
215 $location = $objDefinition->getLocation($type);
216 $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
217
218 // create instance
219 include_once($location . "/class." . $class_name . ".php");
220 $container = new $class_name(array(), (int) $_GET['ref_id'], true, false);
221 $container->showLinkIntoMultipleObjectsTreeObject();
222 return true;
223 }

References $_GET, $container, $location, $obj_definition, $type, ilObject\_lookupObjId(), ilObject\_lookupType(), and getContainer().

+ Here is the call graph for this function:

◆ showPasteTree()

ilAdministrationCommandGUI::showPasteTree ( )

Show target selection.

Returns

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

184 {
185 $objDefinition = $this->obj_definition;
186
187 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
188
189 $obj_id = ilObject :: _lookupObjId((int) $_GET['ref_id']);
191
192 $location = $objDefinition->getLocation($type);
193 $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
194
195 // create instance
196 include_once($location . "/class." . $class_name . ".php");
197 $container = new $class_name(array(), (int) $_GET['ref_id'], true, false);
198 $container->showPasteTreeObject();
199 return true;
200 }

References $_GET, $container, $location, $obj_definition, $type, ilObject\_lookupObjId(), ilObject\_lookupType(), and getContainer().

+ Here is the call graph for this function:

Field Documentation

◆ $container

ilAdministrationCommandGUI::$container = null
private

◆ $ctrl

ilAdministrationCommandGUI::$ctrl = null
protected

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

◆ $error

ilAdministrationCommandGUI::$error
protected

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

Referenced by delete().

◆ $lng

ilAdministrationCommandGUI::$lng = null
protected

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

Referenced by __construct().

◆ $obj_definition

ilAdministrationCommandGUI::$obj_definition
protected

◆ $settings

ilAdministrationCommandGUI::$settings
protected

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

Referenced by delete().

◆ $tpl

ilAdministrationCommandGUI::$tpl
protected

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

Referenced by delete().

◆ $tree

ilAdministrationCommandGUI::$tree
protected

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

Referenced by cut(), and link().


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