ILIAS  release_8 Revision v8.23
ilRepositoryTrashGUI Class Reference

Repository GUI Utilities. More...

+ Collaboration diagram for ilRepositoryTrashGUI:

Public Member Functions

 executeCommand ()
 
 restoreToNewLocation (ilPropertyFormGUI $form=null)
 
 doRestoreToNewLocation ()
 
 showDeleteConfirmation (?array $a_ids, bool $a_supress_message=false)
 
 handleMultiReferences (int $a_obj_id, int $a_ref_id, string $a_form_name)
 
 showTrashTable (int $a_ref_id)
 
 restoreObjects (int $a_cur_ref_id, array $a_ref_ids)
 Restore objects from trash. More...
 
 deleteObjects (int $a_cur_ref_id, array $a_ref_ids)
 
 removeObjectsFromSystem (array $a_ref_ids, bool $a_from_recovery_folder=false)
 
 confirmRemoveFromSystemObject (array $a_ids)
 Confirmation for trash. More...
 

Protected Member Functions

 cancel ()
 
 initFormTrashTargetLocation ()
 
 buildPath (array $ref_ids)
 Build path with deep-link. More...
 

Protected Attributes

ilLanguage $lng
 
ilSetting $settings
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilObjectDefinition $obj_definition
 
ilAccessHandler $access
 
ilTree $tree
 
ilLogger $logger = null
 
TrashGUIRequest $request
 
object $parent_gui
 
string $parent_cmd
 

Detailed Description

Repository GUI Utilities.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de ilRepositoryTrashGUI: ilPropertyFormGUI

Definition at line 27 of file class.ilRepositoryTrashGUI.php.

Member Function Documentation

◆ buildPath()

ilRepositoryTrashGUI::buildPath ( array  $ref_ids)
protected

Build path with deep-link.

Definition at line 457 of file class.ilRepositoryTrashGUI.php.

References $data, $path, $ref_id, $tree, ilLink\_getLink(), ilTree\getPathFull(), and ilUtil\stripSlashes().

Referenced by handleMultiReferences().

457  : array
458  {
459  $tree = $this->tree;
460 
461  if (!count($ref_ids)) {
462  return [];
463  }
464 
465  $result = [];
466  foreach ($ref_ids as $ref_id) {
467  $path = "";
468  $path_full = $tree->getPathFull($ref_id);
469  foreach ($path_full as $idx => $data) {
470  if ($idx) {
471  $path .= " » ";
472  }
473  if ((int) $ref_id !== (int) $data['ref_id']) {
474  $path .= ilUtil::stripSlashes($data['title']);
475  } else {
476  $path .= ('<a target="_top" href="' .
477  ilLink::_getLink($data['ref_id'], $data['type']) . '">' .
478  ilUtil::stripSlashes($data['title']) . '</a>');
479  }
480  }
481 
482  $result[] = $path;
483  }
484  return $result;
485  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
getPathFull(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...
$path
Definition: ltiservices.php:32
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel()

ilRepositoryTrashGUI::cancel ( )
protected

Definition at line 85 of file class.ilRepositoryTrashGUI.php.

References ILIAS\Repository\ctrl().

85  : void
86  {
87  $this->ctrl->returnToParent($this);
88  }
+ Here is the call graph for this function:

◆ confirmRemoveFromSystemObject()

ilRepositoryTrashGUI::confirmRemoveFromSystemObject ( array  $a_ids)

Confirmation for trash.

Parameters
array$a_idsref_ids

Definition at line 492 of file class.ilRepositoryTrashGUI.php.

References $ctrl, $id, $lng, $obj_definition, $tpl, $type, ilObject\_getIcon(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilObjectFactory\getClassByType(), ilObjectPlugin\lookupTxtById(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

494  : void {
495  $ilCtrl = $this->ctrl;
496  $lng = $this->lng;
497  $objDefinition = $this->obj_definition;
498  $tpl = $this->tpl;
499 
500  if (!is_array($a_ids)) {
501  $a_ids = [$a_ids];
502  }
503 
504  $cgui = new ilConfirmationGUI();
505  $cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui));
506  $cgui->setCancel($lng->txt("cancel"), "trash");
507  $cgui->setConfirm($lng->txt("confirm"), "removeFromSystem");
508  $cgui->setFormName("trash_confirmation");
509  $cgui->setHeaderText($lng->txt("info_delete_sure"));
510 
511  foreach ($a_ids as $id) {
512  $obj_id = ilObject::_lookupObjId($id);
513  $type = ilObject::_lookupType($obj_id);
514  $title = call_user_func([ilObjectFactory::getClassByType($type), '_lookupTitle'], $obj_id);
515  $alt = ($objDefinition->isPlugin($type))
516  ? $lng->txt("icon") . " " . ilObjectPlugin::lookupTxtById($type, "obj_" . $type)
517  : $lng->txt("icon") . " " . $lng->txt("obj_" . $type);
518 
519  $cgui->addItem(
520  "trash_id[]",
521  $id,
522  $title,
523  ilObject::_getIcon($obj_id, "small", $type),
524  $alt
525  );
526  }
527 
528  $tpl->setContent($cgui->getHTML());
529  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$type
static _lookupObjId(int $ref_id)
setContent(string $a_html)
Sets content for standard template.
ilObjectDefinition $obj_definition
static lookupTxtById(string $plugin_id, string $lang_var)
static getClassByType(string $obj_type)
ilGlobalTemplateInterface $tpl
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ deleteObjects()

ilRepositoryTrashGUI::deleteObjects ( int  $a_cur_ref_id,
array  $a_ref_ids 
)

Definition at line 403 of file class.ilRepositoryTrashGUI.php.

References Vendor\Package\$e, $ilSetting, $lng, $settings, ilRepUtil\deleteObjects(), and ilLanguage\txt().

406  : void {
408  $lng = $this->lng;
409 
410  if (!is_array($a_ref_ids) || count($a_ref_ids) === 0) {
411  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
412  } else {
413  try {
414  ilRepUtil::deleteObjects($a_cur_ref_id, $a_ref_ids, false);
415  if ($ilSetting->get('enable_trash')) {
416  $this->tpl->setOnScreenMessage('success', $lng->txt("info_deleted"), true);
417  } else {
418  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_removed"), true);
419  }
420  } catch (Exception $e) {
421  //$this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
422  // alex: I outcommented this, since it makes tracking down errors impossible
423  // we need a call stack at least in the logs
424  throw $e;
425  }
426  }
427  }
static deleteObjects(int $a_cur_ref_id, array $a_ids, bool $throw_error_on_already_deleted=true)
Delete objects.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ doRestoreToNewLocation()

ilRepositoryTrashGUI::doRestoreToNewLocation ( )
Exceptions
ilDatabaseException
ilObjectNotFoundException

Definition at line 115 of file class.ilRepositoryTrashGUI.php.

References Vendor\Package\$e, ILIAS\Repository\ctrl(), initFormTrashTargetLocation(), ILIAS\Repository\lng(), and ilRepUtil\restoreObjects().

115  : void
116  {
117  $trash_ids = $this->request->getTrashIds();
118 
119  $form = $this->initFormTrashTargetLocation();
120  if (!$form->checkInput() && count($trash_ids)) {
121  $this->lng->loadLanguageModule('search');
122  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('search_no_selection'), true);
123  $this->ctrl->returnToParent($this);
124  }
125 
126  try {
127  ilRepUtil::restoreObjects($form->getInput('target_id'), $trash_ids);
128  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_undeleted'), true);
129  $this->ctrl->returnToParent($this);
130  } catch (ilRepositoryException $e) {
131  $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
132  $this->ctrl->returnToParent($this);
133  }
134  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static restoreObjects(int $a_cur_ref_id, array $a_ref_ids)
Move objects from trash back to repository.
+ Here is the call graph for this function:

◆ executeCommand()

ilRepositoryTrashGUI::executeCommand ( )
Exceptions
ilCtrlException

Definition at line 69 of file class.ilRepositoryTrashGUI.php.

References ILIAS\Repository\ctrl(), and initFormTrashTargetLocation().

69  : void
70  {
71  $next_class = $this->ctrl->getNextClass($this);
72  switch ($next_class) {
73  case "ilpropertyformgui":
74  $form = $this->initFormTrashTargetLocation();
75  $this->ctrl->forwardCommand($form);
76  break;
77 
78  default:
79  $cmd = $this->ctrl->getCmd('cancel');
80  $this->$cmd();
81  break;
82  }
83  }
+ Here is the call graph for this function:

◆ handleMultiReferences()

ilRepositoryTrashGUI::handleMultiReferences ( int  $a_obj_id,
int  $a_ref_id,
string  $a_form_name 
)

Definition at line 242 of file class.ilRepositoryTrashGUI.php.

References $access, $lng, $path, $tree, ilObject\_getAllReferences(), buildPath(), ilGlobalTemplateInterface\get(), ilTree\isDeleted(), ilLanguage\loadLanguageModule(), ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), ilGlobalTemplateInterface\setVariable(), and ilLanguage\txt().

Referenced by showDeleteConfirmation().

246  : string {
247  $lng = $this->lng;
248  $ilAccess = $this->access;
249  $tree = $this->tree;
250 
251  // process
252 
253  $all_refs = ilObject::_getAllReferences($a_obj_id);
254  if (count($all_refs) > 1) {
255  $lng->loadLanguageModule("rep");
256 
257  $may_delete_any = 0;
258  $counter = 0;
259  $items = [];
260  foreach ($all_refs as $mref_id) {
261  // not the already selected reference, no refs from trash
262  if ($mref_id != $a_ref_id && !$tree->isDeleted($mref_id)) {
263  if ($ilAccess->checkAccess("read", "", $mref_id)) {
264  $may_delete = false;
265  if ($ilAccess->checkAccess("delete", "", $mref_id)) {
266  $may_delete = true;
267  $may_delete_any++;
268  }
269 
270  $path = $this->buildPath([$mref_id]);
271  $items[] = [
272  "id" => $mref_id,
273  "path" => array_shift($path),
274  "delete" => $may_delete
275  ];
276  } else {
277  $counter++;
278  }
279  }
280  }
281 
282 
283  // render
284 
285  $tpl = new ilTemplate("tpl.rep_multi_ref.html", true, true, "Services/Repository/Trash");
286 
287  $tpl->setVariable("TXT_INTRO", $lng->txt("rep_multiple_reference_deletion_intro"));
288 
289  if ($may_delete_any) {
290  $tpl->setVariable("TXT_INSTRUCTION", $lng->txt("rep_multiple_reference_deletion_instruction"));
291  }
292 
293  if ($items) {
294  $var_name = "mref_id[]";
295 
296  foreach ($items as $item) {
297  if ($item["delete"]) {
298  $tpl->setCurrentBlock("cbox");
299  $tpl->setVariable("ITEM_NAME", $var_name);
300  $tpl->setVariable("ITEM_VALUE", $item["id"]);
301  } else {
302  $tpl->setCurrentBlock("item_info");
303  $tpl->setVariable("TXT_ITEM_INFO", $lng->txt("rep_no_permission_to_delete"));
304  }
306 
307  $tpl->setCurrentBlock("item");
308  $tpl->setVariable("ITEM_TITLE", $item["path"]);
310  }
311 
312  if ($may_delete_any > 1) {
313  $tpl->setCurrentBlock("cbox");
314  $tpl->setVariable("ITEM_NAME", "sall_" . $a_ref_id);
315  $tpl->setVariable("ITEM_VALUE", "");
316  $tpl->setVariable("ITEM_ADD", " onclick=\"il.Util.setChecked('" .
317  $a_form_name . "', '" . $var_name . "', document." . $a_form_name .
318  ".sall_" . $a_ref_id . ".checked)\"");
320 
321  $tpl->setCurrentBlock("item");
322  $tpl->setVariable("ITEM_TITLE", $lng->txt("select_all"));
324  }
325  }
326 
327  if ($counter) {
328  $tpl->setCurrentBlock("add_info");
329  $tpl->setVariable(
330  "TXT_ADDITIONAL_INFO",
331  sprintf($lng->txt("rep_object_references_cannot_be_read"), $counter)
332  );
334  }
335  return $tpl->get();
336  }
337  return "";
338  }
buildPath(array $ref_ids)
Build path with deep-link.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _getAllReferences(int $id)
get all reference ids for object ID
isDeleted(int $a_node_id)
This is a wrapper for isSaved() with a more useful name.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
loadLanguageModule(string $a_module)
Load language module.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
$path
Definition: ltiservices.php:32
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
ilGlobalTemplateInterface $tpl
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormTrashTargetLocation()

ilRepositoryTrashGUI::initFormTrashTargetLocation ( )
protected

Definition at line 136 of file class.ilRepositoryTrashGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ROOT_FOLDER_ID, ilFormPropertyGUI\setRequired(), and ilExplorerBaseGUI\setSelectMode().

Referenced by doRestoreToNewLocation(), executeCommand(), and restoreToNewLocation().

137  {
138  $form = new ilPropertyFormGUI();
139  $form->setFormAction($this->ctrl->getFormAction($this));
140 
141  $target = new ilRepositorySelector2InputGUI(
142  $this->lng->txt('rep_target_location'),
143  'target_id',
144  false
145  );
146  $target->setRequired(true);
147 
148  $explorer = new ilRepositorySelectorExplorerGUI(
149  [
150  ilAdministrationGUI::class,
151  get_class($this->parent_gui),
152  self::class,
153  ilPropertyFormGUI::class,
154  ilFormPropertyDispatchGUI::class,
155  ilRepositorySelector2InputGUI::class
156  ],
157  'handleExplorerCommand',
158  $target,
159  'root_id',
160  'rep_exp_sel_' . $target->getPostVar()
161  );
162  $explorer->setSelectMode($target->getPostVar() . "_sel", false);
163  $explorer->setRootId(ROOT_FOLDER_ID);
164  $explorer->setTypeWhiteList(['root','cat','crs','grp','fold']);
165  $target->setExplorerGUI($explorer);
166 
167  $form->addItem($target);
168  $form->addCommandButton('doRestoreToNewLocation', $this->lng->txt('btn_undelete'));
169  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
170 
171  return $form;
172  }
Explorer for selecting repository items.
const ROOT_FOLDER_ID
Definition: constants.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRequired(bool $a_required)
setSelectMode(string $a_postvar, bool $a_multi=false)
Set select mode (to deactivate, pass an empty string as postvar)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeObjectsFromSystem()

ilRepositoryTrashGUI::removeObjectsFromSystem ( array  $a_ref_ids,
bool  $a_from_recovery_folder = false 
)

Definition at line 429 of file class.ilRepositoryTrashGUI.php.

References Vendor\Package\$e, $lng, ilRepUtil\removeObjectsFromSystem(), and ilLanguage\txt().

432  : bool {
433  $lng = $this->lng;
434 
435  if (!is_array($a_ref_ids) || count($a_ref_ids) === 0) {
436  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
437  return false;
438  }
439 
440  try {
441  ilRepUtil::removeObjectsFromSystem($a_ref_ids, $a_from_recovery_folder);
442  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_removed"), true);
443  } catch (Exception $e) {
444  // alex: I outcommented this, since it makes tracking down errors impossible
445  // we need a call stack at least in the logs
446  //$this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
447  throw $e;
448  return false;
449  }
450 
451  return true;
452  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static removeObjectsFromSystem(array $a_ref_ids, bool $a_from_recovery_folder=false)
remove objects from trash bin and all entries therefore every object needs a specific deleteObject() ...
+ Here is the call graph for this function:

◆ restoreObjects()

ilRepositoryTrashGUI::restoreObjects ( int  $a_cur_ref_id,
array  $a_ref_ids 
)

Restore objects from trash.

Parameters
int$a_cur_ref_id
int[]$a_ref_ids array of ref ids to be restored
Returns
bool

Definition at line 365 of file class.ilRepositoryTrashGUI.php.

References Vendor\Package\$e, $lng, $target_id, ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ilRepUtil\restoreObjects(), and ilLanguage\txt().

368  : bool {
369  $lng = $this->lng;
370  $lng->loadLanguageModule('rep');
371 
372  if (!is_array($a_ref_ids) || count($a_ref_ids) === 0) {
373  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
374  return false;
375  }
376 
377  $tree_trash_queries = new ilTreeTrashQueries();
378  if ($tree_trash_queries->isTrashedTrash($a_ref_ids)) {
379  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('rep_failure_trashed_trash'), true);
380  return false;
381  }
382  try {
383 
384  // find parent foreach node
385  $by_location = [];
386  foreach ($a_ref_ids as $deleted_node_id) {
387  $target_id = $tree_trash_queries->findRepositoryLocationForDeletedNode($deleted_node_id);
388  if ($target_id) {
389  $by_location[$target_id][] = $deleted_node_id;
390  }
391  }
392  foreach ($by_location as $target_id => $deleted_node_ids) {
393  ilRepUtil::restoreObjects($target_id, $deleted_node_ids);
394  }
395  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_undeleted"), true);
396  } catch (Exception $e) {
397  $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
398  return false;
399  }
400  return true;
401  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$target_id
Definition: goto.php:52
loadLanguageModule(string $a_module)
Load language module.
static restoreObjects(int $a_cur_ref_id, array $a_ref_ids)
Move objects from trash back to repository.
+ Here is the call graph for this function:

◆ restoreToNewLocation()

ilRepositoryTrashGUI::restoreToNewLocation ( ilPropertyFormGUI  $form = null)

Definition at line 90 of file class.ilRepositoryTrashGUI.php.

References ILIAS\Repository\ctrl(), initFormTrashTargetLocation(), and ILIAS\Repository\lng().

92  : void {
93  $this->lng->loadLanguageModule('rep');
94 
95  $trash_ids = $this->request->getTrashIds();
96 
97  $this->ctrl->setParameter($this, 'trash_ids', implode(',', $trash_ids));
98 
99  if (!count($trash_ids)) {
100  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
101  $this->ctrl->returnToParent($this);
102  }
103 
104  if (!$form instanceof ilPropertyFormGUI) {
105  $form = $this->initFormTrashTargetLocation();
106  }
107  $this->tpl->setOnScreenMessage('info', $this->lng->txt('rep_target_location_info'));
108  $this->tpl->setContent($form->getHTML());
109  }
+ Here is the call graph for this function:

◆ showDeleteConfirmation()

ilRepositoryTrashGUI::showDeleteConfirmation ( ?array  $a_ids,
bool  $a_supress_message = false 
)

Definition at line 174 of file class.ilRepositoryTrashGUI.php.

References $ctrl, $ilSetting, $lng, $obj_definition, $ref_id, $settings, $tpl, $type, ilObject\_getIcon(), ilObject\_lookupObjId(), ilObject\_lookupType(), ilObject\collectDeletionDependencies(), ilObjectFactory\getClassByType(), handleMultiReferences(), ilObjectPlugin\lookupTxtById(), ilGlobalTemplateInterface\setContent(), ilUtil\stripSlashes(), and ilLanguage\txt().

177  : bool {
178  $lng = $this->lng;
180  $ilCtrl = $this->ctrl;
181  $tpl = $this->tpl;
182  $objDefinition = $this->obj_definition;
183 
184  if (!is_array($a_ids) || count($a_ids) === 0) {
185  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
186  return false;
187  }
188 
189  // Remove duplicate entries
190  $a_ids = array_unique($a_ids);
191 
192  $cgui = new ilConfirmationGUI();
193 
194  if (!$a_supress_message) {
195  $msg = $lng->txt("info_delete_sure");
196 
197  if (!$ilSetting->get('enable_trash')) {
198  $msg .= "<br/>" . $lng->txt("info_delete_warning_no_trash");
199  }
200 
201  $cgui->setHeaderText($msg);
202  }
203  $cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui));
204  $cgui->setCancel($lng->txt("cancel"), "cancelDelete");
205  $cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
206 
207  $form_name = "cgui_" . md5(uniqid('', true));
208  $cgui->setFormName($form_name);
209 
210  $deps = [];
211  foreach ($a_ids as $ref_id) {
212  $obj_id = ilObject::_lookupObjId($ref_id);
213  $type = ilObject::_lookupType($obj_id);
214  $title = call_user_func([ilObjectFactory::getClassByType($type), '_lookupTitle'], $obj_id);
215  $alt = ($objDefinition->isPlugin($type))
216  ? $lng->txt("icon") . " " . ilObjectPlugin::lookupTxtById($type, "obj_" . $type)
217  : $lng->txt("icon") . " " . $lng->txt("obj_" . $type);
218 
219  $cgui->addItem(
220  "id[]",
221  $ref_id,
222  ilUtil::stripSlashes($title) .
223  $this->handleMultiReferences($obj_id, $ref_id, $form_name),
224  ilObject::_getIcon($obj_id, "small", $type),
225  $alt
226  );
227 
228  ilObject::collectDeletionDependencies($deps, $ref_id, $obj_id, $type);
229  }
230  $deps_html = "";
231 
232  if (is_array($deps) && count($deps) > 0) {
233  $tab = new ilRepDependenciesTableGUI($deps);
234  $deps_html = "<br/><br/>" . $tab->getHTML();
235  }
236 
237  $tpl->setContent($cgui->getHTML() . $deps_html);
238  return true;
239  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$type
static collectDeletionDependencies(array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
Collect deletion dependencies.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static _lookupObjId(int $ref_id)
handleMultiReferences(int $a_obj_id, int $a_ref_id, string $a_form_name)
$ref_id
Definition: ltiauth.php:67
setContent(string $a_html)
Sets content for standard template.
ilObjectDefinition $obj_definition
static lookupTxtById(string $plugin_id, string $lang_var)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getClassByType(string $obj_type)
global $ilSetting
Definition: privfeed.php:17
ilGlobalTemplateInterface $tpl
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ showTrashTable()

ilRepositoryTrashGUI::showTrashTable ( int  $a_ref_id)

Definition at line 340 of file class.ilRepositoryTrashGUI.php.

References $lng, $tpl, $tree, ilTree\getSavedNodeData(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

342  : void {
343  $tpl = $this->tpl;
344  $tree = $this->tree;
345  $lng = $this->lng;
346 
347  $objects = $tree->getSavedNodeData($a_ref_id);
348 
349  if (count($objects) === 0) {
350  $this->tpl->setOnScreenMessage('info', $lng->txt("msg_trash_empty"));
351  return;
352  }
353  $ttab = new ilTrashTableGUI($this->parent_gui, "trash", $a_ref_id);
354  $ttab->setData($objects);
355 
356  $tpl->setContent($ttab->getHTML());
357  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
getSavedNodeData(int $a_parent_id)
get data saved/deleted nodes
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilRepositoryTrashGUI::$access
protected

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

Referenced by handleMultiReferences().

◆ $ctrl

ilCtrl ilRepositoryTrashGUI::$ctrl
protected

◆ $lng

◆ $logger

ilLogger ilRepositoryTrashGUI::$logger = null
protected

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

◆ $obj_definition

ilObjectDefinition ilRepositoryTrashGUI::$obj_definition
protected

◆ $parent_cmd

string ilRepositoryTrashGUI::$parent_cmd
protected

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

◆ $parent_gui

object ilRepositoryTrashGUI::$parent_gui
protected

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

◆ $request

TrashGUIRequest ilRepositoryTrashGUI::$request
protected

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

◆ $settings

ilSetting ilRepositoryTrashGUI::$settings
protected

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

Referenced by deleteObjects(), and showDeleteConfirmation().

◆ $tpl

ilGlobalTemplateInterface ilRepositoryTrashGUI::$tpl
protected

◆ $tree

ilTree ilRepositoryTrashGUI::$tree
protected

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

Referenced by buildPath(), handleMultiReferences(), and showTrashTable().


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