本文整理汇总了PHP中Bitrix\Main\Page\Asset::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset::getInstance方法的具体用法?PHP Asset::getInstance怎么用?PHP Asset::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Main\Page\Asset
的用法示例。
在下文中一共展示了Asset::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onBeforeEndBufferContent
public function onBeforeEndBufferContent()
{
global $USER;
if ($USER->IsAuthorized()) {
Asset::getInstance()->addString("<script>(window.BX||top.BX).message({ 'USER_ID': '" . $USER->GetID() . "'});</script>", $unique = false, AssetLocation::AFTER_JS, AssetMode::ALL);
}
}
示例2: onBeforeHTMLEditorScriptRuns
public static function onBeforeHTMLEditorScriptRuns()
{
$asset = Asset::getInstance();
$asset->addJs('/bitrix/js/newkaliningrad.typografru/typograf.js');
$messages = Loc::loadLanguageFile(Path::normalize(__FILE__));
$asset->addString(sprintf('<script>BX.message(%s)</script>', Json::encode($messages, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE)));
}
示例3: initScripts
public static function initScripts($arData)
{
global $APPLICATION;
$arExt = array('planner');
$arScripts = array();
if (is_array($arData['SCRIPTS'])) {
foreach ($arData['SCRIPTS'] as $script) {
if (CJSCore::IsExtRegistered($script)) {
$arExt[] = $script;
} else {
$arScripts[] = $script;
}
}
}
if (is_array($arData['STYLES'])) {
foreach ($arData['STYLES'] as $style) {
$APPLICATION->SetAdditionalCSS($style);
}
}
\Bitrix\Main\Page\Asset::getInstance()->addJsKernelInfo('calendar_planner_handler', array('/bitrix/js/calendar/core_planner_handler.js'));
\Bitrix\Main\Page\Asset::getInstance()->addCssKernelInfo('calendar_planner_handler', array('/bitrix/js/calendar/core_planner_handler.css'));
CJSCore::Init($arExt);
foreach ($arScripts as $script) {
$APPLICATION->AddHeadScript($script);
}
}
示例4: initControlHelpers
private function initControlHelpers()
{
if (!static::$controlIsRendered) {
Asset::getInstance()->addJs('/bitrix/js/iblock/iblock_edit.js');
static::$controlIsRendered = true;
}
}
示例5: getScripts
/**
* @return string
*/
public static function getScripts()
{
\Bitrix\Main\Page\Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_info.js");
return '
<script type="text/javascript">
BX.ready(function(){
BX.Sale.Admin.OrderEditPage.registerFieldsUpdaters( BX.Sale.Admin.OrderInfo.getFieldsUpdaters() );
});
</script>
';
}
示例6: getScripts
public static function getScripts()
{
$result = '';
if (!static::$jsInited) {
\Bitrix\Main\Page\Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_basket_settings.js");
$result .= '
BX.message({
SALE_ORDER_BASKET_JS_SETTINGS_TITLE: "' . \CUtil::JSEscape(Loc::getMessage("SALE_ORDER_BASKET_JS_SETTINGS_TITLE")) . '",
SALE_ORDER_BASKET_JS_SETTINGS_APPLY: "' . \CUtil::JSEscape(Loc::getMessage("SALE_ORDER_BASKET_JS_SETTINGS_APPLY")) . '"
});
';
static::$jsInited = true;
}
return $result;
}
示例7: processActionDefault
protected function processActionDefault()
{
$pathToAjax = isset($this->arParams['AJAX_PATH']) ? $this->arParams['AJAX_PATH'] : '/bitrix/components/bitrix/disk.bitrix24disk/ajax.php';
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
$quota = CDiskQuota::getDiskQuota();
$this->arResult['showDiskQuota'] = false;
//$quota !== true; //now without quota
$this->arResult['diskSpace'] = (double) COption::getOptionInt('main', 'disk_space') * 1024 * 1024;
$this->arResult['quota'] = $quota;
$this->arResult['ajaxIndex'] = $pathToAjax;
$this->arResult['ajaxStorageIndex'] = '/desktop_app/storage.php';
$this->arResult['isInstalledDisk'] = \Bitrix\Disk\Desktop::isDesktopDiskInstall();
$this->arResult['personalLibIndex'] = '/company/personal/user/' . $this->getUser()->getId() . '/disk/path/';
$this->arResult['isInstalledPull'] = (bool) isModuleInstalled('pull');
$this->arResult['currentUser'] = array('id' => $this->getUser()->getId(), 'formattedName' => $this->getUser()->getFormattedName());
Asset::getInstance()->addJs('/bitrix/components/bitrix/disk.bitrix24disk/disk.js');
$this->includeComponentTemplate();
}
示例8: 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;
}
示例9: GetMessageJS
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
\Bitrix\Main\Page\Asset::getInstance()->addJs('/bitrix/js/bizproc/tools.js');
$cmpId = RandString();
if (empty($arResult['DOCUMENT_ICON'])) {
$moduleIcon = 'default';
if (in_array($arResult['TASK']['MODULE_ID'], array('crm', 'disk', 'iblock', 'lists', 'tasks'))) {
$moduleIcon = $arResult['TASK']['MODULE_ID'];
}
$arResult['DOCUMENT_ICON'] = $templateFolder . '/images/bp-' . $moduleIcon . '-icon.png';
}
?>
<script type="text/javascript">
BX.message({
BPAT_DELEGATE_SELECT : '<?php
echo GetMessageJS('BPAT_DELEGATE_SELECT');
?>
',
BPAT_DELEGATE_CANCEL : '<?php
echo GetMessageJS('BPAT_DELEGATE_CANCEL');
?>
'
});
</script>
<?php
if ($arParams['POPUP']) {
?>
<div class="bp-popup-title"><?php
示例10: getScripts
/**
* @return string
*/
public static function getScripts()
{
Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_payment.js");
$imgPathList = self::getImgPathList();
$message = array('PAYMENT_PAID_NO' => Loc::getMessage('SALE_ORDER_PAYMENT_STATUS_NO'), 'PAYMENT_PAID_YES' => Loc::getMessage('SALE_ORDER_PAYMENT_STATUS_YES'), 'PAYMENT_PAID_RETURN' => Loc::getMessage('SALE_ORDER_PAYMENT_RETURN'), 'PAYMENT_PAID_CANCEL' => Loc::getMessage('SALE_ORDER_PAYMENT_CANCEL'), 'PAYMENT_RETURN_COMMENT' => Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_COMMENT'), 'PAYMENT_RETURN_NUM' => Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_NUM'), 'PAYMENT_RETURN_DATE' => Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_DATE'), 'PAYMENT_OPERATION_TITLE' => Loc::getMessage('SALE_ORDER_PAYMENT_OPERATION_TITLE'), 'PAYMENT_OPERATION_RETURN' => Loc::getMessage('SALE_ORDER_PAYMENT_OPERATION_RETURN'), 'PAYMENT_RETURN_DATE_ALT' => Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_DATE_ALT'), 'PAYMENT_WINDOW_RETURN_TITLE' => Loc::getMessage('SALE_ORDER_PAYMENT_WINDOW_RETURN_TITLE'), 'PAYMENT_WINDOW_CANCEL_TITLE' => Loc::getMessage('SALE_ORDER_PAYMENT_WINDOW_CANCEL_TITLE'), 'PAYMENT_WINDOW_RETURN_BUTTON_SAVE' => Loc::getMessage('SALE_ORDER_PAYMENT_WINDOW_RETURN_BUTTON_SAVE'), 'PAYMENT_RETURN_NUM_DOC' => Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_NUM_DOC'), 'PAYMENT_RETURN_SUM' => Loc::getMessage('SALE_ORDER_PAYMENT_RETURN_SUM'), 'PAYMENT_OPERATION_CANCEL' => Loc::getMessage('SALE_ORDER_PAYMENT_OPERATION_CANCEL'), 'PAYMENT_TOGGLE_DOWN' => Loc::getMessage('SALE_ORDER_PAYMENT_TOGGLE_DOWN'), 'PAYMENT_TOGGLE_UP' => Loc::getMessage('SALE_ORDER_PAYMENT_TOGGLE_UP'), 'PAYMENT_PAY_VOUCHER_NUM' => Loc::getMessage('SALE_ORDER_PAYMENT_PAY_VOUCHER_NUM'), 'PAYMENT_PAY_VOUCHER_DATE' => Loc::getMessage('SALE_ORDER_PAYMENT_PAY_VOUCHER_DATE'), 'PAYMENT_WINDOW_VOUCHER_TITLE' => Loc::getMessage('SALE_ORDER_PAYMENT_WINDOW_VOUCHER_TITLE'), 'PAYMENT_USE_INNER_BUDGET' => Loc::getMessage('SALE_ORDER_PAYMENT_USE_INNER_BUDGET'), 'PAYMENT_ORDER_STATUS' => Loc::getMessage('SALE_ORDER_PAYMENT_ORDER_STATUS'), 'PAYMENT_CONFIRM_DELETE' => Loc::getMessage('SALE_ORDER_PAYMENT_CONFIRM_DELETE'));
return '<script type="text/javascript">
BX.message(' . \CUtil::PhpToJSObject($message) . ');
logoList = ' . \CUtil::PhpToJSObject($imgPathList) . ';
BX.ready(function(){
if(BX.Sale.Admin.OrderEditPage && BX.Sale.Admin.OrderEditPage.registerFieldsUpdaters)
BX.Sale.Admin.OrderEditPage.registerFieldsUpdaters( BX.Sale.Admin.OrderPayment.prototype.getCreateOrderFieldsUpdaters() );
});
</script>';
}
示例11: unset
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
if (!empty($_REQUEST['action_button_' . $arResult["GRID_ID"]])) {
//@TODO remake
unset($_REQUEST['bxajaxid'], $_REQUEST['AJAX_CALL']);
}
\Bitrix\Main\Page\Asset::getInstance()->addJs('/bitrix/js/bizproc/tools.js');
\Bitrix\Main\Page\Asset::getInstance()->addCss('/bitrix/components/bitrix/bizproc.workflow.faces/templates/.default/style.css');
if (strlen($arResult["FatalErrorMessage"]) > 0) {
?>
<div class="bp-errortext">
<?php
echo $arResult["FatalErrorMessage"];
?>
</div>
<?php
} else {
?>
<div class="bp-interface-toolbar-container">
<div class="bp-interface-toolbar">
<table cellpadding="0" cellspacing="0" border="0" class="" style="width: 100%;">
<tbody>
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<?php
示例12:
die;
}
/** @var array $arParams */
/** @var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** @var CBitrixComponentTemplate $this */
/** @var string $templateName */
/** @var string $templateFile */
/** @var string $templateFolder */
/** @var string $componentPath */
/** @var CBitrixComponent $component */
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\Page\Asset;
Asset::getInstance()->addJs($this->GetFolder() . '/right.js');
?>
<div class="bx-lists-total-div-class" id="bx-lists-total-div-id">
<input type="hidden" id="bx-lists-selected-list" name="IBLOCK_ID">
<input type="hidden" id="bx-lists-lists-page" value="<?php
echo $arResult['LISTS_URL'];
?>
">
<div id="bx-lists-store-lists" style="display:none"></div>
<table class="bx-lists-table-title" id="bx-lists-table-title-id">
<tr>
<td class="bx-lists-table-td-title">
<span class="bx-lists-title-desc-icon" id="bx-lists-table-td-title-img"></span>
<span id="bx-lists-table-td-title"></span>
</td>
示例13: getScripts
public static function getScripts()
{
\Bitrix\Main\Page\Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_additional_info.js");
return '<script type="text/javascript">' . 'BX.message({
SALE_ORDER_ADDITIONAL_INFO_COMMENT_EDIT: "' . \CUtil::jsEscape(Loc::getMessage("SALE_ORDER_ADDITIONAL_INFO_COMMENT_EDIT")) . '",
SALE_ORDER_ADDITIONAL_INFO_COMMENT_SAVE: "' . \CUtil::jsEscape(Loc::getMessage("SALE_ORDER_ADDITIONAL_INFO_COMMENT_SAVE")) . '",
SALE_ORDER_ADDITIONAL_INFO_NO_COMMENT: "' . \CUtil::jsEscape(Loc::getMessage("SALE_ORDER_ADDITIONAL_INFO_NO_COMMENT")) . '"
})' . '</script>';
}
示例14: array
if ($saleModulePermissions >= "W") {
$arActions[] = array("SEPARATOR" => true);
$arActions[] = array("ICON" => "delete", "TEXT" => Loc::getMessage("SALE_DSE_DELETE"), "ACTION" => "if(confirm('" . Loc::getMessage('SALE_DSE_CONFIRM_DEL_PROFILE_MESSAGE') . "')) " . $lAdminSubServices->ActionRedirect("sale_delivery_service_edit.php?lang=" . LANG . "&PARENT_ID=" . $fields["PARENT_ID"] . "&ID=" . $ID . "&action=profile_delete&ID_PROF=" . $f_ID));
}
$row->AddActions($arActions);
}
if ($saleModulePermissions == "W") {
$aContext = array(array("TEXT" => Loc::getMessage("SALE_DSE_ADD_NEW_PROFILE"), "LINK" => "sale_delivery_service_edit.php?lang=" . LANG . "&PARENT_ID=" . $ID . "&back_url=" . urlencode($APPLICATION->GetCurPageParam()), "TITLE" => Loc::getMessage("SALE_DSE_ADD_NEW_PROFILE_TITLE"), "ICON" => "btn_new"));
$lAdminSubServices->AddAdminContextMenu($aContext, false);
}
if ($_REQUEST["table_id"] == $sTableIDSubService) {
$lAdminSubServices->CheckListMode();
}
}
/* profiles end */
Asset::getInstance()->addJs("/bitrix/js/sale/delivery.js");
if ($parentService && get_class($parentService) != 'Bitrix\\Sale\\Delivery\\Services\\Group') {
if ($ID > 0) {
$sDocTitle = str_replace(array("#NAME#", "#PARENT_NAME#"), array($fields["NAME"], $parentService->getName()), Loc::getMessage("SALE_DSE_EDIT_RECORD_PROFILE"));
} else {
$sDocTitle = str_replace("#PARENT_NAME#", $parentService->getName(), Loc::getMessage("SALE_DSE_NEW_RECORD_PROFILE"));
}
} else {
if ($isGroup) {
if ($ID > 0) {
$sDocTitle = str_replace("#NAME#", $fields["NAME"], Loc::getMessage("SALE_DSE_EDIT_GROUP"));
} else {
$sDocTitle = Loc::getMessage("SALE_DSE_NEW_GROUP");
}
} else {
if ($ID > 0) {
示例15: getScripts
public static function getScripts()
{
Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_shipment.js");
$message = array('SALE_ORDER_SHIPMENT_DEDUCTED_YES' => Loc::getMessage('SALE_ORDER_SHIPMENT_DEDUCTED_YES'), 'SALE_ORDER_SHIPMENT_DEDUCTED_NO' => Loc::getMessage('SALE_ORDER_SHIPMENT_DEDUCTED_NO'), 'SALE_ORDER_SHIPMENT_ALLOW_DELIVERY_YES' => Loc::getMessage('SALE_ORDER_SHIPMENT_ALLOW_DELIVERY_YES'), 'SALE_ORDER_SHIPMENT_ALLOW_DELIVERY_NO' => Loc::getMessage('SALE_ORDER_SHIPMENT_ALLOW_DELIVERY_NO'), 'SALE_ORDER_SHIPMENT_NEW_PRICE_DELIVERY' => Loc::getMessage('SALE_ORDER_SHIPMENT_NEW_PRICE_DELIVERY'), 'SALE_ORDER_SHIPMENT_APPLY' => Loc::getMessage('SALE_ORDER_SHIPMENT_APPLY'), 'SALE_ORDER_SHIPMENT_CONFIRM_SET_NEW_PRICE' => Loc::getMessage('SALE_ORDER_SHIPMENT_CONFIRM_SET_NEW_PRICE'), 'SALE_ORDER_SHIPMENT_BLOCK_SHIPMENT_TOGGLE_UP' => Loc::getMessage('SALE_ORDER_SHIPMENT_BLOCK_SHIPMENT_TOGGLE_UP'), 'SALE_ORDER_SHIPMENT_BLOCK_SHIPMENT_TOGGLE' => Loc::getMessage('SALE_ORDER_SHIPMENT_BLOCK_SHIPMENT_TOGGLE'), 'SALE_ORDER_SHIPMENT_CONFIRM_DELETE_SHIPMENT' => Loc::getMessage('SALE_ORDER_SHIPMENT_CONFIRM_DELETE_SHIPMENT'), 'SALE_ORDER_SHIPMENT_PROFILE' => Loc::getMessage('SALE_ORDER_SHIPMENT_PROFILE'));
return "<script>\n\t\t\tBX.message(" . \CUtil::PhpToJSObject($message) . ");\n\t\t</script>";
}