3 require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
23 $this->parent_gui = $a_parent_gui;
24 $this->parent_cmd = $a_parent_cmd;
35 if (!is_array($a_ids) || count($a_ids) == 0)
42 $a_ids = array_unique((
array) $a_ids);
44 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
47 if(!$a_supress_message)
49 $msg = $lng->txt(
"info_delete_sure");
51 if (!$ilSetting->get(
'enable_trash'))
53 $msg .=
"<br/>".$lng->txt(
"info_delete_warning_no_trash");
56 $cgui->setHeaderText($msg);
58 $cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui));
59 $cgui->setCancel($lng->txt(
"cancel"),
"cancelDelete");
60 $cgui->setConfirm($lng->txt(
"confirm"),
"confirmedDelete");
62 $form_name =
"cgui_".md5(uniqid());
63 $cgui->setFormName($form_name);
71 $alt = ($objDefinition->isPlugin($type))
73 : $lng->txt(
"icon").
" ".$lng->txt(
"obj_".$type);
77 $cgui->addItem(
"id[]", $ref_id,
$title,
85 if (is_array($deps) && count($deps) > 0)
87 include_once(
"./Services/Repository/classes/class.ilRepDependenciesTableGUI.php");
89 $deps_html =
"<br/><br/>".$tab->getHTML();
92 $tpl->setContent($cgui->getHTML().$deps_html);
106 global
$lng, $ilAccess, $tree;
111 if(
sizeof($all_refs) > 1)
113 $lng->loadLanguageModule(
"rep");
118 foreach($all_refs as $mref_id)
121 if($mref_id != $a_ref_id && !$tree->isDeleted($mref_id))
123 if($ilAccess->checkAccess(
"read",
"", $mref_id))
126 if($ilAccess->checkAccess(
"delete",
"", $mref_id))
132 $items[] =
array(
"id" => $mref_id,
134 "delete" => $may_delete);
146 $tpl =
new ilTemplate(
"tpl.rep_multi_ref.html",
true,
true,
"Services/Repository");
148 $tpl->setVariable(
"TXT_INTRO", $lng->txt(
"rep_multiple_reference_deletion_intro"));
152 $tpl->setVariable(
"TXT_INSTRUCTION", $lng->txt(
"rep_multiple_reference_deletion_instruction"));
157 $var_name =
"mref_id[]";
159 foreach($items as $item)
163 $tpl->setCurrentBlock(
"cbox");
164 $tpl->setVariable(
"ITEM_NAME", $var_name);
165 $tpl->setVariable(
"ITEM_VALUE", $item[
"id"]);
166 $tpl->parseCurrentBlock();
170 $tpl->setCurrentBlock(
"item_info");
171 $tpl->setVariable(
"TXT_ITEM_INFO", $lng->txt(
"rep_no_permission_to_delete"));
172 $tpl->parseCurrentBlock();
175 $tpl->setCurrentBlock(
"item");
176 $tpl->setVariable(
"ITEM_TITLE", $item[
"path"]);
177 $tpl->parseCurrentBlock();
180 if($may_delete_any > 1)
182 $tpl->setCurrentBlock(
"cbox");
183 $tpl->setVariable(
"ITEM_NAME",
"sall_".$a_ref_id);
184 $tpl->setVariable(
"ITEM_VALUE",
"");
185 $tpl->setVariable(
"ITEM_ADD",
" onclick=\"il.Util.setChecked('".
186 $a_form_name.
"', '".$var_name.
"', document.".$a_form_name.
187 ".sall_".$a_ref_id.
".checked)\"");
188 $tpl->parseCurrentBlock();
190 $tpl->setCurrentBlock(
"item");
191 $tpl->setVariable(
"ITEM_TITLE", $lng->txt(
"select_all"));
192 $tpl->parseCurrentBlock();
198 $tpl->setCurrentBlock(
"add_info");
199 $tpl->setVariable(
"TXT_ADDITIONAL_INFO",
200 sprintf($lng->txt(
"rep_object_references_cannot_be_read"),
$counter));
201 $tpl->parseCurrentBlock();
217 $objects = $tree->getSavedNodeData($a_ref_id);
219 if (count($objects) == 0)
224 include_once(
"./Services/Repository/classes/class.ilTrashTableGUI.php");
226 $ttab->setData($objects);
228 $tpl->setContent($ttab->getHTML());
241 if (!is_array($a_ref_ids) || count($a_ref_ids) == 0)
250 include_once(
"./Services/Repository/classes/class.ilRepUtil.php");
270 if (!is_array($a_ref_ids) || count($a_ref_ids) == 0)
277 include_once(
"./Services/Repository/classes/class.ilRepUtil.php");
281 if ($ilSetting->get(
'enable_trash'))
305 if (!is_array($a_ref_ids) || count($a_ref_ids) == 0)
312 include_once(
"./Services/Repository/classes/class.ilRepUtil.php");
338 include_once
'Services/Link/classes/class.ilLink.php';
349 $path_full = $tree->getPathFull($ref_id);
350 foreach($path_full as $idx =>
$data)
354 $path .=
" » ";
356 if($ref_id !=
$data[
'ref_id'])
362 $path .= (
'<a target="_top" href="'.
364 $data[
'title'].
'</a>');
382 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
384 if(!is_array($a_ids))
386 $a_ids =
array($a_ids);
390 $cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui));
391 $cgui->setCancel($lng->txt(
"cancel"),
"trash");
392 $cgui->setConfirm($lng->txt(
"confirm"),
"removeFromSystem");
393 $cgui->setFormName(
"trash_confirmation");
394 $cgui->setHeaderText($lng->txt(
"info_delete_sure"));
396 foreach($a_ids as $id)
401 $alt = ($objDefinition->isPlugin($type))
403 : $lng->txt(
"icon").
" ".$lng->txt(
"obj_".$type);
405 $cgui->addItem(
"trash_id[]", $id,
$title,
410 $tpl->setContent($cgui->getHTML());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getClassByType($a_obj_type)
Get class by type.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static lookupTxtById($plugin_id, $lang_var)
removeObjectsFromSystem($a_ref_ids, $a_from_recovery_folder=false)
Remove objects from system.
showTrashTable($a_ref_id)
Get trashed objects for a container.
deleteObjects($a_cur_ref_id, $a_ref_ids)
Delete objects.
static restoreObjects($a_cur_ref_id, $a_ref_ids)
Move objects from trash back to repository.
static _getAllReferences($a_id)
get all reference ids of object
static collectDeletionDependencies(&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
Collect deletion dependencies.
__construct($a_parent_gui, $a_parent_cmd="")
Constructor.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
Repository GUI Utilities.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
showDeleteConfirmation($a_ids, $a_supress_message=false)
Show delete confirmation table.
confirmRemoveFromSystemObject($a_ids)
Confirmation for trash.
buildPath($ref_ids)
Build path with deep-link.
handleMultiReferences($a_obj_id, $a_ref_id, $a_form_name)
Build subitem list for multiple references.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
restoreObjects($a_cur_ref_id, $a_ref_ids)
Restore objects from trash.
Confirmation screen class.
static deleteObjects($a_cur_ref_id, $a_ids)
Delete objects.
static removeObjectsFromSystem($a_ref_ids, $a_from_recovery_folder=false)
remove objects from trash bin and all entries therefore every object needs a specific deleteObject() ...