/** * confirm deletion screen for page object and structure object deletion * * @param int $a_parent_subobj_id id of parent object (structure object) * of the objects, that should be deleted * (or no parent object id for top level) */ function delete($a_parent_subobj_id = 0) { if (!isset($_POST["id"])) { $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE); } if (count($_POST["id"]) == 1 && $_POST["id"][0] == IL_FIRST_NODE) { $this->ilias->raiseError($this->lng->txt("cont_select_item"), $this->ilias->error_obj->MESSAGE); } if ($a_parent_subobj_id == 0) { $this->setTabs(); } if ($a_parent_subobj_id != 0) { $this->ctrl->setParameterByClass("ilStructureObjectGUI", "backcmd", $_GET["backcmd"]); $this->ctrl->setParameterByClass("ilStructureObjectGUI", "obj_id", $a_parent_subobj_id); $form_action = $this->ctrl->getFormActionByClass("ilStructureObjectGUI"); } else { $this->ctrl->setParameter($this, "backcmd", $_GET["backcmd"]); $form_action = $this->ctrl->getFormAction($this); } // display confirmation message include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $cgui = new ilConfirmationGUI(); $cgui->setFormAction($form_action); $cgui->setHeaderText($this->lng->txt("info_delete_sure")); $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete"); $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete"); foreach ($_POST["id"] as $id) { if ($id != IL_FIRST_NODE) { $obj = new ilLMObject($this->object, $id); $caption = ilUtil::getImageTagByType($obj->getType(), $this->tpl->tplPath) . " " . $obj->getTitle(); $cgui->addItem("id[]", $id, $caption); } } $this->tpl->setContent($cgui->getHTML()); }