ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 showMoveIntoObjectTree ()
 Show target selection. More...
 
 showLinkIntoMultipleObjectsTree ()
 Target selection. More...
 
 link ()
 Start linking object. More...
 
 paste ()
 Paste object. More...
 
 performPasteIntoMultipleObjects ()
 

Protected Attributes

 $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 43 of file class.ilAdministrationCommandGUI.php.

References $ilCtrl, and $lng.

44  {
45  global $ilCtrl, $lng;
46 
47  $this->container = $a_container;
48  $this->ctrl = $ilCtrl;
49  $this->lng = $lng;
50  }
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ cut()

ilAdministrationCommandGUI::cut ( )

Cut object.

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

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

136  {
137  global $tree;
138 
139  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
140 
141  $_GET['ref_id'] = $tree->getParentId((int) $_GET['item_ref_id']);
142 
143  include_once './Services/Container/classes/class.ilContainerGUI.php';
144  $container = new ilContainerGUI(array (), 0, false, false);
145  $container->cutObject();
146  return true;
147  }
$_GET["client_id"]
Create styles array
The data for the language used.
Class ilContainerGUI.
+ Here is the call graph for this function:

◆ delete()

ilAdministrationCommandGUI::delete ( )

Show delete confirmation.

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

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

64  {
65  global $tpl,$ilSetting,$ilErr;
66 
67  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
68 
69  $to_delete = array ();
70  if ((int) $_GET['item_ref_id'])
71  {
72  $to_delete = array (
73  (int) $_GET['item_ref_id']
74  );
75  }
76 
77  if (isset ($_POST['id']) and is_array($_POST['id']))
78  {
79  $to_delete = $_POST['id'];
80  }
81 
82  if(!$to_delete)
83  {
84  $ilErr->raiseError($this->lng->txt('no_checkbox'),$ilErr->MESSAGE);
85  }
86 
87  include_once ('./Services/Utilities/classes/class.ilConfirmationGUI.php');
88  $confirm = new ilConfirmationGUI();
89  $confirm->setFormAction($this->ctrl->getFormActionByClass(get_class($this->getContainer()), 'cancel'));
90  $confirm->setHeaderText('');
91  $confirm->setCancel($this->lng->txt('cancel'), 'cancelDelete');
92  $confirm->setConfirm($this->lng->txt('delete'), 'performDelete');
93 
94  foreach ($to_delete as $delete)
95  {
96  $obj_id = ilObject :: _lookupObjId($delete);
97  $type = ilObject :: _lookupType($obj_id);
98 
99  $confirm->addItem(
100  'id[]',
101  $delete,
102  call_user_func(array(ilObjectFactory::getClassByType($type),'_lookupTitle'),$obj_id),
103  ilUtil :: getTypeIconPath($type, $obj_id)
104  );
105  }
106 
107  $msg = $this->lng->txt("info_delete_sure");
108 
109  if(!$ilSetting->get('enable_trash'))
110  {
111  $msg .= "<br/>".$this->lng->txt("info_delete_warning_no_trash");
112  }
113  ilUtil::sendQuestion($msg);
114 
115  $tpl->setContent($confirm->getHTML());
116  }
static getClassByType($a_obj_type)
Get class by type.
global $ilErr
Definition: raiseError.php:16
$_GET["client_id"]
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 $tpl
Definition: ilias.php:8
static _lookupObjId($a_id)
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilSetting
Definition: privfeed.php:17
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ getContainer()

ilAdministrationCommandGUI::getContainer ( )

Get container object.

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

References $container.

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

+ Here is the caller graph for this function:

◆ link()

ilAdministrationCommandGUI::link ( )

Start linking object.

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

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

200  {
201  global $tree;
202 
203  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
204 
205  $_GET['ref_id'] = $tree->getParentId((int) $_GET['item_ref_id']);
206 
207  include_once './Services/Container/classes/class.ilContainerGUI.php';
208  $container = new ilContainerGUI(array (), 0, false, false);
209  $container->linkObject();
210  return true;
211  }
$_GET["client_id"]
Create styles array
The data for the language used.
Class ilContainerGUI.
+ Here is the call graph for this function:

◆ paste()

ilAdministrationCommandGUI::paste ( )

Paste object.

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

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

217  {
218  global $objDefinition;
219 
220  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
221  $_GET['ref_id'] = (int) $_GET['item_ref_id'];
222 
223  $obj_id = ilObject :: _lookupObjId((int) $_GET['item_ref_id']);
224  $type = ilObject :: _lookupType($obj_id);
225 
226  $location = $objDefinition->getLocation($type);
227  $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
228 
229  // create instance
230  include_once ($location . "/class." . $class_name . ".php");
231  $container = new $class_name (array (), (int) $_GET['item_ref_id'], true, false);
232  $container->pasteObject();
233  return true;
234  }
$_GET["client_id"]
$location
Definition: buildRTE.php:44
static _lookupObjId($a_id)
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ performDelete()

ilAdministrationCommandGUI::performDelete ( )

Perform delete.

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

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

122  {
123  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
124 
125  include_once './Services/Object/classes/class.ilObjectGUI.php';
126  $_SESSION['saved_post'] = $_POST['id'];
127  $object = new ilObjectGUI(array (), 0, false, false);
128  $object->confirmedDeleteObject();
129  return true;
130  }
$_SESSION["AccountId"]
Class ilObjectGUI Basic methods of all Output classes.
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:

◆ performPasteIntoMultipleObjects()

ilAdministrationCommandGUI::performPasteIntoMultipleObjects ( )

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

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

237  {
238  global $objDefinition;
239 
240  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
241 
242  $obj_id = ilObject :: _lookupObjId((int) $_GET['ref_id']);
243  $type = ilObject :: _lookupType($obj_id);
244 
245  $location = $objDefinition->getLocation($type);
246  $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
247 
248  // create instance
249  include_once ($location . "/class." . $class_name . ".php");
250  $container = new $class_name (array (), (int) $_GET['ref_id'], true, false);
251  $container->performPasteIntoMultipleObjectsObject();
252  return true;
253  }
$_GET["client_id"]
$location
Definition: buildRTE.php:44
static _lookupObjId($a_id)
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ showLinkIntoMultipleObjectsTree()

ilAdministrationCommandGUI::showLinkIntoMultipleObjectsTree ( )

Target selection.

Returns

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

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

178  {
179  global $objDefinition;
180 
181  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
182 
183  $obj_id = ilObject :: _lookupObjId((int) $_GET['ref_id']);
184  $type = ilObject :: _lookupType($obj_id);
185 
186  $location = $objDefinition->getLocation($type);
187  $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
188 
189  // create instance
190  include_once ($location . "/class." . $class_name . ".php");
191  $container = new $class_name (array (), (int) $_GET['ref_id'], true, false);
192  $container->showLinkIntoMultipleObjectsTreeObject();
193  return true;
194  }
$_GET["client_id"]
$location
Definition: buildRTE.php:44
static _lookupObjId($a_id)
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ showMoveIntoObjectTree()

ilAdministrationCommandGUI::showMoveIntoObjectTree ( )

Show target selection.

Returns

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

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

154  {
155  global $objDefinition;
156 
157  $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
158 
159  $obj_id = ilObject :: _lookupObjId((int) $_GET['ref_id']);
160  $type = ilObject :: _lookupType($obj_id);
161 
162  $location = $objDefinition->getLocation($type);
163  $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
164 
165  // create instance
166  include_once ($location . "/class." . $class_name . ".php");
167  $container = new $class_name (array (), (int) $_GET['ref_id'], true, false);
168  $container->showMoveIntoObjectTreeObject();
169  return true;
170 
171  }
$_GET["client_id"]
$location
Definition: buildRTE.php:44
static _lookupObjId($a_id)
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

Field Documentation

◆ $container

ilAdministrationCommandGUI::$container = null
private

◆ $ctrl

ilAdministrationCommandGUI::$ctrl = null
protected

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

◆ $lng

ilAdministrationCommandGUI::$lng = null
protected

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

Referenced by __construct().


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