本文整理汇总了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));
}
示例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(