ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAdministrationCommandGUI Class Reference

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

+ Collaboration diagram for ilAdministrationCommandGUI:

Public Member Functions

 getContainer ()
 
 delete ()
 
 performDelete ()
 
 cut ()
 
 showMoveIntoObjectTree ()
 
 showLinkIntoMultipleObjectsTree ()
 
 link ()
 
 showPasteTree ()
 
 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.

120 : void
121 {
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 $this->ctrl->setParameter($container, 'ref_id', $ref_id);
130 $container->cutObject();
131 }
ilAdministrationCommandHandling $container
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
getParentId(int $a_node_id)
get parent id of given node
$ref_id
Definition: ltiauth.php:66

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

+ Here is the call graph for this function:

◆ delete()

ilAdministrationCommandGUI::delete ( )

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

68 : void
69 {
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 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getClassByType(string $obj_type)
static _lookupType(int $id, bool $reference=false)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupObjId(int $ref_id)
setContent(string $a_html)
Sets content for standard template.
global $ilSetting
Definition: privfeed.php:31
$ilErr
Definition: raiseError.php:33

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

+ Here is the call graph for this function:

◆ getContainer()

ilAdministrationCommandGUI::getContainer ( )

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

64 {
65 return $this->container;
66 }
Interface for GUI classes (PDGUI, LuceneSearchGUI...) that have to handle administration commands (cu...

References $container.

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

+ Here is the caller graph for this function:

◆ link()

ilAdministrationCommandGUI::link ( )

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

168 : void
169 {
171
172 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
173
174 $ref_id = $tree->getParentId($this->request->getItemRefId());
175
176 $container = new ilContainerGUI(array(), $ref_id, true, false);
177 $this->ctrl->setParameter($container, 'ref_id', $ref_id);
178 $container->linkObject();
179 }

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

+ Here is the call graph for this function:

◆ paste()

ilAdministrationCommandGUI::paste ( )

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

194 : void
195 {
196 $objDefinition = $this->obj_definition;
197
198 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
199
200 $obj_id = ilObject::_lookupObjId($this->request->getItemRefId());
201 $type = ilObject::_lookupType($obj_id);
202
203 $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
204
205 // create instance
206 $container = new $class_name(array(), $this->request->getItemRefId(), true, false);
207 $container->pasteObject();
208 }

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

+ Here is the call graph for this function:

◆ performDelete()

ilAdministrationCommandGUI::performDelete ( )

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

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.

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

+ Here is the call graph for this function:

◆ performPasteIntoMultipleObjects()

ilAdministrationCommandGUI::performPasteIntoMultipleObjects ( )

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

210 : void
211 {
212 $objDefinition = $this->obj_definition;
213
214 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
215
216 $obj_id = ilObject::_lookupObjId($this->request->getRefId());
217 $type = ilObject::_lookupType($obj_id);
218
219 $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
220
221 // create instance
222 $container = new $class_name(array(), $this->request->getRefId(), true, false);
223 $container->performPasteIntoMultipleObjectsObject();
224 }

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

+ Here is the call graph for this function:

◆ showLinkIntoMultipleObjectsTree()

ilAdministrationCommandGUI::showLinkIntoMultipleObjectsTree ( )

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

151 : void
152 {
153 $objDefinition = $this->obj_definition;
154
155 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
156
157 $obj_id = ilObject::_lookupObjId($this->request->getRefId());
158 $type = ilObject::_lookupType($obj_id);
159
160 $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
161
162 // create instance
163 $container = new $class_name(array(), $this->request->getRefId(), true, false);
164 $container->showLinkIntoMultipleObjectsTreeObject();
165 }

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

+ Here is the call graph for this function:

◆ showMoveIntoObjectTree()

ilAdministrationCommandGUI::showMoveIntoObjectTree ( )

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

134 : void
135 {
136 $objDefinition = $this->obj_definition;
137
138 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
139
140 $obj_id = ilObject::_lookupObjId($this->request->getRefId());
141 $type = ilObject::_lookupType($obj_id);
142
143 $class_name = "ilObj" . $objDefinition->getClassName($type) . 'GUI';
144
145 // create instance
146 $container = new $class_name(array(), $this->request->getRefId(), true, false);
147 $container->showMoveIntoObjectTreeObject();
148 }

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

+ Here is the call graph for this function:

◆ showPasteTree()

ilAdministrationCommandGUI::showPasteTree ( )

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

181 : void
182 {
184
185 $this->ctrl->setReturnByClass(get_class($this->getContainer()), '');
186
187 $ref_id = $tree->getParentId($this->request->getRefId());
188
189 $container = new ilContainerGUI(array(), $ref_id, true, false);
190 $container->showPasteTreeObject();
191 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $container

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

◆ $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(), link(), and showPasteTree().

◆ ilObjectDefinition$obj_definition

ilAdministrationCommandGUI::ilObjectDefinition$obj_definition
protected

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


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