本文整理匯總了PHP中CCurrencyLang::GetByID方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCurrencyLang::GetByID方法的具體用法?PHP CCurrencyLang::GetByID怎麽用?PHP CCurrencyLang::GetByID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCurrencyLang
的用法示例。
在下文中一共展示了CCurrencyLang::GetByID方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: GetCurrencyFormat
function GetCurrencyFormat($currency, $lang = LANGUAGE_ID)
{
global $DB;
global $stackCacheManager;
if (defined("CURRENCY_SKIP_CACHE") && CURRENCY_SKIP_CACHE) {
$arCurrencyLang = CCurrencyLang::GetByID($currency, $lang);
} else {
$cacheTime = CURRENCY_CACHE_DEFAULT_TIME;
if (defined("CURRENCY_CACHE_TIME")) {
$cacheTime = intval(CURRENCY_CACHE_TIME);
}
$strCacheKey = $currency . "_" . $lang;
$stackCacheManager->SetLength("currency_currency_lang", 20);
$stackCacheManager->SetTTL("currency_currency_lang", $cacheTime);
if ($stackCacheManager->Exist("currency_currency_lang", $strCacheKey)) {
$arCurrencyLang = $stackCacheManager->Get("currency_currency_lang", $strCacheKey);
} else {
$arCurrencyLang = CCurrencyLang::GetByID($currency, $lang);
$stackCacheManager->Set("currency_currency_lang", $strCacheKey, $arCurrencyLang);
}
}
return $arCurrencyLang;
}
示例2: ShowError
die;
}
$this->setFramemode(false);
if (!CModule::IncludeModule("sale")) {
ShowError(GetMessage("SALE_MODULE_NOT_INSTALL"));
return;
}
if (!CBXFeatures::IsFeatureEnabled('SaleAccounts')) {
return;
}
if (!$USER->IsAuthorized()) {
$APPLICATION->AuthForm(GetMessage("SALE_ACCESS_DENIED"), false, false, 'N', false);
}
$arParams["SET_TITLE"] = $arParams["SET_TITLE"] == "N" ? "N" : "Y";
if ($arParams["SET_TITLE"] == 'Y') {
$APPLICATION->SetTitle(GetMessage("SPA_TITLE"));
}
$dbAccountList = CSaleUserAccount::GetList(array("CURRENCY" => "ASC"), array("USER_ID" => IntVal($USER->GetID())), false, false, array("ID", "CURRENT_BUDGET", "CURRENCY", "TIMESTAMP_X"));
if ($arAccountList = $dbAccountList->GetNext()) {
$arResultTmp = array();
$arResult["DATE"] = str_replace("#DATE#", date(CDatabase::DateFormatToPHP(CSite::GetDateFormat("SHORT", SITE_ID))), GetMessage("SPA_MY_ACCOUNT"));
do {
$arResultTmp["CURRENCY"] = CCurrencyLang::GetByID($arAccountList["CURRENCY"], LANGUAGE_ID);
$arResultTmp["ACCOUNT_LIST"] = $arAccountList;
$arResultTmp["INFO"] = str_replace("#CURRENCY#", $arResultTmp["CURRENCY"]["CURRENCY"] . " (" . $arResultTmp["CURRENCY"]["FULL_NAME"] . ")", str_replace("#SUM#", SaleFormatCurrency($arAccountList["CURRENT_BUDGET"], $arAccountList["CURRENCY"]), GetMessage("SPA_IN_CUR")));
$arResult["ACCOUNT_LIST"][] = $arResultTmp;
} while ($arAccountList = $dbAccountList->GetNext());
} else {
$arResult["ERROR_MESSAGE"] = GetMessage("SPA_NO_ACCOUNT");
}
$this->IncludeComponentTemplate();
示例3: elseif
}
$param = 'THOUSANDS_SEP_' . $lid;
if (!isset($locFields['THOUSANDS_VARIANT']) && isset($_POST[$param])) {
$locFields['THOUSANDS_SEP'] = $_POST[$param];
}
if (count($locFields) == 0) {
continue;
}
if (!(isset($locFields['FULL_NAME']) && isset($locFields['FULL_NAME'][0]))) {
$locFields['FULL_NAME'] = $currencyID;
}
$currencyLocs[$k] = $locFields;
if ($result) {
$locFields['CURRENCY'] = $currencyID;
$locFields['LID'] = $k;
if (is_array(CCurrencyLang::GetByID($currencyID, $k))) {
CCurrencyLang::Update($currencyID, $k, $locFields);
} else {
$locFields['DECIMALS'] = 2;
//Default decimals
CCurrencyLang::Add($locFields);
}
}
}
if ($result) {
if ($currency['IS_ACCOUNTING_CURRENCY'] && $currencyID !== CCrmCurrency::GetAccountCurrencyID()) {
CCrmCurrency::SetAccountCurrencyID($currencyID);
} elseif (!$currency['IS_ACCOUNTING_CURRENCY'] && $currencyID === CCrmCurrency::GetAccountCurrencyID()) {
CCrmCurrency::SetAccountCurrencyID(CCrmCurrency::GetBaseCurrencyID());
}
if ($currency['IS_INVOICE_CURRENCY'] && $currencyID !== CCrmCurrency::getInvoiceDefault()) {
示例4: DeleteCurrencyLocalizations
public static function DeleteCurrencyLocalizations($currencyID, $arLangs)
{
if (!CModule::IncludeModule('currency')) {
return false;
}
if (!is_array($arLangs) || empty($arLangs)) {
return false;
}
$langsID = self::GetLanguagesID();
$processed = 0;
foreach ($langsID as $langID) {
if (!in_array($langID, $arLangs, true) || !is_array(CCurrencyLang::GetByID($currencyID, $langID))) {
continue;
}
if (CCurrencyLang::Delete($currencyID, $langID)) {
$processed++;
}
}
return $processed > 0;
}
示例5: Trim
$arFields["FORMAT_STRING"] = Trim(${"FORMAT_STRING_".$arLangsLID[$i]});
$arFields["FULL_NAME"] = Trim(${"FULL_NAME_".$arLangsLID[$i]});
$arFields["DEC_POINT"] = ${"DEC_POINT_".$arLangsLID[$i]};
$arFields["THOUSANDS_SEP"] = ${"THOUSANDS_SEP_".$arLangsLID[$i]};
$arFields["THOUSANDS_VARIANT"] = ${"THOUSANDS_VARIANT_".$arLangsLID[$i]};
$arFields["DECIMALS"] = IntVal(${"DECIMALS_".$arLangsLID[$i]});
$arFields["CURRENCY"] = $ID /*$arFields["CURRENCY"]*/;
$arFields["LID"] = $arLangsLID[$i];
if(strlen($arFields["THOUSANDS_VARIANT"]) > 0)
$arFields["THOUSANDS_SEP"] = false;
else
$arFields["THOUSANDS_VARIANT"] = false;
if (strlen($ID) > 0)
{
$db_result_lang = CCurrencyLang::GetByID($ID, $arLangsLID[$i]);
if ($db_result_lang)
CCurrencyLang::Update($ID, $arLangsLID[$i], $arFields);
else
CCurrencyLang::Add($arFields);
}
else
{
CCurrencyLang::Add($arFields);
}
}
if(strlen($apply)<=0)
LocalRedirect("/bitrix/admin/trigger_list.php?lang=". LANG);
LocalRedirect("/bitrix/admin/trigger_edit.php?ID=".$ID."&lang=".LANG);