本文整理汇总了PHP中ilConfirmationGUI::setConfirm方法的典型用法代码示例。如果您正苦于以下问题:PHP ilConfirmationGUI::setConfirm方法的具体用法?PHP ilConfirmationGUI::setConfirm怎么用?PHP ilConfirmationGUI::setConfirm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilConfirmationGUI
的用法示例。
在下文中一共展示了ilConfirmationGUI::setConfirm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: askDeleteGrouping
function askDeleteGrouping()
{
global $ilErr, $ilAccess, $tpl;
if (!$ilAccess->checkAccess('write', '', $this->content_obj->getRefId())) {
$ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
}
if (!count($_POST['grouping'])) {
ilUtil::sendFailure($this->lng->txt('crs_grouping_select_one'));
$this->listGroupings();
return false;
}
// display confirmation message
include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($this->ctrl->getFormAction($this));
$cgui->setHeaderText($this->lng->txt("crs_grouping_delete_sure"));
$cgui->setCancel($this->lng->txt("cancel"), "listGroupings");
$cgui->setConfirm($this->lng->txt("delete"), "deleteGrouping");
// list objects that should be deleted
foreach ($_POST['grouping'] as $grouping_id) {
$tmp_obj = new ilObjCourseGrouping($grouping_id);
$cgui->addItem("grouping[]", $grouping_id, $tmp_obj->getTitle());
}
$tpl->setContent($cgui->getHTML());
}
示例2: delete
/**
* 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());
}
示例3: showTrustees
public function showTrustees($a_show_delete = false)
{
global $ilToolbar;
$_SESSION['paya_delete_trustee'] = $_SESSION['paya_delete_trustee'] ? $_SESSION['paya_delete_trustee'] : array();
$actions = array(0 => $this->lng->txt("paya_disabled"), 1 => $this->lng->txt("paya_enabled"));
include_once "./Services/Form/classes/class.ilTextInputGUI.php";
$ul = new ilTextInputGUI($this->lng->txt("user"), "search_str");
$ul->setDataSource($this->ctrl->getLinkTarget($this, "performSearch", "", true));
$ul->setSize(20);
$ilToolbar->addInputItem($ul, true);
$ilToolbar->addFormButton($this->lng->txt("add"), "performSearch");
$ilToolbar->setFormAction($this->ctrl->getFormAction($this));
$this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
if ($a_show_delete) {
$oConfirmationGUI = new ilConfirmationGUI();
// set confirm/cancel commands
$oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this, "performDeleteTrustee"));
$oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_selected_trustees"));
$oConfirmationGUI->setCancel($this->lng->txt("cancel"), "cancelDelete");
$oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDeleteTrustee");
foreach ($this->trustee_obj->getTrustees() as $trustee) {
$delete_row = '';
if (in_array($trustee['trustee_id'], $_POST['trustee'])) {
if ($tmp_obj = ilObjectFactory::getInstanceByObjId($trustee['trustee_id'], false)) {
$delete_row = $tmp_obj->getLogin() . ' -> ' . $tmp_obj->getFirstname() . ' ' . $tmp_obj->getLastname();
}
}
$oConfirmationGUI->addItem('', $delete_row, $delete_row);
}
$this->tpl->setVariable("CONFIRMATION", $oConfirmationGUI->getHTML());
}
if (!count($this->trustee_obj->getTrustees())) {
ilUtil::sendInfo($this->lng->txt('paya_no_trustees'));
return true;
}
$counter = 0;
$f_result = array();
require_once 'Services/Mail/classes/class.ilMailFormCall.php';
foreach ($this->trustee_obj->getTrustees() as $trustee) {
// GET USER OBJ
if ($tmp_obj = ilObjectFactory::getInstanceByObjId($trustee['trustee_id'], false)) {
$f_result[$counter]['trustee_id'] = ilUtil::formCheckbox(in_array($trustee['trustee_id'], $_SESSION['paya_delete_trustee']) ? 1 : 0, "trustee[]", $trustee['trustee_id']);
$f_result[$counter]['login'] = $tmp_obj->getLogin();
$f_result[$counter]['firstname'] = $tmp_obj->getFirstname();
$f_result[$counter]['lastname'] = $tmp_obj->getLastname();
$f_result[$counter]['perm_stat'] = ilUtil::formSelect((int) $trustee['perm_stat'], 'perm_stat[' . $trustee['trustee_id'] . ']', $actions, false, true);
$f_result[$counter]['perm_obj'] = ilUtil::formSelect((int) $trustee['perm_obj'], 'perm_obj[' . $trustee['trustee_id'] . ']', $actions, false, true);
$f_result[$counter]['perm_coupons'] = ilUtil::formSelect((int) $trustee['perm_coupons'], 'perm_coupons[' . $trustee['trustee_id'] . ']', $actions, false, true);
# $link_mail = "<a target=\"_blank\" href=\"./ilias.php?baseClass=ilMailGUI&type=new&rcp_to=".
# $tmp_obj->getLogin()."\"".$img_mail."</a>";
$url_mail = ilMailFormCall::getLinkTarget($this, '', array(), array('type' => 'new', 'rcp_to' => $tmp_obj->getLogin()));
$link_mail = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"" . $url_mail . "\">" . $this->lng->txt("mail") . "</a></div>";
$f_result[$counter]['options'] = $link_mail;
unset($tmp_obj);
++$counter;
}
}
return $this->__showTrusteesTable($f_result);
}
示例4: ConfirmResetTraining
/**
* Show confirmation screen to reset the training
*/
protected function ConfirmResetTraining()
{
require_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
$gui = new ilConfirmationGUI();
$gui->setFormAction($this->ctrl->getFormAction($this));
$gui->setHeaderText($this->txt("reset_training_confirmation"));
$gui->setConfirm($this->txt("reset_training"), "resetTraining");
$gui->setCancel($this->lng->txt("cancel"), "showContent");
$this->tpl->setContent($gui->getHTML());
}
示例5: confirmRemove
function confirmRemove()
{
global $ilAccess, $ilCtrl, $lng, $tpl;
include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirm = new ilConfirmationGUI();
$confirm->setFormAction($ilCtrl->getFormAction($this, 'remove'));
$confirm->addHiddenItem("grp_id", $_GET["grp_id"]);
$confirm->setHeaderText($lng->txt('grp_dismiss_member'));
$confirm->setConfirm($lng->txt('confirm'), 'remove');
$confirm->setCancel($lng->txt('cancel'), 'show');
include_once './Services/User/classes/class.ilUserUtil.php';
$confirm->addItem('usr_id', $_GET["usr_id"], ilUserUtil::getNamePresentation($_GET["usr_id"], false, false, "", true), ilUtil::getImagePath('icon_usr.svg'));
$tpl->setContent($confirm->getHTML());
}
示例6: showDeleteConfirmation
/**
* Show delete confirmation table
*/
function showDeleteConfirmation($a_ids, $a_supress_message = false)
{
global $lng, $ilSetting, $ilCtrl, $tpl, $objDefinition;
if (!is_array($a_ids) || count($a_ids) == 0) {
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
return false;
}
// Remove duplicate entries
$a_ids = array_unique((array) $a_ids);
include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
$cgui = new ilConfirmationGUI();
if (!$a_supress_message) {
$msg = $lng->txt("info_delete_sure");
if (!$ilSetting->get('enable_trash')) {
$msg .= "<br/>" . $lng->txt("info_delete_warning_no_trash");
}
$cgui->setHeaderText($msg);
}
$cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui));
$cgui->setCancel($lng->txt("cancel"), "cancelDelete");
$cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
$form_name = "cgui_" . md5(uniqid());
$cgui->setFormName($form_name);
$deps = array();
foreach ($a_ids as $ref_id) {
$obj_id = ilObject::_lookupObjId($ref_id);
$type = ilObject::_lookupType($obj_id);
$title = call_user_func(array(ilObjectFactory::getClassByType($type), '_lookupTitle'), $obj_id);
$alt = $objDefinition->isPlugin($type) ? $lng->txt("icon") . " " . ilPlugin::lookupTxt("rep_robj", $type, "obj_" . $type) : $lng->txt("icon") . " " . $lng->txt("obj_" . $type);
$title .= $this->handleMultiReferences($obj_id, $ref_id, $form_name);
$cgui->addItem("id[]", $ref_id, $title, ilObject::_getIcon($obj_id, "small", $type), $alt);
ilObject::collectDeletionDependencies($deps, $ref_id, $obj_id, $type);
}
$deps_html = "";
if (is_array($deps) && count($deps) > 0) {
include_once "./Services/Repository/classes/class.ilRepDependenciesTableGUI.php";
$tab = new ilRepDependenciesTableGUI($deps);
$deps_html = "<br/><br/>" . $tab->getHTML();
}
$tpl->setContent($cgui->getHTML() . $deps_html);
return true;
}
示例7: deleteUsersObject
function deleteUsersObject()
{
$this->checkPermission("cat_administrate_users");
if (!count($_POST['id'])) {
ilUtil::sendFailure($this->lng->txt('no_users_selected'));
$this->index();
return true;
}
include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirm = new ilConfirmationGUI();
$confirm->setFormAction($this->ctrl->getFormAction($this));
$confirm->setHeaderText($this->lng->txt('sure_delete_selected_users'));
$confirm->setConfirm($this->lng->txt('delete'), 'performDeleteUsers');
$confirm->setCancel($this->lng->txt('cancel'), 'index');
foreach ($_POST['id'] as $user) {
$name = ilObjUser::_lookupName($user);
$confirm->addItem('user_ids[]', $user, $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']');
}
$this->tpl->setContent($confirm->getHTML());
}
示例8: askDeleteAppointments
/**
* ask delete appointments
*
* @access protected
* @return
*/
protected function askDeleteAppointments()
{
global $tpl;
if (!count($_POST['appointments'])) {
ilUtil::sendFailure($this->lng->txt('select_one'));
$this->details();
return true;
}
include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirmation_gui = new ilConfirmationGUI();
$this->ctrl->setParameter($this, 'category_id', (int) $_GET['category_id']);
$confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
$confirmation_gui->setHeaderText($this->lng->txt('cal_del_app_sure'));
$confirmation_gui->setConfirm($this->lng->txt('delete'), 'deleteAppointments');
$confirmation_gui->setCancel($this->lng->txt('cancel'), 'details');
include_once './Services/Calendar/classes/class.ilCalendarEntry.php';
foreach ($_POST['appointments'] as $app_id) {
$app = new ilCalendarEntry($app_id);
$confirmation_gui->addItem('appointments[]', (int) $app_id, $app->getTitle());
}
$tpl->setContent($confirmation_gui->getHTML());
}
示例9: confirmDeleteRecords
/**
* Confirm deletion of multiple records
*
*/
public function confirmDeleteRecords()
{
global $ilCtrl, $lng, $tpl, $ilTabs;
/** @var ilTabsGUI $ilTabs */
$ilTabs->clearSubTabs();
$conf = new ilConfirmationGUI();
$conf->setFormAction($ilCtrl->getFormAction($this));
$conf->setHeaderText($lng->txt('dcl_confirm_delete_records'));
$record_ids = isset($_POST['record_ids']) ? $_POST['record_ids'] : array();
foreach ($record_ids as $record_id) {
/** @var ilDataCollectionRecord $record */
$record = ilDataCollectionCache::getRecordCache($record_id);
if ($record) {
$conf->addItem('record_ids[]', $record->getId(), rtrim(implode(", ", $record->getRecordFieldValues()), ', '));
}
}
$conf->addHiddenItem('table_id', $this->table_id);
$conf->setConfirm($lng->txt('dcl_delete_records'), 'deleteRecords');
$conf->setCancel($lng->txt('cancel'), 'cancelDelete');
$tpl->setContent($conf->getHTML());
}
示例10: confirmDelete
/**
* confirmDelete
*/
public function confirmDelete()
{
global $ilCtrl, $lng, $tpl;
include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
$conf = new ilConfirmationGUI();
$conf->setFormAction($ilCtrl->getFormAction($this));
$conf->setHeaderText($lng->txt('dcl_confirm_delete_field'));
$conf->addItem('field_id', (int) $this->field_obj->getId(), $this->field_obj->getTitle());
$conf->setConfirm($lng->txt('delete'), 'delete');
$conf->setCancel($lng->txt('cancel'), 'cancelDelete');
$tpl->setContent($conf->getHTML());
}
示例11: confirmDelete
/**
* Confirm delete
*/
function confirmDelete()
{
global $ilCtrl, $lng, $tpl, $ilTabs, $ilHelp;
$ilHelp->setSubScreenId("delete");
include_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
$conf = new ilConfirmationGUI();
$conf->setFormAction($ilCtrl->getFormAction($this));
$conf->setHeaderText($lng->txt('book_confirm_delete'));
include_once 'Modules/BookingManager/classes/class.ilBookingSchedule.php';
$type = new ilBookingSchedule((int) $_GET['schedule_id']);
$conf->addItem('schedule_id', (int) $_GET['schedule_id'], $type->getTitle());
$conf->setConfirm($lng->txt('delete'), 'delete');
$conf->setCancel($lng->txt('cancel'), 'render');
$tpl->setContent($conf->getHTML());
}
示例12: confirmDeleteFields
/**
* Show delete confirmation screen
* @return
*/
protected function confirmDeleteFields()
{
if (!count($_POST['field_ids'])) {
ilUtil::sendFailure($this->lng->txt('ps_cdf_select_one'));
$this->listFields();
return false;
}
include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirm = new ilConfirmationGUI();
$confirm->setFormAction($this->ctrl->getFormAction($this));
$confirm->setHeaderText($this->lng->txt('ps_cdf_delete_sure'));
foreach ($_POST['field_ids'] as $field_id) {
$tmp_field = new ilCourseDefinedFieldDefinition($this->getObjId(), $field_id);
$confirm->addItem('field_ids[]', $field_id, $tmp_field->getName());
}
$confirm->setConfirm($this->lng->txt('delete'), 'deleteFields');
$confirm->setCancel($this->lng->txt('cancel'), 'listFields');
$this->tpl->setContent($confirm->getHTML());
}
示例13: deletePglObject
/**
* display deletion confirmation screen
*/
function deletePglObject()
{
global $ilTabs;
if (!isset($_POST["pglayout"])) {
$this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
}
$ilTabs->setTabActive('page_layouts');
unset($this->data);
// display confirmation message
include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($this->ctrl->getFormAction($this));
$cgui->setHeaderText($this->lng->txt("info_delete_sure"));
$cgui->setCancel($this->lng->txt("cancel"), "cancelDeletePg");
$cgui->setConfirm($this->lng->txt("confirm"), "confirmedDeletePg");
foreach ($_POST["pglayout"] as $id) {
$pg_obj = new ilPageLayout($id);
$pg_obj->readObject();
$caption = ilUtil::getImageTagByType("stys", $this->tpl->tplPath) . " " . $pg_obj->getTitle();
$cgui->addItem("pglayout[]", $id, $caption);
}
$this->tpl->setContent($cgui->getHTML());
}
示例14: deleteWikiPageConfirmationScreen
/**
* Delete wiki page confirmation screen.
*/
function deleteWikiPageConfirmationScreen()
{
global $ilAccess, $tpl, $ilCtrl, $lng;
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
$confirmation_gui = new ilConfirmationGUI();
$confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
$confirmation_gui->setHeaderText($lng->txt("wiki_page_deletion_confirmation"));
$confirmation_gui->setCancel($lng->txt("cancel"), "cancelWikiPageDeletion");
$confirmation_gui->setConfirm($lng->txt("delete"), "confirmWikiPageDeletion");
$dtpl = new ilTemplate("tpl.wiki_page_deletion_confirmation.html", true, true, "Modules/Wiki");
$dtpl->setVariable("PAGE_TITLE", $this->getWikiPage()->getTitle());
// other pages that link to this page
$dtpl->setVariable("TXT_OTHER_PAGES", $lng->txt("wiki_other_pages_linking"));
$pages = ilWikiPage::getLinksToPage($this->getWikiPage()->getWikiId(), $this->getWikiPage()->getId());
if (count($pages) > 0) {
foreach ($pages as $page) {
$dtpl->setCurrentBlock("lpage");
$dtpl->setVariable("TXT_LINKING_PAGE", $page["title"]);
$dtpl->parseCurrentBlock();
}
} else {
$dtpl->setCurrentBlock("lpage");
$dtpl->setVariable("TXT_LINKING_PAGE", "-");
$dtpl->parseCurrentBlock();
}
// contributors
$dtpl->setVariable("TXT_CONTRIBUTORS", $lng->txt("wiki_contributors"));
$contributors = ilWikiPage::getPageContributors($this->getWikiPage()->getId());
foreach ($contributors as $contributor) {
$dtpl->setCurrentBlock("contributor");
$dtpl->setVariable("TXT_CONTRIBUTOR", $contributor["lastname"] . ", " . $contributor["firstname"]);
$dtpl->parseCurrentBlock();
}
// notes/comments
include_once "./Services/Notes/classes/class.ilNote.php";
$cnt_note_users = ilNote::getUserCount($this->getPageObject()->getParentId(), $this->getPageObject()->getId(), "wpg");
$dtpl->setVariable("TXT_NUMBER_USERS_NOTES_OR_COMMENTS", $lng->txt("wiki_number_users_notes_or_comments"));
$dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
$confirmation_gui->addItem("", "", $dtpl->get());
$tpl->setContent($confirmation_gui->getHTML());
}
}
示例15: confirmDelete
/**
* confirmDelete
*/
public function confirmDelete()
{
global $ilCtrl, $lng, $tpl;
include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
$conf = new ilConfirmationGUI();
$conf->setFormAction($ilCtrl->getFormAction($this));
$conf->setHeaderText($lng->txt('dcl_confirm_delete_record'));
$record = ilDataCollectionCache::getRecordCache($this->record_id);
$conf->addItem('record_id', $record->getId(), implode(", ", $record->getRecordFieldValues()));
$conf->addHiddenItem('table_id', $this->table_id);
$conf->setConfirm($lng->txt('delete'), 'delete');
$conf->setCancel($lng->txt('cancel'), 'cancelDelete');
$tpl->setContent($conf->getHTML());
}