本文整理汇总了PHP中ilConfirmationGUI::setFormName方法的典型用法代码示例。如果您正苦于以下问题:PHP ilConfirmationGUI::setFormName方法的具体用法?PHP ilConfirmationGUI::setFormName怎么用?PHP ilConfirmationGUI::setFormName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilConfirmationGUI
的用法示例。
在下文中一共展示了ilConfirmationGUI::setFormName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: confirmRemoveFromSystemObject
/**
* Confirmation for trash
*
* @param array $a_ids ref_ids
*/
public function confirmRemoveFromSystemObject($a_ids)
{
global $ilCtrl, $lng, $objDefinition, $tpl;
include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
if (!is_array($a_ids)) {
$a_ids = array($a_ids);
}
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this->parent_gui));
$cgui->setCancel($lng->txt("cancel"), "trash");
$cgui->setConfirm($lng->txt("confirm"), "removeFromSystem");
$cgui->setFormName("trash_confirmation");
$cgui->setHeaderText($lng->txt("info_delete_sure"));
foreach ($a_ids as $id) {
$obj_id = ilObject::_lookupObjId($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);
$cgui->addItem("trash_id[]", $id, $title, ilObject::_getIcon($obj_id, "small", $type), $alt);
}
$tpl->setContent($cgui->getHTML());
}