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


PHP CCurrencyLang::getFormatDescription方法代碼示例

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


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

示例1: getScripts

    /**
     * @param Order $order
     * @param $formId
     * @return string
     */
    public static function getScripts(Order $order, $formId)
    {
        Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_edit.js");
        Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_ajaxer.js");
        $currencyId = $order->getCurrency();
        $currencies = array();
        if (Loader::includeModule('currency')) {
            \CJSCore::Init(array('currency'));
            $currencyFormat = \CCurrencyLang::getFormatDescription($currencyId);
            $currencies = array(array('CURRENCY' => $currencyId, 'FORMAT' => array('FORMAT_STRING' => $currencyFormat['FORMAT_STRING'], 'DEC_POINT' => $currencyFormat['DEC_POINT'], 'THOUSANDS_SEP' => $currencyFormat['THOUSANDS_SEP'], 'DECIMALS' => $currencyFormat['DECIMALS'], 'THOUSANDS_VARIANT' => $currencyFormat['THOUSANDS_VARIANT'], 'HIDE_ZERO' => "N")));
        }
        $curFormat = \CCurrencyLang::getCurrencyFormat($currencyId);
        $currencyLang = trim(str_replace("#", '', $curFormat["FORMAT_STRING"]));
        $langPhrases = array("SALE_ORDEREDIT_DISCOUNT_UNKNOWN", "SALE_ORDEREDIT_REFRESHING_DATA", "SALE_ORDEREDIT_FIX", "SALE_ORDEREDIT_UNFIX");
        $result = '
			<script type="text/javascript">
				BX.ready(function(){
					BX.Sale.Admin.OrderEditPage.orderId = "' . $order->getId() . '";
					BX.Sale.Admin.OrderEditPage.siteId = "' . $order->getSiteId() . '";
					BX.Sale.Admin.OrderEditPage.languageId = "' . LANGUAGE_ID . '";
					BX.Sale.Admin.OrderEditPage.formId = "' . $formId . '_form";
					BX.Sale.Admin.OrderEditPage.adminTabControlId = "' . $formId . '";
					' . (!empty($currencies) ? 'BX.Currency.setCurrencies(' . \CUtil::PhpToJSObject($currencies, false, true, true) . ');' : '') . 'BX.Sale.Admin.OrderEditPage.currency = "' . $currencyId . '";
					BX.Sale.Admin.OrderEditPage.currencyLang = "' . \CUtil::JSEscape($currencyLang) . '";';
        if ($formId == "sale_order_create") {
            $result .= '
					BX.Sale.Admin.OrderEditPage.registerFieldsUpdaters(BX.Sale.Admin.OrderPayment.prototype.getCreateOrderFieldsUpdaters());';
        }
        foreach ($langPhrases as $phrase) {
            $result .= ' BX.message({' . $phrase . ': "' . \CUtil::JSEscape(Loc::getMessage($phrase)) . '"});';
        }
        $result .= '});
			</script>
		';
        return $result;
    }
開發者ID:webgksupport,項目名稱:alpina,代碼行數:41,代碼來源:orderedit.php


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