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();
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'),
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 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))
217 : $lng->
txt(
"icon") .
" " . $lng->
txt(
"obj_" .
$type);
232 if (is_array($deps) && count($deps) > 0) {
234 $deps_html =
"<br/><br/>" . $tab->getHTML();
237 $tpl->
setContent($cgui->getHTML() . $deps_html);
254 if (count($all_refs) > 1) {
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)) {
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"]) {
303 $tpl->
setVariable(
"TXT_ITEM_INFO", $lng->
txt(
"rep_no_permission_to_delete"));
312 if ($may_delete_any > 1) {
314 $tpl->
setVariable(
"ITEM_NAME",
"sall_" . $a_ref_id);
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)\"");
330 "TXT_ADDITIONAL_INFO",
331 sprintf($lng->
txt(
"rep_object_references_cannot_be_read"), $counter)
349 if (count($objects) === 0) {
350 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"msg_trash_empty"));
354 $ttab->setData($objects);
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);
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);
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);
461 if (!count($ref_ids)) {
466 foreach ($ref_ids as
$ref_id) {
469 foreach ($path_full as $idx =>
$data) {
471 $path .=
" » ";
473 if ((
int) $ref_id !== (
int)
$data[
'ref_id']) {
476 $path .= (
'<a target="_top" href="' .
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))
517 : $lng->
txt(
"icon") .
" " . $lng->
txt(
"obj_" .
$type);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
buildPath(array $ref_ids)
Build path with deep-link.
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
Explorer for selecting repository items.
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 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 _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.
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...
static _lookupObjId(int $ref_id)
deleteObjects(int $a_cur_ref_id, array $a_ref_ids)
handleMultiReferences(int $a_obj_id, int $a_ref_id, string $a_form_name)
removeObjectsFromSystem(array $a_ref_ids, bool $a_from_recovery_folder=false)
parses the objects.xml it handles the xml-description of all ilias objects
setContent(string $a_html)
Sets content for standard template.
showTrashTable(int $a_ref_id)
restoreToNewLocation(ilPropertyFormGUI $form=null)
getSavedNodeData(int $a_parent_id)
get data saved/deleted nodes
Class ilObjectGUI Basic methods of all Output classes.
static restoreObjects(int $a_cur_ref_id, array $a_ref_ids)
Move objects from trash back to repository.
Repository GUI Utilities.
showDeleteConfirmation(?array $a_ids, bool $a_supress_message=false)
static _getLink(?int $a_ref_id, string $a_type='', array $a_params=array(), string $append="")
ilObjectDefinition $obj_definition
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() ...
restoreObjects(int $a_cur_ref_id, array $a_ref_ids)
Restore objects from trash.
static lookupTxtById(string $plugin_id, string $lang_var)
setSelectMode(string $a_postvar, bool $a_multi=false)
Set select mode (to deactivate, pass an empty string as postvar)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getClassByType(string $obj_type)
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
__construct(Container $dic, ilPlugin $plugin)
initFormTrashTargetLocation()
confirmRemoveFromSystemObject(array $a_ids)
Confirmation for trash.
ilGlobalTemplateInterface $tpl
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
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...