當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CSite::GetNameFormatByValue方法代碼示例

本文整理匯總了PHP中CSite::GetNameFormatByValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSite::GetNameFormatByValue方法的具體用法?PHP CSite::GetNameFormatByValue怎麽用?PHP CSite::GetNameFormatByValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CSite的用法示例。


在下文中一共展示了CSite::GetNameFormatByValue方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

if (empty($errors)) {
    $culture = false;
    if ($ID > 0 || $COPY_ID > 0) {
        $cultureId = $COPY_ID > 0 ? $COPY_ID : $ID;
        $culture = CultureTable::getById($cultureId)->fetch();
    }
    if ($culture == false) {
        $weekStart = Loc::getMessage('LANG_EDIT_WEEK_START_DEFAULT');
        if ($weekStart == '') {
            $weekStart = 1;
        }
        $culture = array("WEEK_START" => $weekStart, "FORMAT_NAME" => CSite::GetDefaultNameFormat());
    }
} else {
    $culture = $request->getPostList()->toArray();
    $culture["FORMAT_NAME"] = CSite::GetNameFormatByValue($request["FORMAT_NAME"]);
}
$APPLICATION->SetTitle($ID > 0 ? Loc::getMessage("EDIT_LANG_TITLE") : Loc::getMessage("NEW_LANG_TITLE"));
require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/prolog_admin_after.php";
$aMenu = array(array("TEXT" => Loc::getMessage("RECORD_LIST"), "LINK" => "/bitrix/admin/culture_admin.php?lang=" . LANGUAGE_ID, "TITLE" => Loc::getMessage("RECORD_LIST_TITLE"), "ICON" => "btn_list"));
if ($ID > 0 && $isAdmin) {
    $aMenu[] = array("SEPARATOR" => "Y");
    $aMenu[] = array("TEXT" => Loc::getMessage("MAIN_NEW_RECORD"), "LINK" => "/bitrix/admin/culture_edit.php?lang=" . LANGUAGE_ID, "TITLE" => Loc::getMessage("MAIN_NEW_RECORD_TITLE"), "ICON" => "btn_new");
    $aMenu[] = array("TEXT" => Loc::getMessage("MAIN_COPY_RECORD"), "LINK" => "/bitrix/admin/culture_edit.php?lang=" . LANGUAGE_ID . "&COPY_ID=" . $ID, "TITLE" => Loc::getMessage("MAIN_COPY_RECORD_TITLE"), "ICON" => "btn_copy");
    $aMenu[] = array("TEXT" => Loc::getMessage("MAIN_DELETE_RECORD"), "LINK" => "javascript:if(confirm('" . CUtil::JSEscape(Loc::getMessage("MAIN_DELETE_RECORD_CONF")) . "')) window.location='/bitrix/admin/culture_admin.php?ID=" . $ID . "&lang=" . LANGUAGE_ID . "&" . bitrix_sessid_get() . "&action_button=delete';", "TITLE" => Loc::getMessage("MAIN_DELETE_RECORD_TITLE"), "ICON" => "btn_delete");
}
$context = new CAdminContextMenu($aMenu);
$context->Show();
if (!empty($errors)) {
    CAdminMessage::ShowMessage(join("\n", $errors));
}
開發者ID:spas-viktor,項目名稱:books,代碼行數:31,代碼來源:culture_edit.php

示例2: elseif

	if(!$lng->ExtractFields("str_"))
		$bNew = true;
}
elseif(!$bNew)
{
	$lng = CSite::GetByID($LID);
	if(!$lng->ExtractFields("str_"))
		$bNew = true;
}

if($bVarsFromForm)
{
	$DB->InitTableVarsForEdit("b_lang", "", "str_");
	$str_DOMAINS = htmlspecialcharsbx($DOMAINS);
	$str_SERVER_NAME = htmlspecialcharsbx($_POST["SERVER_NAME"]);
	$str_FORMAT_NAME = CSite::GetNameFormatByValue($_POST["FORMAT_NAME"]);
}

$APPLICATION->SetTitle(($bNew? GetMessage("NEW_SITE_TITLE") : GetMessage("EDIT_SITE_TITLE", array("#ID#"=>$str_LID))));

require($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/include/prolog_admin_after.php");

if($bNew)
{
	$sites_cnt = 0;
	$r = CSite::GetList($o1, $b1, array("ACTIVE"=>"Y"));
	while($r->Fetch())
		$sites_cnt++;
}

$aMenu = array(
開發者ID:ASDAFF,項目名稱:bitrix-5,代碼行數:31,代碼來源:site_edit.php


注:本文中的CSite::GetNameFormatByValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。