function rsvConfirmCancelAggregationObject(array $a_ids = null) { global $tpl, $ilCtrl, $lng; $this->tabs_gui->clearTargets(); $this->tabs_gui->setBackTarget($lng->txt("back"), $ilCtrl->getLinkTarget($this, "log")); // #13511 ilUtil::sendQuestion($lng->txt("book_confirm_cancel")); $form = $this->rsvConfirmCancelAggregationForm($a_ids); $tpl->setContent($form->getHTML()); }
/** * displays confirmation formular with users that shall be removed from group * @access public */ function removeMemberObject() { global $ilUser, $rbacreview; $this->__setSubTabs('members'); $user_ids = array(); if (isset($_POST['user_id'])) { $user_ids = $_POST['user_id']; } else { if (isset($_GET['mem_id'])) { $user_ids[] = $_GET['mem_id']; } else { if (isset($_GET['mem_id_arr'])) { $user_ids = explode(',', $_GET['mem_id_arr']); } } } if (empty($user_ids[0])) { $this->ilErr->raiseError($this->lng->txt("no_checkbox"), $this->ilErr->MESSAGE); } if (count($user_ids) == 1 && $ilUser->getId() != $user_ids[0]) { if (!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID) && !in_array($ilUser->getId(), $this->object->getAdminIds())) { $this->ilErr->raiseError($this->lng->txt("ilinc_err_no_permission"), $this->ilErr->MESSAGE); } } //bool value: says if $users_ids contains current user id $is_dismiss_me = array_search($this->ilias->account->getId(), $user_ids); $confirm = "confirmedRemoveMember"; $cancel = "canceled"; $info = $is_dismiss_me !== false ? "ilinc_dismiss_myself" : "ilinc_dismiss_member"; $status = ""; $return = "members"; ilUtil::sendQuestion($this->lng->txt($info)); $data = array(); if (is_array($user_ids)) { foreach ($user_ids as $id) { $obj_data = ilObjectFactory::getInstanceByObjId($id); $data[$id] = array('type' => ilUtil::getImageTagByType($obj_data->getType(), $this->tpl->tplPath), 'title' => $obj_data->getTitle(), 'desc' => $obj_data->getDescription(), 'last_update' => $obj_data->getLastUpdateDate()); } } else { $obj_data = ilObjectFactory::getInstanceByObjId($user_ids); $data[$user_ids] = array('type' => ilUtil::getImageTagByType($obj_data->getType(), $this->tpl->tplPath), 'title' => $obj_data->getTitle(), 'desc' => $obj_data->getDescription(), 'last_update' => $obj_data->getLastUpdateDate()); } //write in sessionvariables if (is_array($user_ids)) { $_SESSION['saved_post']['user_id'] = $user_ids; } else { $_SESSION['saved_post']['user_id'][0] = $user_ids; } if (isset($status)) { $_SESSION['saved_post']['status'] = $status; } include_once 'Modules/ILinc/classes/class.iliLinkConfirmationTableGUI.php'; $this->ctrl->setParameter($this, 'cmd_return_location', $a_cmd_return_location); $this->ctrl->setParameter($this, 'mem_id_arr', implode(',', $user_ids)); $oTable = new iliLinkConfirmationTableGUI($this, $data, 'removeMember', $return); $oTable->addCommandButton($cancel, $this->lng->txt('cancel')); $oTable->addCommandButton($confirm, $this->lng->txt('confirm')); return $this->tpl->setContent($oTable->getHTML()); }
/** * Confirm removing question block * @param int $a_id */ protected function deleteBlock() { global $lng, $ilCtrl; $ilCtrl->setParameter($this->editor_gui, "pgov", $this->current_page); ilUtil::sendQuestion($lng->txt("remove_questions")); $page = $this->object->getSurveyPages(); $page = $page[$this->current_page - 1]; // #10567 if ($_REQUEST["csum"] != md5(print_r($page, true))) { $ilCtrl->redirect($this, "renderPage"); } $page = array_shift($page); $block_id = $page["questionblock_id"]; if ($block_id) { $this->editor_gui->removeQuestionsForm(array($block_id), array(), array()); } else { $this->editor_gui->removeQuestionsForm(array(), array($page["question_id"]), array()); } }
/** * Show delete confirmation */ public function delete() { global $tpl, $ilSetting, $ilErr; $this->ctrl->setReturnByClass(get_class($this->getContainer()), ''); $to_delete = array(); if ((int) $_GET['item_ref_id']) { $to_delete = array((int) $_GET['item_ref_id']); } if (isset($_POST['id']) and is_array($_POST['id'])) { $to_delete = $_POST['id']; } if (!$to_delete) { $ilErr->raiseError($this->lng->txt('no_checkbox'), $ilErr->MESSAGE); } include_once './Services/Utilities/classes/class.ilConfirmationGUI.php'; $confirm = new ilConfirmationGUI(); $confirm->setFormAction($this->ctrl->getFormActionByClass(get_class($this->getContainer()), 'cancel')); $confirm->setHeaderText(''); $confirm->setCancel($this->lng->txt('cancel'), 'cancelDelete'); $confirm->setConfirm($this->lng->txt('delete'), 'performDelete'); foreach ($to_delete as $delete) { $obj_id = ilObject::_lookupObjId($delete); $type = ilObject::_lookupType($obj_id); $confirm->addItem('id[]', $delete, call_user_func(array(ilObjectFactory::getClassByType($type), '_lookupTitle'), $obj_id), ilUtil::getTypeIconPath($type, $obj_id)); } $msg = $this->lng->txt("info_delete_sure"); if (!$ilSetting->get('enable_trash')) { $msg .= "<br/>" . $this->lng->txt("info_delete_warning_no_trash"); } ilUtil::sendQuestion($msg); $tpl->setContent($confirm->getHTML()); }
function confirmDeleteArchives() { global $ilAccess, $ilErr; // MINIMUM ACCESS LEVEL = 'write' if (!$ilAccess->checkAccess("write", '', $this->course_obj->getRefId())) { $ilErr->raiseError($this->lng->txt('msg_no_perm_write'), $ilErr->MESSAGE); } if (!$_POST['archives']) { ilUtil::sendFailure($this->lng->txt("crs_no_archives_selected")); $this->view(); return false; } $_SESSION["crs_archives"] = $_POST["archives"]; ilUtil::sendQuestion($this->lng->txt("crs_sure_delete_selected_archives")); $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.crs_confirm_delete_archives.html', 'Modules/Course'); $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this)); $this->tpl->setVariable("TXT_ARCHIVE_NAME", $this->lng->txt('crs_file_name')); $this->course_obj->initCourseArchiveObject(); $counter = 0; foreach ($_POST['archives'] as $archive_id) { $archive = $this->course_obj->archives_obj->getArchive($archive_id); $this->tpl->setCurrentBlock("archives"); $this->tpl->setVariable("ARCHIVE_NAME", $archive['archive_name']); $this->tpl->setVariable("CSS_ROW", ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2')); $this->tpl->parseCurrentBlock(); } $this->tpl->setVariable("DELETE", $this->lng->txt('delete')); $this->tpl->setVariable("CANCEL", $this->lng->txt('cancel')); return true; }
/** * confirmation screen for export file deletion */ function confirmDeleteExportFile() { if (!isset($_POST["file"])) { ilUtil::sendInfo($this->lng->txt("no_checkbox"), true); $this->ctrl->redirect($this, "showExportList"); } ilUtil::sendQuestion($this->lng->txt("info_delete_sure")); $export_files = $this->object->getExportFiles(); include_once "./Modules/Scorm2004/classes/class.ilSCORM2004ExportTableGUI.php"; $table_gui = new ilSCORM2004ExportTableGUI($this, 'showExportList', true); $data = array(); foreach ($export_files as $exp_file) { foreach ($_POST['file'] as $delete_file) { if (strcmp($delete_file, $exp_file['file']) == 0) { $public_str = $exp_file["file"] == $this->object->getPublicExportFile($exp_file["type"]) ? " <b>(" . $this->lng->txt("public") . ")<b>" : ""; $file_arr = explode("__", $exp_file["file"]); array_push($data, array('file' => $exp_file['file'], 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => $exp_file['size'], 'type' => $exp_file['type'] . $public_str)); } } } $table_gui->setData($data); $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML()); }
/** * Asks for a confirmation to delete all user data of the test object * * Asks for a confirmation to delete all user data of the test object * * DEPRECATED? * * @access public */ function deleteAllUserDataObject() { ilUtil::sendQuestion($this->lng->txt("confirm_delete_all_user_data")); $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_maintenance.html", "Modules/Test"); $this->tpl->setCurrentBlock("confirm_delete"); $this->tpl->setVariable("BTN_CONFIRM_DELETE_ALL", $this->lng->txt("confirm")); $this->tpl->setVariable("BTN_CANCEL_DELETE_ALL", $this->lng->txt("cancel")); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("adm_content"); $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this)); $this->tpl->parseCurrentBlock(); }
function originalSyncForm() { $this->ctrl->saveParameter($this, "rtrn"); ilUtil::sendQuestion($this->lng->txt("confirm_sync_questions")); $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_qpl_sync_original.html", "Modules/SurveyQuestionPool"); $this->tpl->setCurrentBlock("adm_content"); $this->tpl->setVariable("BUTTON_YES", $this->lng->txt("yes")); $this->tpl->setVariable("BUTTON_NO", $this->lng->txt("no")); $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this)); $this->tpl->parseCurrentBlock(); }
/** * update GroupObject * @param bool update group type * @access public */ public function updateObject() { global $ilErr; $this->checkPermission('write'); $this->initForm(); $this->form->checkInput(); $old_type = $this->object->getGroupType(); $this->load(); $ilErr->setMessage(''); if (!$this->object->validate()) { $err = $this->lng->txt('err_check_input'); ilUtil::sendFailure($err); $err = $ilErr->getMessage(); ilUtil::sendInfo($err); $this->editObject(); return true; } $modified = false; if ($this->object->isGroupTypeModified($old_type) and !$update_group_type) { $modified = true; $this->object->setGroupType($old_type); } $this->object->update(); include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php'; ilObjectServiceSettingsGUI::updateServiceSettingsForm($this->object->getId(), $this->form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY)); // Save sorting include_once './Services/Container/classes/class.ilContainerSortingSettings.php'; $sort = new ilContainerSortingSettings($this->object->getId()); $sort->setSortMode((int) $_POST['sor']); $sort->update(); // BEGIN ChangeEvents: Record update Object. require_once 'Services/Tracking/classes/class.ilChangeEvent.php'; global $ilUser; ilChangeEvent::_recordWriteEvent($this->object->getId(), $ilUser->getId(), 'update'); ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId()); // END PATCH ChangeEvents: Record update Object. // Update ecs export settings include_once 'Modules/Group/classes/class.ilECSGroupSettings.php'; $ecs = new ilECSGroupSettings($this->object); $ecs->handleSettingsUpdate(); if ($modified) { include_once './Services/Utilities/classes/class.ilConfirmationGUI.php'; ilUtil::sendQuestion($this->lng->txt('grp_warn_grp_type_changed')); $confirm = new ilConfirmationGUI(); $confirm->setFormAction($this->ctrl->getFormAction($this)); $confirm->addItem('grp_type', $this->object->getGroupType(), $this->lng->txt('grp_info_new_grp_type') . ': ' . ($this->object->getGroupType() == GRP_TYPE_CLOSED ? $this->lng->txt('il_grp_status_open') : $this->lng->txt('il_grp_status_closed'))); $confirm->addButton($this->lng->txt('grp_change_type'), 'updateGroupType'); $confirm->setCancel($this->lng->txt('cancel'), 'edit'); $this->tpl->setContent($confirm->getHTML()); return true; } else { ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true); $this->ctrl->redirect($this, 'edit'); return true; } }
function deleteSubscribers() { global $rbacsystem; $this->tabs_gui->setTabActive('members'); // MINIMUM ACCESS LEVEL = 'administrate' $this->checkPermission('write'); /* if(!$rbacsystem->checkAccess("write", $this->object->getRefId())) { $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->MESSAGE); } */ if (!is_array($_POST["subscriber"]) or !count($_POST["subscriber"])) { ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected")); $this->membersObject(); return false; } ilUtil::sendQuestion($this->lng->txt("crs_delete_subscribers_sure")); // SHOW DELETE SCREEN $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_editMembers.html", 'Modules/Course'); // SAVE IDS IN SESSION $_SESSION["crs_delete_subscriber_ids"] = $_POST["subscriber"]; $counter = 0; $f_result = array(); foreach ($_POST["subscriber"] as $member_id) { $member_data = $this->object->getMembersObject()->getSubscriberData($member_id); // GET USER OBJ if ($tmp_obj = ilObjectFactory::getInstanceByObjId($member_id, false)) { $f_result[$counter][] = $tmp_obj->getLogin(); $f_result[$counter][] = $tmp_obj->getFirstname(); $f_result[$counter][] = $tmp_obj->getLastname(); $f_result[$counter][] = ilDatePresentation::formatDate(new ilDateTime($member_data['time']), IL_CAL_UNIX); unset($tmp_obj); ++$counter; } } return $this->__showDeleteSubscriberTable($f_result); }
/** * Enable all settings - Confirmation */ function confirmResetTemplateObject() { ilUtil::sendQuestion($this->lng->txt("test_confirm_template_reset")); $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_tst_tst_confirm_resettemplate.html", "Modules/Test"); $this->tpl->setCurrentBlock("adm_content"); $this->tpl->setVariable("BTN_CONFIRM_REMOVE", $this->lng->txt("confirm")); $this->tpl->setVariable("BTN_CANCEL_REMOVE", $this->lng->txt("cancel")); $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this, "resetTemplateObject")); $this->tpl->parseCurrentBlock(); }
function askDeleteObjective() { global $rbacsystem; // MINIMUM ACCESS LEVEL = 'write' if (!$rbacsystem->checkAccess("write", $this->course_obj->getRefId())) { $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilErr->MESSAGE); } if (!count($_POST['objective'])) { ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return true; } $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives.html", 'Modules/Course'); ilUtil::sendQuestion($this->lng->txt('crs_delete_objectve_sure')); $tpl =& new ilTemplate("tpl.table.html", true, true); $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_delete_row.html", 'Modules/Course'); $counter = 0; foreach ($_POST['objective'] as $objective_id) { $objective_obj = $this->__initObjectivesObject($objective_id); $tpl->setCurrentBlock("tbl_content"); $tpl->setVariable("ROWCOL", ilUtil::switchColor(++$counter, "tblrow2", "tblrow1")); $tpl->setVariable("TITLE", $objective_obj->getTitle()); $tpl->setVariable("DESCRIPTION", $objective_obj->getDescription()); $tpl->parseCurrentBlock(); } $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this)); // Show action row $tpl->setCurrentBlock("tbl_action_btn"); $tpl->setVariable("BTN_NAME", 'deleteObjectives'); $tpl->setVariable("BTN_VALUE", $this->lng->txt('delete')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_btn"); $tpl->setVariable("BTN_NAME", 'listObjectives'); $tpl->setVariable("BTN_VALUE", $this->lng->txt('cancel')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_row"); $tpl->setVariable("COLUMN_COUNTS", 1); $tpl->setVariable("IMG_ARROW", ilUtil::getImagePath('arrow_downright.png')); $tpl->parseCurrentBlock(); // create table $tbl = new ilTableGUI(); $tbl->setStyle('table', 'std'); // title & header columns $tbl->setTitle($this->lng->txt("crs_objectives"), "icon_lobj.png", $this->lng->txt("crs_objectives")); $tbl->setHeaderNames(array($this->lng->txt("title"))); $tbl->setHeaderVars(array("title"), array("ref_id" => $this->course_obj->getRefId(), "cmdClass" => "ilcourseobjectivesgui", "cmdNode" => $_GET["cmdNode"])); $tbl->setColumnWidth(array("50%")); $tbl->setLimit($_GET["limit"]); $tbl->setOffset($_GET["offset"]); $tbl->setMaxCount(count($_POST['objective'])); // footer $tbl->disable("footer"); $tbl->disable('sort'); // render table $tbl->setTemplate($tpl); $tbl->render(); $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get()); // Save marked objectives $_SESSION['crs_delete_objectives'] = $_POST['objective']; return true; }
/** * Get confirmation screen HTML. * * @return string HTML code. */ public final function getHTML() { global $lng; ilUtil::sendQuestion($this->getHeaderText()); include_once "./Services/Utilities/classes/class.ilConfirmationTableGUI.php"; // delete/handle items if (count($this->item) > 0) { $ctab = new ilConfirmationTableGUI($this->use_images); $ctab->setData($this->item); // other buttons foreach ($this->buttons as $b) { $ctab->addCommandButton($b["cmd"], $b["txt"]); } $ctab->addCommandButton($this->confirm_cmd, $this->confirm_txt); $ctab->addCommandButton($this->cancel_cmd, $this->cancel_txt); $ctab->setFormAction($this->getFormAction()); foreach ($this->hidden_item as $hidden_item) { $ctab->addHiddenInput($hidden_item["var"], $hidden_item["value"]); } if ($this->form_name) { $ctab->setFormName($this->form_name); } return $ctab->getHTML(); } else { $tb = new ilToolbarGUI(); $tb->setFormAction($this->getFormAction()); $tb->addFormButton($this->confirm_txt, $this->confirm_cmd); $tb->addFormButton($this->cancel_txt, $this->cancel_cmd); return $tb->getHTML(); } }
public function deleteCoupon() { $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment'); if (!isset($_GET['coupon_id'])) { return ilUtil::sendFailure($this->lng->txt('no_coupon_selected')); } # $this->ctrl->setParameter($this, 'coupon_id', $this->coupon_obj->getId()); $this->__showButtons(); ilUtil::sendQuestion($this->lng->txt('paya_coupons_sure_delete_selected_codes')); $oConfirmationGUI = new ilConfirmationGUI(); // set confirm/cancel commands $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this, 'performDeleteCoupon')); $oConfirmationGUI->setHeaderText(''); $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "showCoupons"); $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), 'performDeleteCoupon'); $oConfirmationGUI->addItem('', '', ilPaymentCoupons::_lookupTitle($_GET['coupon_id'])); $oConfirmationGUI->addHiddenItem('coupon_id', $_GET['coupon_id']); $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHTML()); return true; }
/** * Displays a confirmation screen with selected file versions that should be deleted. */ function deleteVersions() { global $ilTabs, $ilLocator; // get ids either from GET (if single item was clicked) or // from POST (if multiple items were selected) $version_ids = isset($_GET["hist_id"]) ? array($_GET["hist_id"]) : $_POST["hist_id"]; if (count($version_ids) < 1) { ilUtil::sendFailure($this->lng->txt("no_checkbox"), true); $this->ctrl->redirect($this, "versions"); } else { $ilTabs->activateTab("id_versions"); // check if all versions are selected $versionsToKeep = array_udiff($this->object->getVersions(), $version_ids, array($this, "compareHistoryIds")); if (count($versionsToKeep) < 1) { // set our message ilUtil::sendQuestion($this->lng->txt("file_confirm_delete_all_versions")); // show confirmation gui include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php"; $conf_gui = new ilConfirmationGUI(); $conf_gui->setFormAction($this->ctrl->getFormAction($this, "versions")); $conf_gui->setCancel($this->lng->txt("cancel"), "cancelDeleteFile"); $conf_gui->setConfirm($this->lng->txt("confirm"), "confirmDeleteFile"); $conf_gui->addItem("id[]", $this->ref_id, $this->object->getTitle(), ilObject::_getIcon($this->object->getId(), "small", $this->object->getType()), $this->lng->txt("icon") . " " . $this->lng->txt("obj_" . $this->object->getType())); $html = $conf_gui->getHTML(); } else { include_once "./Modules/File/classes/class.ilFileVersionTableGUI.php"; ilUtil::sendQuestion($this->lng->txt("file_confirm_delete_versions")); $versions = $this->object->getVersions($version_ids); $table = new ilFileVersionTableGUI($this, 'versions', true); $table->setMaxCount(sizeof($versions)); $table->setData($versions); $html = $table->getHTML(); } $this->tpl->setVariable('ADM_CONTENT', $html); } }
/** * Show confirmation whether user wants to start a new run or resume a previous run * @param type $a_objective_id * @param type $a_test_id */ protected function redirectLocToTestConfirmation($a_objective_id, $a_test_id) { include_once './Services/Utilities/classes/class.ilConfirmationGUI.php'; $confirm = new ilConfirmationGUI(); $confirm->setFormAction($GLOBALS['ilCtrl']->getFormAction($this)); if ($a_objective_id) { $question = $this->lng->txt('crs_loc_objective_passed_confirmation'); } else { $question = $this->lng->txt('crs_loc_objectives_passed_confirmation'); } $confirm->addHiddenItem('objective_id', $a_objective_id); $confirm->addHiddenItem('tid', $a_test_id); $confirm->setConfirm($this->lng->txt('crs_loc_tst_start'), 'redirectLocToTestConfirmed'); $confirm->setCancel($this->lng->txt('cancel'), 'view'); ilUtil::sendQuestion($question); $GLOBALS['tpl']->setContent($confirm->getHTML()); return true; }
/** * confirmation screen for export file deletion */ public function confirmDeleteExportFileObject() { if (!isset($_POST["file"])) { ilUtil::sendInfo($this->lng->txt("no_checkbox"), true); $this->ctrl->redirect($this, "export"); } ilUtil::sendQuestion($this->lng->txt("info_delete_sure")); include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyQuestionPoolExportTableGUI.php"; $table_gui = new ilSurveyQuestionPoolExportTableGUI($this, 'export', true); $export_dir = $this->object->getExportDirectory(); $data = array(); foreach ($_POST['file'] as $exp_file) { $file_arr = explode("__", $exp_file); array_push($data, array('file' => $exp_file, 'date' => ilDatePresentation::formatDate(new ilDateTime($file_arr[0], IL_CAL_UNIX)), 'size' => filesize($export_dir . "/" . $exp_file))); } $table_gui->setData($data); $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML()); }
/** * Creates a confirmation form to delete personal phases from the database */ public function deletePhrase() { ilUtil::sendInfo(); $checked_phrases = $_POST['phrase']; if (count($checked_phrases)) { ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_phrases")); $this->deletePhrasesForm($checked_phrases); return; } else { ilUtil::sendInfo($this->lng->txt("qpl_delete_phrase_select_none")); $this->phrases(); return; } }
/** * deletion confirmation screen */ function confirmDefinitionDeletion() { global $ilTabs; $this->getTemplate(); $this->displayLocator(); $this->setTabs(); $ilTabs->activateTab("definitions"); // content style $this->tpl->setCurrentBlock("ContentStyle"); $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath($this->glossary->getStyleSheetId())); $this->tpl->parseCurrentBlock(); // syntax style $this->tpl->setCurrentBlock("SyntaxStyle"); $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $this->tpl->parseCurrentBlock(); $this->tpl->setTitle($this->lng->txt("cont_term") . ": " . $this->term->getTerm()); $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_term_b.png")); $this->tpl->addBlockfile("ADM_CONTENT", "def_list", "tpl.glossary_definition_delete.html", true); ilUtil::sendQuestion($this->lng->txt("info_delete_sure")); $this->tpl->setVariable("TXT_TERM", $this->term->getTerm()); $definition =& new ilGlossaryDefinition($_GET["def"]); //$page =& new ilPageObject("gdf", $definition->getId()); $page_gui =& new ilPageObjectGUI("gdf", $definition->getId()); $page_gui->setTemplateOutput(false); $page_gui->setStyleId($this->glossary->getStyleSheetId()); $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]); $page_gui->setFileDownloadLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]); $page_gui->setFullscreenLink("ilias.php?baseClass=ilGlossaryPresentationGUI&ref_id=" . $_GET["ref_id"]); $output = $page_gui->preview(); $this->tpl->setCurrentBlock("definition"); $this->tpl->setVariable("PAGE_CONTENT", $output); $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel")); $this->tpl->setVariable("LINK_CANCEL", $this->ctrl->getLinkTarget($this, "cancelDefinitionDeletion")); $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirm")); $this->ctrl->setParameter($this, "def", $definition->getId()); $this->tpl->setVariable("LINK_CONFIRM", $this->ctrl->getLinkTarget($this, "deleteDefinition")); $this->tpl->parseCurrentBlock(); }
/** * Show delete confirmation screen * @return */ protected function confirmDeleteRoleObject() { global $ilErr, $rbacreview, $ilUser; $access = $this->checkAccess('visible,write', 'edit_permission'); if (!$access) { $ilErr->raiseError($this->lng->txt('msg_no_perm_perm'), $ilErr->WARNING); } $question = $this->lng->txt('rbac_role_delete_qst'); if ($rbacreview->isAssigned($ilUser->getId(), $this->object->getId())) { $question .= '<br />' . $this->lng->txt('rbac_role_delete_self'); } ilUtil::sendQuestion($question); include_once './Services/Utilities/classes/class.ilConfirmationGUI.php'; $confirm = new ilConfirmationGUI(); $confirm->setFormAction($this->ctrl->getFormAction($this)); $confirm->setHeaderText($question); $confirm->setCancel($this->lng->txt('cancel'), 'perm'); $confirm->setConfirm($this->lng->txt('rbac_delete_role'), 'performDeleteRole'); $confirm->addItem('role', $this->object->getId(), $this->object->getTitle(), ilUtil::getImagePath('icon_role.png')); $this->tpl->setContent($confirm->getHTML()); return true; }
/** * delete questions confirmation screen */ function deleteQuestionsObject() { global $rbacsystem; if (count($_POST["q_id"]) < 1) { ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"), true); $this->ctrl->redirect($this, "questions"); } ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_questions")); $deleteable_questions =& $this->object->getDeleteableQuestionDetails($_POST["q_id"]); include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php"; $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', $rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false, true); $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id'])); $table_gui->setData($deleteable_questions); $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML()); }
/** * Asks for a confirmation to delete selected user data of the test object */ public function deleteSingleUserResultsObject() { $this->parent_gui->handleWriteAccess(); if (count($_POST["chbUser"]) == 0) { ilUtil::sendInfo($this->lng->txt('no_checkbox'), true); $this->ctrl->redirect($this, "maintenance"); } ilUtil::sendQuestion($this->lng->txt("confirm_delete_single_user_data")); include_once "./Modules/Survey/classes/tables/class.ilSurveyMaintenanceTableGUI.php"; $table_gui = new ilSurveyMaintenanceTableGUI($this, 'maintenance', true); $total =& $this->object->getSurveyParticipants(); $data = array(); foreach ($total as $user_data) { if (in_array($user_data['active_id'], $_POST['chbUser'])) { $last_access = $this->object->_getLastAccess($user_data["active_id"]); array_push($data, array('id' => $user_data["active_id"], 'name' => $user_data["sortname"], 'login' => $user_data["login"], 'last_access' => $last_access)); } } $table_gui->setData($data); $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML()); }
/** * confirmation screen for export file deletion */ function confirmDeleteExportFileObject() { global $ilTabs; $this->handleWriteAccess(); $ilTabs->activateTab("export"); if (!isset($_POST["file"])) { ilUtil::sendFailure($this->lng->txt("no_checkbox"), true); $this->ctrl->redirect($this, "export"); } ilUtil::sendQuestion($this->lng->txt("info_delete_sure")); $export_dir = $this->object->getExportDirectory(); $export_files = $this->object->getExportFiles($export_dir); $data = array(); if (count($_POST["file"]) > 0) { foreach ($_POST["file"] as $exp_file) { $file_arr = explode("__", $exp_file); $date = new ilDateTime($file_arr[0], IL_CAL_UNIX); array_push($data, array('file' => $exp_file, 'size' => filesize($export_dir . "/" . $exp_file), 'date' => $date->get(IL_CAL_DATETIME))); } } include_once "./Modules/Survey/classes/tables/class.ilSurveyExportTableGUI.php"; $table_gui = new ilSurveyExportTableGUI($this, 'export', true); $table_gui->setData($data); $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML()); }
/** * Confirm deletion of export files * * @access public * @param * */ public function confirmDeleteExportFile() { if (!count($_POST['files'])) { ilUtil::sendFailure($this->lng->txt('ps_select_one')); $this->show(); return false; } $_SESSION['il_del_member_export'] = $_POST['files']; ilUtil::sendQuestion($this->lng->txt("info_delete_sure")); $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.member_export_confirm_delete.html', 'Modules/Course'); $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this)); $this->tpl->setVariable('TEXT', $this->lng->txt('ps_delete_export_files')); $counter = 0; foreach ($this->fss_export->getMemberExportFiles() as $file) { if (!in_array($file['timest'], $_POST['files'])) { continue; } $this->tpl->setCurrentBlock('table_row'); $this->tpl->setVariable('CSS_ROW', ilUtil::switchColor($counter++, 'tblrow1', 'tblrow2')); $this->tpl->setVariable('TEXT_TYPE', strtoupper($file['type'])); $this->tpl->setVariable('DATE', ilDatePresentation::formatDate(new ilDateTime($file['timest'], IL_CAL_UNIX))); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock('operation_btn'); $this->tpl->setVariable('BTN_NAME', 'deleteExportFile'); $this->tpl->setVariable('BTN_VALUE', $this->lng->txt('delete')); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock('operation_btn'); $this->tpl->setVariable('BTN_NAME', 'show'); $this->tpl->setVariable('BTN_VALUE', $this->lng->txt('cancel')); $this->tpl->parseCurrentBlock(); }
/** * Get confirmation screen HTML. * * @return string HTML code. */ public final function getHTML() { global $lng; ilUtil::sendQuestion($this->getHeaderText()); include_once "./Services/Utilities/classes/class.ilConfirmationTableGUI.php"; // delete/handle items if (count($this->item) > 0) { $ctab = new ilConfirmationTableGUI($this->use_images); $ctab->setData($this->item); // other buttons foreach ($this->buttons as $b) { $ctab->addCommandButton($b["cmd"], $b["txt"]); } $ctab->addCommandButton($this->confirm_cmd, $this->confirm_txt); $ctab->addCommandButton($this->cancel_cmd, $this->cancel_txt); $ctab->setFormAction($this->getFormAction()); foreach ($this->hidden_item as $hidden_item) { $ctab->addHiddenInput($hidden_item["var"], $hidden_item["value"]); } if ($this->form_name) { $ctab->setFormName($this->form_name); } return $ctab->getHTML(); } else { $tb = new ilToolbarGUI(); $tb->setPreventDoubleSubmission(true); $tb->setFormAction($this->getFormAction()); if ($this->hidden_item) { require_once 'Services/Form/classes/class.ilPropertyFormGUI.php'; foreach ($this->hidden_item as $hidden_item) { $hiddenInput = new ilHiddenInputGUI($hidden_item['var']); $hiddenInput->setValue($hidden_item['value']); $tb->addInputItem($hiddenInput); } } require_once 'Services/UIComponent/Button/classes/class.ilSubmitButton.php'; $confirm = ilSubmitButton::getInstance(); $confirm->setCommand($this->confirm_cmd); $confirm->setCaption($this->confirm_txt, false); $cancel = ilSubmitButton::getInstance(); $cancel->setCommand($this->cancel_cmd); $cancel->setCaption($this->cancel_txt, false); $tb->addButtonInstance($confirm); $tb->addButtonInstance($cancel); return $tb->getHTML(); } }
/** * Add command buttons * @return */ protected function addCommandButtons() { global $ilUser; if ($this->isRegistrationPossible() and $this->isWaitingListActive() and !$this->getWaitingList()->isOnList($ilUser->getId())) { $this->form->addCommandButton('join', $this->lng->txt('mem_add_to_wl')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); } elseif ($this->isRegistrationPossible() and !$this->getWaitingList()->isOnList($ilUser->getId())) { $this->form->addCommandButton('join', $this->lng->txt('join')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); } if ($this->getWaitingList()->isOnList($ilUser->getId())) { ilUtil::sendQuestion(sprintf($this->lng->txt($this->container->getType() . '_cancel_waiting_list'), $this->container->getTitle())); $this->form->addCommandButton('leaveWaitingList', $this->lng->txt('leave_waiting_list')); $this->form->addCommandButton('cancel', $this->lng->txt('cancel')); } }
public function deleteVendorsObject() { //include_once './Services/Payment/classes/class.ilPaymentBookings.php'; if (!count($_POST['vendor'])) { ilUtil::sendFailure($this->lng->txt('pays_no_vendor_selected')); $this->vendorsObject(); return true; } // CHECK BOOKINGS foreach ($_POST['vendor'] as $vendor) { if (ilPaymentBookings::_getCountBookingsByVendor($vendor)) { ilUtil::sendInfo($this->lng->txt('pays_active_bookings')); $this->vendorsObject(); return true; } } $_SESSION['pays_vendor'] = $_POST['vendor']; ilUtil::sendQuestion($this->lng->txt('pays_sure_delete_selected_vendors')); $this->vendorsObject(true); return true; }
public function removeQuestionsObject() { $items = $this->gatherSelectedTableItems(true, true, true, true); if (count($items["blocks"]) + count($items["questions"]) + count($items["headings"]) > 0) { ilUtil::sendQuestion($this->lng->txt("remove_questions")); $this->removeQuestionsForm($items["blocks"], $items["questions"], $items["headings"]); return; } else { ilUtil::sendInfo($this->lng->txt("no_question_selected_for_removal"), true); $this->ctrl->redirect($this, "questions"); } }
/** * */ public function confirmDeleteSignature() { $signature = srCertificateSignature::find($_GET['signature_id']); $item_html = $signature->getFirstName() . " " . $signature->getLastName() . '<br>'; $this->tabs->clearTargets(); $this->tabs->setBackTarget($this->pl->txt('common_back'), $this->ctrl->getLinkTarget($this, 'view')); ilUtil::sendQuestion($this->pl->txt('signatures_confirm_delete')); $toolbar = new ilToolbarGUI(); $this->ctrl->saveParameter($this, 'signature_id'); $toolbar->addButton($this->pl->txt('confirm'), $this->ctrl->getLinkTarget($this, 'deleteSignature')); $toolbar->addButton($this->pl->txt('cancel'), $this->ctrl->getLinkTarget($this, 'showSignatures')); $this->tpl->setContent($item_html . '</br>' . $toolbar->getHTML()); }
function confirmRegrade() { require_once './Services/Utilities/classes/class.ilConfirmationGUI.php'; $conf = new ilConfirmationGUI(); $conf->setFormAction($this->ctrl->getFormAction($this)); ilUtil::sendQuestion($this->lng->txt('rubric_regrade_warning')); $conf->setFormAction($this->ctrl->getFormAction($this)); $conf->addHiddenItem('user_id', $_POST['user_id']); $conf->setConfirm($this->lng->txt('rubric_regrade'), 'regradeUser'); $conf->setCancel($this->lng->txt('cancel'), 'cancelRegrade'); $this->tpl->setContent($conf->getHTML()); }