本文整理汇总了PHP中CForm::Check方法的典型用法代码示例。如果您正苦于以下问题:PHP CForm::Check方法的具体用法?PHP CForm::Check怎么用?PHP CForm::Check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CForm
的用法示例。
在下文中一共展示了CForm::Check方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getData
function getData(&$arResult)
{
global $APPLICATION, $USER;
//$arResult = $this->__prepareDataForTpl();
$arResult["WEB_FORM_ID"] = $this->WEB_FORM_ID;
$arResult["WEB_FORM_NAME"] = $this->WEB_FORM_NAME;
if ($this->RESULT_ID > 0) {
$arResult["RESULT_ID"] = $this->RESULT_ID;
}
$arResult["F_RIGHT"] = $this->F_RIGHT;
if (strlen($_REQUEST["web_form_submit"]) > 0 || strlen($_REQUEST["web_form_apply"]) > 0) {
$this->arrVALUES = $_REQUEST;
if ($this->RESULT_ID) {
$this->__form_validate_errors = CForm::Check($this->WEB_FORM_ID, $this->arrVALUES, $this->RESULT_ID);
} else {
$this->__form_validate_errors = CForm::Check($this->WEB_FORM_ID, $this->arrVALUES);
}
if (!$this->isFormErrors()) {
if (check_bitrix_sessid()) {
$return = false;
if ($this->RESULT_ID) {
CFormResult::Update($this->RESULT_ID, $this->arrVALUES, $this->arParams["EDIT_ADDITIONAL"]);
$this->strFormNote = GetMessage("FORM_DATA_SAVED");
if (strlen($_REQUEST["web_form_submit"]) > 0 && !(defined("ADMIN_SECTION") && ADMIN_SECTION === true)) {
if ($this->arParams["SEF_MODE"] == "Y") {
LocalRedirect($this->arParams["LIST_URL"] . "?strFormNote=" . urlencode($this->strFormNote));
} else {
LocalRedirect($this->arParams["LIST_URL"] . (strpos($this->arParams["LIST_URL"], "?") === false ? "?" : "&") . "WEB_FORM_ID=" . $this->WEB_FORM_ID . "&strFormNote=" . urlencode($this->strFormNote));
}
die;
}
if (strlen($_REQUEST["web_form_apply"]) > 0 && !(defined("ADMIN_SECTION") && ADMIN_SECTION === true) && $this->arParams["SEF_MODE"] == "Y") {
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
LocalRedirect($this->arParams["EDIT_URL"] . (strpos($this->arParams["EDIT_URL"], "?") === false ? "?" : "&") . "strFormNote=" . urlencode($this->strFormNote));
die;
}
if (defined("ADMIN_SECTION") && ADMIN_SECTION === true) {
if (strlen($_REQUEST["web_form_submit"]) > 0) {
LocalRedirect(BX_ROOT . "/admin/form_result_list.php?lang=" . LANG . "&WEB_FORM_ID=" . $this->WEB_FORM_ID . "&strFormNote=" . urlencode($this->strFormNote));
} elseif (strlen($_REQUEST["web_form_apply"]) > 0) {
LocalRedirect(BX_ROOT . "/admin/form_result_edit.php?lang=" . LANG . "&WEB_FORM_ID=" . $this->WEB_FORM_ID . "&RESULT_ID=" . $this->RESULT_ID . "&strFormNote=" . urlencode($this->strFormNote));
}
die;
}
} else {
if ($this->RESULT_ID = CFormResult::Add($this->WEB_FORM_ID, $this->arrVALUES)) {
$this->strFormNote = GetMessage("FORM_DATA_SAVED1") . $this->RESULT_ID . GetMessage("FORM_DATA_SAVED2");
CFormResult::SetEvent($this->RESULT_ID);
CFormResult::Mail($this->RESULT_ID);
if ($this->F_RIGHT >= 15) {
if (strlen($_REQUEST["web_form_submit"]) > 0 && strlen($this->arParams["LIST_URL"]) > 0) {
if ($this->arParams["SEF_MODE"] == "Y") {
LocalRedirect($this->arParams["LIST_URL"] . "?strFormNote=" . urlencode($this->strFormNote));
} else {
LocalRedirect($this->arParams["LIST_URL"] . (strpos($this->arParams["LIST_URL"], "?") === false ? "?" : "&") . "WEB_FORM_ID=" . $this->WEB_FORM_ID . "&RESULT_ID=" . $this->RESULT_ID . "&strFormNote=" . urlencode($this->strFormNote));
}
die;
} elseif (strlen($_REQUEST["web_form_apply"]) > 0 && strlen($this->arParams["EDIT_URL"]) > 0) {
if ($this->arParams["SEF_MODE"] == "Y") {
LocalRedirect(str_replace("#RESULT_ID#", $this->RESULT_ID . $this->arParams["EDIT_URL"]) . "?strFormNote=" . urlencode($this->strFormNote));
} else {
LocalRedirect($this->arParams["EDIT_URL"] . (strpos($this->arParams["EDIT_URL"], "?") === false ? "?" : "&") . "RESULT_ID=" . $this->RESULT_ID . "&strFormNote=" . urlencode($this->strFormNote));
}
die;
}
$arResult["return"] = true;
} else {
LocalRedirect($APPLICATION->GetCurPage() . "?WEB_FORM_ID=" . $this->WEB_FORM_ID . "&strFormNote=" . urlencode($this->strFormNote));
die;
}
} else {
$this->__form_validate_errors = $GLOBALS["strError"];
}
}
}
}
}
return $arResult;
}
示例2: count
}
}
// if there's no error
if (strlen($arResult["ERROR"]) <= 0)
{
// ************************************************************* //
// get/post processing //
// ************************************************************* //
if (strlen($_REQUEST["web_form_submit"])>0 || strlen($_REQUEST["web_form_apply"])>0)
{
$arResult["arrVALUES"] = $_REQUEST;
// check errors
$arResult["FORM_ERRORS"] = CForm::Check($arParams["WEB_FORM_ID"], $arResult["arrVALUES"], $arParams["RESULT_ID"], "Y", $arParams['USE_EXTENDED_ERRORS']);
if (
$arParams['USE_EXTENDED_ERRORS'] == 'Y' && (!is_array($arResult["FORM_ERRORS"]) || count($arResult["FORM_ERRORS"]) <= 0)
||
$arParams['USE_EXTENDED_ERRORS'] != 'Y' && strlen($arResult["FORM_ERRORS"]) <= 0
)
{
// check session id
if (check_freetrix_sessid())
{
$return = false;
if (CFormResult::Update($arParams["RESULT_ID"], $arResult["arrVALUES"], $arParams["EDIT_ADDITIONAL"]))
{
$arResult["FORM_RESULT"] = 'editok';
示例3: checkErrors
/**
* Валидируем POST данные
* @param array $values
* @return bool
*/
protected function checkErrors(array $values)
{
$this->errors = \CForm::Check($this->formId, $values, false, 'Y', 'Y');
return !is_array($this->errors) || count($this->errors) <= 0;
}