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


PHP CForm::GetMenuList方法代码示例

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


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

示例1: GetMessage

$arForm = CForm::GetByID_admin($ID, 'form');
if (!$arForm || !extract($arForm, EXTR_PREFIX_ALL, 'str')) {
    $ID = 0;
    $str_STAT_EVENT1 = "form";
    $str_DESCRIPTION_TYPE = "text";
    $str_BUTTON = GetMessage("FORM_SAVE");
    $str_C_SORT = CForm::GetNextSort();
    $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) {
开发者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: IncludeModuleLangFile

<?php

IncludeModuleLangFile(__FILE__);
if ($APPLICATION->GetGroupRight("form") > "D") {
    $aMenu = array("parent_menu" => "global_menu_services", "section" => "form", "sort" => 100, "text" => GetMessage("FORM_MENU_MAIN"), "title" => GetMessage("FORM_MENU_MAIN_TITLE"), "icon" => "form_menu_icon", "page_icon" => "form_page_icon", "module_id" => "form", "items_id" => "menu_webforms", "items" => array());
    $arFormsList = array();
    if (method_exists($this, "IsSectionActive") && $this->IsSectionActive("menu_webforms_list") || defined('BX_ADMIN_FORM_MENU_OPEN') && BX_ADMIN_FORM_MENU_OPEN == 1) {
        CModule::IncludeModule('form');
        $z = CForm::GetMenuList(array("LID" => LANGUAGE_ID));
        while ($zr = $z->GetNext()) {
            if (strlen($zr["MENU"]) > 0) {
                $alt = str_replace("#NAME#", $zr["NAME"], htmlspecialcharsbx(GetMessage("FORM_RESULTS_ALT")));
                $arFormsList[] = array("text" => $zr["MENU"], "url" => "form_result_list.php?lang=" . LANGUAGE_ID . "&amp;WEB_FORM_ID=" . $zr["ID"], "page_icon" => "form_page_icon", "more_url" => array("form_result_list.php?WEB_FORM_ID=" . $zr["ID"], "form_result_edit.php?WEB_FORM_ID=" . $zr["ID"], "form_result_print.php?WEB_FORM_ID=" . $zr["ID"], "form_result_view.php?WEB_FORM_ID=" . $zr["ID"]), "title" => $alt);
            }
        }
    }
    $aMenu["items"][] = array("text" => GetMessage("FORM_RESULTS_ALL"), "dynamic" => true, "module_id" => "form", "title" => GetMessage("FORM_RESULTS_ALL_ALT"), "items_id" => "menu_webforms_list", "items" => $arFormsList, "more_url" => array("form_result_list.php", "form_result_edit.php"));
    $aMenu["items"][] = array("text" => GetMessage("FORM_MENU_FORMS"), "url" => "form_list.php?lang=" . LANGUAGE_ID, "more_url" => array("form_edit.php", "form_field_list.php", "form_field_edit.php", "form_field_edit_simple.php", "form_status_list.php", "form_status_edit.php"), "title" => GetMessage("FORM_MENU_FORMS_ALT"));
    return $aMenu;
}
return false;
开发者ID:Satariall,项目名称:izurit,代码行数:21,代码来源:menu.php


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