当前位置: 首页>>代码示例>>PHP>>正文


PHP CForm::Reset方法代码示例

本文整理汇总了PHP中CForm::Reset方法的典型用法代码示例。如果您正苦于以下问题:PHP CForm::Reset方法的具体用法?PHP CForm::Reset怎么用?PHP CForm::Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CForm的用法示例。


在下文中一共展示了CForm::Reset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: IncludeModuleLangFile

    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
CModule::IncludeModule("form");
$bSimple = COption::GetOptionString("form", "SIMPLE", "Y") == "Y" ? true : false;
//require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/include.php");
IncludeModuleLangFile(__FILE__);
$err_mess = "File: " . __FILE__ . "<br>Line: ";
$arFilterFields = array("find_id", "find_id_exact_match", "find_name", "find_name_exact_match", "find_sid", "find_sid_exact_match", "find_description", "find_description_exact_match", "find_site");
$lAdmin->InitFilter($arFilterFields);
$old_module_version = CForm::IsOldVersion();
/***************************************************************************
			   GET | POST processing
****************************************************************************/
$reset_id = intval($reset_id);
if ($FORM_RIGHT == "W" && $reset_id > 0 && check_bitrix_sessid()) {
    CForm::Reset($reset_id);
}
$copy_id = intval($makecopy_id);
if ($FORM_RIGHT == "W" && $copy_id > 0 && check_bitrix_sessid()) {
    CForm::Copy($copy_id);
    LocalRedirect("form_list.php?lang=" . LANGUAGE_ID);
}
InitBVar($find_id_exact_match);
InitBVar($find_name_exact_match);
InitBVar($find_sid_exact_match);
InitBVar($find_description_exact_match);
$arFilter = array("ID" => $find_id, "ID_EXACT_MATCH" => $find_id_exact_match, "NAME" => $find_name, "NAME_EXACT_MATCH" => $find_name_exact_match, "SID" => $find_sid, "SID_EXACT_MATCH" => $find_sid_exact_match, "DESCRIPTION" => $find_description, "DESCRIPTION_EXACT_MATCH" => $find_description_exact_match, "SITE" => $find_site);
// "Save" button was pressed
if ($lAdmin->EditAction() && $FORM_RIGHT >= "W" && check_bitrix_sessid()) {
    foreach ($FIELDS as $ID => $arFields) {
        if (!$lAdmin->IsUpdated($ID)) {
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:form_list.php

示例2: intval

	"find_sid_exact_match",
	"find_description",
	"find_description_exact_match",
	"find_site"
	);

$lAdmin->InitFilter($arFilterFields);

$old_module_version = CForm::IsOldVersion();

/***************************************************************************
			   GET | POST processing
****************************************************************************/

$reset_id = intval($reset_id);
if ($FORM_RIGHT=="W" && $reset_id>0 && check_freetrix_sessid()) CForm::Reset($reset_id);

$copy_id = intval($makecopy_id);
if ($FORM_RIGHT=="W" && $copy_id>0 && check_freetrix_sessid())
{
	CForm::Copy($copy_id);
	LocalRedirect("form_list.php?lang=".LANGUAGE_ID);
}

InitBVar($find_id_exact_match);
InitBVar($find_name_exact_match);
InitBVar($find_sid_exact_match);
InitBVar($find_description_exact_match);
$arFilter = Array(
	"ID"						=> $find_id,
	"ID_EXACT_MATCH"			=> $find_id_exact_match,
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:form_list.php

示例3: Delete

 function Delete($ID, $CHECK_RIGHTS = "Y")
 {
     global $DB, $strError;
     $err_mess = CAllForm::err_mess() . "<br>Function: Delete<br>Line: ";
     $ID = intval($ID);
     if ($CHECK_RIGHTS != "Y" || CForm::IsAdmin()) {
         // delete form results
         if (CForm::Reset($ID, "N")) {
             // delete temporary template
             $tmp_filename = $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/tmp/form/form_" . $ID . ".php";
             if (file_exists($tmp_filename)) {
                 @unlink($tmp_filename);
             }
             // delete form statuses
             $rsStatuses = CFormStatus::GetList($ID, $by, $order, $arFilter, $is_filtered);
             while ($arStatus = $rsStatuses->Fetch()) {
                 CFormStatus::Delete($arStatus["ID"], "N");
             }
             // delete from fields & questions
             $rsFields = CFormField::GetList($ID, "ALL", $by, $order, array(), $is_filtered);
             while ($arField = $rsFields->Fetch()) {
                 CFormField::Delete($arField["ID"], "N");
             }
             // delete form image
             $strSql = "SELECT IMAGE_ID FROM b_form WHERE ID='{$ID}' and IMAGE_ID>0";
             $z = $DB->Query($strSql, false, $err_mess . __LINE__);
             while ($zr = $z->Fetch()) {
                 CFile::Delete($zr["IMAGE_ID"]);
             }
             // delete mail event type and mail templates, assigned to the current form
             $q = CForm::GetByID($ID);
             $qr = $q->Fetch();
             if (strlen(trim($qr["MAIL_EVENT_TYPE"])) > 0) {
                 // delete mail templates
                 $em = new CEventMessage();
                 $e = $em->GetList($by = "id", $order = "desc", array("EVENT_NAME" => $qr["MAIL_EVENT_TYPE"], "EVENT_NAME_EXACT_MATCH" => "Y"));
                 while ($er = $e->Fetch()) {
                     $em->Delete($er["ID"]);
                 }
                 // delete mail event type
                 $et = new CEventType();
                 $et->Delete($qr["MAIL_EVENT_TYPE"]);
             }
             // delete site assignment
             $DB->Query("DELETE FROM b_form_2_site WHERE FORM_ID='{$ID}'", false, $err_mess . __LINE__);
             // delete mail templates assignment
             $DB->Query("DELETE FROM b_form_2_mail_template WHERE FORM_ID='{$ID}'", false, $err_mess . __LINE__);
             // delete form menu
             $DB->Query("DELETE FROM b_form_menu WHERE FORM_ID='{$ID}'", false, $err_mess . __LINE__);
             // delete from rights
             $DB->Query("DELETE FROM b_form_2_group WHERE FORM_ID='{$ID}'", false, $err_mess . __LINE__);
             // and finally delete form
             $DB->Query("DELETE FROM b_form WHERE ID='{$ID}'", false, $err_mess . __LINE__);
             return true;
         }
     } else {
         $strError .= GetMessage("FORM_ERROR_ACCESS_DENIED") . "<br>";
     }
     return false;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:60,代码来源:form_callform.php


注:本文中的CForm::Reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。