3 require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
56 public function __construct($a_parent_gui, $a_parent_cmd =
"")
60 $this->lng = $DIC->language();
62 $this->ctrl = $DIC->ctrl();
63 $this->tpl = $DIC[
"tpl"];
64 $this->obj_definition = $DIC[
"objDefinition"];
65 $this->access = $DIC->access();
66 $this->tree = $DIC->repositoryTree();
67 $this->parent_gui = $a_parent_gui;
68 $this->parent_cmd = $a_parent_cmd;
83 if (!is_array($a_ids) || count($a_ids) == 0) {
89 $a_ids = array_unique((array) $a_ids);
91 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
94 if (!$a_supress_message) {
95 $msg =
$lng->txt(
"info_delete_sure");
98 $msg .=
"<br/>" .
$lng->txt(
"info_delete_warning_no_trash");
101 $cgui->setHeaderText($msg);
103 $cgui->setFormAction(
$ilCtrl->getFormAction($this->parent_gui));
104 $cgui->setCancel(
$lng->txt(
"cancel"),
"cancelDelete");
105 $cgui->setConfirm(
$lng->txt(
"confirm"),
"confirmedDelete");
107 $form_name =
"cgui_" . md5(uniqid());
108 $cgui->setFormName($form_name);
111 foreach ($a_ids as $ref_id) {
115 $alt = ($objDefinition->isPlugin(
$type))
125 ilObject::_getIcon($obj_id,
"small",
$type),
133 if (is_array($deps) && count($deps) > 0) {
134 include_once(
"./Services/Repository/classes/class.ilRepDependenciesTableGUI.php");
136 $deps_html =
"<br/><br/>" .
$tab->getHTML();
139 $tpl->setContent($cgui->getHTML() . $deps_html);
160 if (
sizeof($all_refs) > 1) {
161 $lng->loadLanguageModule(
"rep");
166 foreach ($all_refs as $mref_id) {
168 if ($mref_id != $a_ref_id && !
$tree->isDeleted($mref_id)) {
169 if ($ilAccess->checkAccess(
"read",
"", $mref_id)) {
171 if ($ilAccess->checkAccess(
"delete",
"", $mref_id)) {
176 $items[] = array(
"id" => $mref_id,
177 "path" => array_shift($this->
buildPath(array($mref_id))),
178 "delete" => $may_delete);
188 $tpl =
new ilTemplate(
"tpl.rep_multi_ref.html",
true,
true,
"Services/Repository");
190 $tpl->setVariable(
"TXT_INTRO",
$lng->txt(
"rep_multiple_reference_deletion_intro"));
192 if ($may_delete_any) {
193 $tpl->setVariable(
"TXT_INSTRUCTION",
$lng->txt(
"rep_multiple_reference_deletion_instruction"));
197 $var_name =
"mref_id[]";
199 foreach ($items as $item) {
200 if ($item[
"delete"]) {
201 $tpl->setCurrentBlock(
"cbox");
202 $tpl->setVariable(
"ITEM_NAME", $var_name);
203 $tpl->setVariable(
"ITEM_VALUE", $item[
"id"]);
204 $tpl->parseCurrentBlock();
206 $tpl->setCurrentBlock(
"item_info");
207 $tpl->setVariable(
"TXT_ITEM_INFO",
$lng->txt(
"rep_no_permission_to_delete"));
208 $tpl->parseCurrentBlock();
211 $tpl->setCurrentBlock(
"item");
212 $tpl->setVariable(
"ITEM_TITLE", $item[
"path"]);
213 $tpl->parseCurrentBlock();
216 if ($may_delete_any > 1) {
217 $tpl->setCurrentBlock(
"cbox");
218 $tpl->setVariable(
"ITEM_NAME",
"sall_" . $a_ref_id);
219 $tpl->setVariable(
"ITEM_VALUE",
"");
220 $tpl->setVariable(
"ITEM_ADD",
" onclick=\"il.Util.setChecked('" .
221 $a_form_name .
"', '" . $var_name .
"', document." . $a_form_name .
222 ".sall_" . $a_ref_id .
".checked)\"");
223 $tpl->parseCurrentBlock();
225 $tpl->setCurrentBlock(
"item");
226 $tpl->setVariable(
"ITEM_TITLE",
$lng->txt(
"select_all"));
227 $tpl->parseCurrentBlock();
232 $tpl->setCurrentBlock(
"add_info");
234 "TXT_ADDITIONAL_INFO",
235 sprintf(
$lng->txt(
"rep_object_references_cannot_be_read"), $counter)
237 $tpl->parseCurrentBlock();
255 $objects =
$tree->getSavedNodeData($a_ref_id);
257 if (count($objects) == 0) {
261 include_once(
"./Services/Repository/classes/class.ilTrashTableGUI.php");
263 $ttab->setData($objects);
265 $tpl->setContent($ttab->getHTML());
278 if (!is_array($a_ref_ids) || count($a_ref_ids) == 0) {
283 include_once(
"./Services/Repository/classes/class.ilRepUtil.php");
285 ilUtil::sendSuccess(
$lng->txt(
"msg_undeleted"),
true);
302 if (!is_array($a_ref_ids) || count($a_ref_ids) == 0) {
306 include_once(
"./Services/Repository/classes/class.ilRepUtil.php");
310 ilUtil::sendSuccess(
$lng->txt(
"info_deleted"),
true);
312 ilUtil::sendSuccess(
$lng->txt(
"msg_removed"),
true);
328 if (!is_array($a_ref_ids) || count($a_ref_ids) == 0) {
332 include_once(
"./Services/Repository/classes/class.ilRepUtil.php");
335 ilUtil::sendSuccess(
$lng->txt(
"msg_removed"),
true);
355 include_once
'Services/Link/classes/class.ilLink.php';
357 if (!count($ref_ids)) {
362 foreach ($ref_ids as $ref_id) {
364 $path_full =
$tree->getPathFull($ref_id);
365 foreach ($path_full as $idx =>
$data) {
367 $path .=
" » ";
369 if ($ref_id !=
$data[
'ref_id']) {
372 $path .= (
'<a target="_top" href="' .
374 $data[
'title'] .
'</a>');
394 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
396 if (!is_array($a_ids)) {
397 $a_ids = array($a_ids);
401 $cgui->setFormAction(
$ilCtrl->getFormAction($this->parent_gui));
402 $cgui->setCancel(
$lng->txt(
"cancel"),
"trash");
403 $cgui->setConfirm(
$lng->txt(
"confirm"),
"removeFromSystem");
404 $cgui->setFormName(
"trash_confirmation");
405 $cgui->setHeaderText(
$lng->txt(
"info_delete_sure"));
407 foreach ($a_ids as
$id) {
411 $alt = ($objDefinition->isPlugin(
$type))
419 ilObject::_getIcon($obj_id,
"small",
$type),
424 $tpl->setContent($cgui->getHTML());
static getClassByType($a_obj_type)
Get class by type.
static lookupTxtById($plugin_id, $lang_var)
removeObjectsFromSystem($a_ref_ids, $a_from_recovery_folder=false)
Remove objects from system.
if(!array_key_exists('StateId', $_REQUEST)) $id
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.
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() ...