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


PHP CForm::GetFormTemplateByID方法代码示例

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


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

示例1: array

    $str_USE_CAPTCHA = "N";
    $str_USE_DEFAULT_TEMPLATE = "N";
    $str_USE_RESTRICTIONS = "N";
    $str_RESTRICT_USER = 0;
    $str_RESTRICT_TIME = 0;
    $arRESTRICT_STATUS = array();
} else {
    if (strlen($strError) <= 0) {
        $z = CForm::GetMenuList(array("FORM_ID" => $ID), "N");
        while ($zr = $z->Fetch()) {
            ${"MENU_" . $zr["LID"]} = $zr["MENU"];
        }
        $arSITE = CForm::GetSiteArray($ID);
        $arMAIL_TEMPLATE = CForm::GetMailTemplateArray($ID);
        if (!is_set($str_FORM_TEMPLATE)) {
            $str_FORM_TEMPLATE = CForm::GetFormTemplateByID($ID);
        }
        $arRESTRICT_STATUS = explode(",", $str_RESTRICT_STATUS);
    }
}
if (strlen($strError) > 0) {
    $DB->InitTableVarsForEdit("b_form", "", "str_");
}
if ($ID > 0) {
    $sDocTitle = str_replace("#ID#", $ID, GetMessage("FORM_EDIT_RECORD"));
    $sDocTitle = str_replace("#NAME#", $str_NAME, $sDocTitle);
} else {
    $sDocTitle = GetMessage("FORM_NEW_RECORD");
}
$APPLICATION->SetTitle($sDocTitle);
if ($ID > 0) {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:form_edit.php

示例2: Copy

 function Copy($ID, $CHECK_RIGHTS = "Y")
 {
     global $DB, $APPLICATION, $strError;
     $err_mess = CAllForm::err_mess() . "<br>Function: Copy<br>Line: ";
     $ID = intval($ID);
     if ($CHECK_RIGHTS != "Y" || CForm::IsAdmin()) {
         $rsForm = CForm::GetByID($ID);
         $arForm = $rsForm->Fetch();
         if (!is_set($arForm, "FORM_TEMPLATE")) {
             $arForm["FORM_TEMPLATE"] = CForm::GetFormTemplateByID($ID);
         }
         // символьный код формы
         while (true) {
             $SID = $arForm["SID"];
             if (strlen($SID) > 25) {
                 $SID = substr($SID, 0, 25);
             }
             $SID .= "_" . RandString(5);
             $strSql = "SELECT 'x' FROM b_form WHERE SID='" . $DB->ForSql($SID, 50) . "'";
             $z = $DB->Query($strSql, false, $err_mess . __LINE__);
             if (!($zr = $z->Fetch())) {
                 break;
             }
         }
         $arFields = array("NAME" => $arForm["NAME"], "SID" => $SID, "C_SORT" => $arForm["C_SORT"], "FIRST_SITE_ID" => $arForm["FIRST_SITE_ID"], "BUTTON" => $arForm["BUTTON"], "USE_CAPTCHA" => $arForm["USE_CAPTCHA"], "DESCRIPTION" => $arForm["DESCRIPTION"], "DESCRIPTION_TYPE" => $arForm["DESCRIPTION_TYPE"], "SHOW_TEMPLATE" => $arForm["SHOW_TEMPLATE"], "FORM_TEMPLATE" => $arForm["FORM_TEMPLATE"], "USE_DEFAULT_TEMPLATE" => $arForm["USE_DEFAULT_TEMPLATE"], "SHOW_RESULT_TEMPLATE" => $arForm["SHOW_RESULT_TEMPLATE"], "PRINT_RESULT_TEMPLATE" => $arForm["PRINT_RESULT_TEMPLATE"], "EDIT_RESULT_TEMPLATE" => $arForm["EDIT_RESULT_TEMPLATE"], "FILTER_RESULT_TEMPLATE" => $arForm["FILTER_RESULT_TEMPLATE"], "TABLE_RESULT_TEMPLATE" => $arForm["TABLE_RESULT_TEMPLATE"], "STAT_EVENT1" => $arForm["STAT_EVENT1"], "STAT_EVENT2" => $SID, "STAT_EVENT3" => $arForm["STAT_EVENT3"], "arSITE" => CForm::GetSiteArray($ID));
         // пункты меню
         $z = CForm::GetMenuList(array("FORM_ID" => $ID), "N");
         while ($zr = $z->Fetch()) {
             $arFields["arMENU"][$zr["LID"]] = $zr["MENU"];
         }
         // права групп
         $w = CGroup::GetList($v1 = "dropdown", $v2 = "asc", array("ADMIN" => "N"), $v3);
         $arGroups = array();
         while ($wr = $w->Fetch()) {
             $arGroups[] = $wr["ID"];
         }
         if (is_array($arGroups)) {
             foreach ($arGroups as $gid) {
                 $arFields["arGROUP"][$gid] = CForm::GetPermission($ID, array($gid), "Y");
             }
         }
         // картинка
         if (intval($arForm["IMAGE_ID"]) > 0) {
             $arIMAGE = CFile::MakeFileArray(CFile::CopyFile($arForm["IMAGE_ID"]));
             $arIMAGE["MODULE_ID"] = "form";
             $arFields["arIMAGE"] = $arIMAGE;
         }
         $NEW_ID = CForm::Set($arFields, 0);
         if (intval($NEW_ID) > 0) {
             // статусы
             $rsStatus = CFormStatus::GetList($ID, $by, $order, array(), $is_filtered);
             while ($arStatus = $rsStatus->Fetch()) {
                 CFormStatus::Copy($arStatus["ID"], "N", $NEW_ID);
             }
             // вопросы/пол¤
             $rsField = CFormField::GetList($ID, "ALL", $by, $order, array(), $is_filtered);
             while ($arField = $rsField->Fetch()) {
                 CFormField::Copy($arField["ID"], "N", $NEW_ID);
             }
         }
         return $NEW_ID;
     } else {
         $strError .= GetMessage("FORM_ERROR_ACCESS_DENIED") . "<br>";
     }
     return false;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:66,代码来源:form_callform.php

示例3: array

	$str_USE_DEFAULT_TEMPLATE = "N";
	$str_USE_RESTRICTIONS = "N";
	$str_RESTRICT_USER = 0;
	$str_RESTRICT_TIME = 0;
	$arRESTRICT_STATUS = array();
}
else
{
	if (strlen($strError)<=0)
	{
		$z = CForm::GetMenuList(array("FORM_ID"=>$ID), "N");
		while ($zr = $z->Fetch()) ${"MENU_".$zr["LID"]} = $zr["MENU"];

		$arSITE = CForm::GetSiteArray($ID);
		$arMAIL_TEMPLATE = CForm::GetMailTemplateArray($ID);
		if (!is_set($str_FORM_TEMPLATE)) $str_FORM_TEMPLATE = CForm::GetFormTemplateByID($ID);

		$arRESTRICT_STATUS = explode(",", $str_RESTRICT_STATUS);
	}
}

if (strlen($strError)>0) $DB->InitTableVarsForEdit("b_form", "", "str_");

if ($ID>0)
{
	$sDocTitle = str_replace("#ID#", $ID, GetMessage("FORM_EDIT_RECORD"));
	$sDocTitle = str_replace("#NAME#", $str_NAME, $sDocTitle);
}
else $sDocTitle = GetMessage("FORM_NEW_RECORD");

$APPLICATION->SetTitle($sDocTitle);
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:form_edit.php


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