43 string $a_parent_cmd =
""
48 $this->
lng = $DIC->language();
50 $this->
ctrl = $DIC->ctrl();
51 $this->tpl =
$DIC[
"tpl"];
52 $this->obj_definition =
$DIC[
"objDefinition"];
53 $this->
access = $DIC->access();
54 $this->tree =
$DIC->repositoryTree();
55 $this->parent_gui = $a_parent_gui;
56 $this->parent_cmd = $a_parent_cmd;
58 $this->
logger = $DIC->logger()->rep();
59 $this->request =
$DIC->repository()
71 $next_class = $this->
ctrl->getNextClass($this);
72 switch ($next_class) {
73 case "ilpropertyformgui":
75 $this->
ctrl->forwardCommand($form);
79 $cmd = $this->
ctrl->getCmd(
'cancel');
87 $this->
ctrl->returnToParent($this);
93 $this->
lng->loadLanguageModule(
'rep');
95 $trash_ids = $this->request->getTrashIds();
97 $this->
ctrl->setParameter($this,
'trash_ids', implode(
',', $trash_ids));
99 if (!count($trash_ids)) {
100 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
101 $this->
ctrl->returnToParent($this);
107 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'rep_target_location_info'));
108 $this->tpl->setContent($form->getHTML());
117 $trash_ids = $this->request->getTrashIds();
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);
128 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_undeleted'),
true);
129 $this->
ctrl->returnToParent($this);
131 $this->tpl->setOnScreenMessage(
'failure',
$e->getMessage(),
true);
132 $this->
ctrl->returnToParent($this);
139 $form->setFormAction($this->
ctrl->getFormAction($this));
142 $this->
lng->txt(
'rep_target_location'),
146 $target->setRequired(
true);
150 ilAdministrationGUI::class,
151 get_class($this->parent_gui),
153 ilPropertyFormGUI::class,
154 ilFormPropertyDispatchGUI::class,
155 ilRepositorySelector2InputGUI::class
157 'handleExplorerCommand',
160 'rep_exp_sel_' . $target->getPostVar()
162 $explorer->setSelectMode($target->getPostVar() .
"_sel",
false);
164 $explorer->setTypeWhiteList([
'root',
'cat',
'crs',
'grp',
'fold']);
165 $target->setExplorerGUI($explorer);
167 $form->addItem($target);
168 $form->addCommandButton(
'doRestoreToNewLocation', $this->
lng->txt(
'btn_undelete'));
169 $form->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
176 bool $a_supress_message =
false
180 $ilCtrl = $this->ctrl;
182 $objDefinition = $this->obj_definition;
184 if (!is_array($a_ids) || count($a_ids) === 0) {
185 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"no_checkbox"),
true);
190 $a_ids = array_unique($a_ids);
194 if (!$a_supress_message) {
195 $msg =
$lng->txt(
"info_delete_sure");
198 $msg .=
"<br/>" .
$lng->txt(
"info_delete_warning_no_trash");
201 $cgui->setHeaderText($msg);
203 $cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui));
204 $cgui->setCancel(
$lng->txt(
"cancel"),
"cancelDelete");
205 $cgui->setConfirm(
$lng->txt(
"confirm"),
"confirmedDelete");
207 $form_name =
"cgui_" . md5(uniqid(
'',
true));
208 $cgui->setFormName($form_name);
215 $alt = ($objDefinition->isPlugin(
$type))
223 $this->handleMultiReferences($obj_id,
$ref_id, $form_name),
232 if (is_array($deps) && count($deps) > 0) {
234 $deps_html =
"<br/><br/>" . $tab->getHTML();
237 $tpl->setContent($cgui->getHTML() . $deps_html);
248 $ilAccess = $this->access;
254 if (count($all_refs) > 1) {
255 $lng->loadLanguageModule(
"rep");
260 foreach ($all_refs as $mref_id) {
262 if ($mref_id != $a_ref_id && !$tree->
isDeleted($mref_id)) {
263 if ($ilAccess->checkAccess(
"read",
"", $mref_id)) {
265 if ($ilAccess->checkAccess(
"delete",
"", $mref_id)) {
270 $path = $this->buildPath([$mref_id]);
273 "path" => array_shift(
$path),
274 "delete" => $may_delete
285 $tpl =
new ilTemplate(
"tpl.rep_multi_ref.html",
true,
true,
"Services/Repository/Trash");
287 $tpl->setVariable(
"TXT_INTRO",
$lng->txt(
"rep_multiple_reference_deletion_intro"));
289 if ($may_delete_any) {
290 $tpl->setVariable(
"TXT_INSTRUCTION",
$lng->txt(
"rep_multiple_reference_deletion_instruction"));
294 $var_name =
"mref_id[]";
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"]);
302 $tpl->setCurrentBlock(
"item_info");
303 $tpl->setVariable(
"TXT_ITEM_INFO",
$lng->txt(
"rep_no_permission_to_delete"));
305 $tpl->parseCurrentBlock();
307 $tpl->setCurrentBlock(
"item");
308 $tpl->setVariable(
"ITEM_TITLE", $item[
"path"]);
309 $tpl->parseCurrentBlock();
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)\"");
319 $tpl->parseCurrentBlock();
321 $tpl->setCurrentBlock(
"item");
322 $tpl->setVariable(
"ITEM_TITLE",
$lng->txt(
"select_all"));
323 $tpl->parseCurrentBlock();
328 $tpl->setCurrentBlock(
"add_info");
330 "TXT_ADDITIONAL_INFO",
331 sprintf(
$lng->txt(
"rep_object_references_cannot_be_read"), $counter)
333 $tpl->parseCurrentBlock();
349 if (count($objects) === 0) {
350 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"msg_trash_empty"));
354 $ttab->setData($objects);
356 $tpl->setContent($ttab->getHTML());
370 $lng->loadLanguageModule(
'rep');
372 if (!is_array($a_ref_ids) || count($a_ref_ids) === 0) {
373 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"no_checkbox"),
true);
378 if ($tree_trash_queries->isTrashedTrash($a_ref_ids)) {
379 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'rep_failure_trashed_trash'),
true);
386 foreach ($a_ref_ids as $deleted_node_id) {
387 $target_id = $tree_trash_queries->findRepositoryLocationForDeletedNode($deleted_node_id);
389 $by_location[
$target_id][] = $deleted_node_id;
392 foreach ($by_location as
$target_id => $deleted_node_ids) {
395 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_undeleted"),
true);
396 }
catch (Exception
$e) {
397 $this->tpl->setOnScreenMessage(
'failure',
$e->getMessage(),
true);
410 if (!is_array($a_ref_ids) || count($a_ref_ids) === 0) {
411 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"no_checkbox"),
true);
416 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"info_deleted"),
true);
418 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_removed"),
true);
420 }
catch (Exception
$e) {
431 bool $a_from_recovery_folder =
false
435 if (!is_array($a_ref_ids) || count($a_ref_ids) === 0) {
436 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"no_checkbox"),
true);
442 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_removed"),
true);
443 }
catch (Exception
$e) {
461 if (!count($ref_ids)) {
466 foreach ($ref_ids as
$ref_id) {
469 foreach ($path_full as $idx =>
$data) {
471 $path .=
" » ";
476 $path .= (
'<a target="_top" href="' .
495 $ilCtrl = $this->
ctrl;
497 $objDefinition = $this->obj_definition;
500 if (!is_array($a_ids)) {
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"));
511 foreach ($a_ids as
$id) {
515 $alt = ($objDefinition->isPlugin(
$type))
528 $tpl->setContent($cgui->getHTML());
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
static _getLink(?int $a_ref_id, string $a_type='', array $a_params=array(), string $append="")
Component logger with individual log levels by component id.
parses the objects.xml it handles the xml-description of all ilias objects
static getClassByType(string $obj_type)
Class ilObjectGUI Basic methods of all Output classes.
static lookupTxtById(string $plugin_id, string $lang_var)
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 _getAllReferences(int $id)
get all reference ids for object ID
static collectDeletionDependencies(array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
Collect deletion dependencies.
static _lookupObjId(int $ref_id)
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.
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() ...
static deleteObjects(int $a_cur_ref_id, array $a_ids, bool $throw_error_on_already_deleted=true)
Delete objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Explorer for selecting repository items.
Repository GUI Utilities.
handleMultiReferences(int $a_obj_id, int $a_ref_id, string $a_form_name)
restoreToNewLocation(ilPropertyFormGUI $form=null)
ilObjectDefinition $obj_definition
restoreObjects(int $a_cur_ref_id, array $a_ref_ids)
Restore objects from trash.
showTrashTable(int $a_ref_id)
buildPath(array $ref_ids)
Build path with deep-link.
ilGlobalTemplateInterface $tpl
deleteObjects(int $a_cur_ref_id, array $a_ref_ids)
initFormTrashTargetLocation()
confirmRemoveFromSystemObject(array $a_ids)
Confirmation for trash.
showDeleteConfirmation(?array $a_ids, bool $a_supress_message=false)
removeObjectsFromSystem(array $a_ref_ids, bool $a_from_recovery_folder=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
isDeleted(int $a_node_id)
This is a wrapper for isSaved() with a more useful name.
getSavedNodeData(int $a_parent_id)
get data saved/deleted nodes
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc