本文整理汇总了PHP中CJSCore::Init方法的典型用法代码示例。如果您正苦于以下问题:PHP CJSCore::Init方法的具体用法?PHP CJSCore::Init怎么用?PHP CJSCore::Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CJSCore
的用法示例。
在下文中一共展示了CJSCore::Init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetPublicEditHtml
public static function GetPublicEditHtml($arProperty, $arValue, $strHTMLControlName)
{
$strID = preg_replace('/[^a-zA-Z0-9_]/i', 'x', $strHTMLControlName["VALUE"]);
CJSCore::Init(array('asd_palette'));
$strResult = '<input type="text" name="' . htmlspecialcharsbx($strHTMLControlName['VALUE']) . '" id="' . htmlspecialcharsbx($strID) . '" value="' . htmlspecialcharsbx($arValue['VALUE']) . '" />';
$strResult .= '<script type="text/javascript">
BX.ready(function()
{
$("#' . htmlspecialcharsbx($strID) . '").jPicker({
window: {title: "' . GetMessage('ASD_UT_PALETTE_WND_TITLE') . '"},
images: {clientPath : "/bitrix/js/asd.iblock/jpicker/images/"},
localization: {
text: {
title: "' . GetMessage('ASD_UT_PALETTE_WND_TITLE') . '",
newColor: "' . GetMessage('ASD_UT_PALETTE_WND_NEW_COLOR') . '", currentColor: "' . GetMessage('ASD_UT_PALETTE_WND_CURRENT_COLOR') . '",
ok: "' . GetMessage('ASD_UT_PALETTE_WND_OK') . '", cancel: "' . GetMessage('ASD_UT_PALETTE_WND_CANCEL') . '"
},
tooltips: {
colors: { newColor: "' . GetMessage('ASD_UT_PALETTE_TIPS_NEW_COLOR') . '", currentColor: "' . GetMessage('ASD_UT_PALETTE_TIPS_CURRENT_COLOR') . '" },
buttons: { ok: "' . GetMessage('ASD_UT_PALETTE_TIPS_BTN_OK') . '", cancel: "' . GetMessage('ASD_UT_PALETTE_TIPS_BTN_CANCEL') . '" },
hue: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_HUE_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_HUE_VALUE') . '" },
saturation: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_SATURATION_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_SATURATION_VALUE') . '" },
value: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_BRIGHTNESS_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_BRIGHTNESS_VALUE') . '" },
red: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_RED_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_RED_VALUE') . '" },
green: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_GREEN_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_GREEN_VALUE') . '" },
blue: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_BLUE_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_BLUE_VALUE') . '" },
alpha: { radio: "' . GetMessage('ASD_UT_PALETTE_TIPS_ALPHA_MODE') . '", textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_ALPHA_VALUE') . '" },
hex: { textbox: "' . GetMessage('ASD_UT_PALETTE_TIPS_HEX_VALUE') . '", alpha: "' . GetMessage('ASD_UT_PALETTE_TIPS_HEX_ALPHA') . '" }
}
}
});
});
</script>';
return $strResult;
}
示例2: 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);
}
}
示例3: ShowStep
function ShowStep()
{
$wizard = & $this->GetWizard();
$path = $wizard->package->path;
CJSCore::Init(array('ajax'));
$this->content = '<div id="treelike_comments_import_progress">' . GetMessage('PRMEDIA_TLC_IMPORT_IMPORT_CONTENT') . '</div>';
$this->content .= '<link rel="stylesheet" href="/bitrix/panel/main/admin-public.css" />';
$this->content .= '<style>#wait_treelike_comments_import_progress, .step-buttons {display: none !important;}</style>';
$this->content .= '
<script>
parent.document.getElementsByClassName("bx-core-adm-icon-close")[0].style.display = "none";
;(function (window) {
var BX = window.BX;
var commentImporter = function () {};
commentImporter.prototype.init = function () {
BX.ajax.insertToNode("' . $path . '/ajax/import.php?start=Y", BX("treelike_comments_import_progress"));
};
commentImporter.prototype.update = function () {
BX.ajax.insertToNode("' . $path . '/ajax/import.php", BX("treelike_comments_import_progress"));
};
// add library to window context
window.jsPrmediaCommentImporter = new commentImporter();
}) (window);
jsPrmediaCommentImporter.init();
</script>
';
}
示例4: getList
/**
* Возвращает выпадающий список с часовыми поясами
* @param string $name
* @param string $value
* @param bool $is_multiple
*/
protected static function getList($arProperty, $name, $value, $is_multiple = false)
{
$image = self::getImage($arProperty);
if (!$image) {
return '';
}
global $APPLICATION;
if (self::$counter === 0) {
$script = file_get_contents(__DIR__ . '/../assets/jquery.canvasAreaDraw.js');
\CJSCore::Init(array("jquery"));
$APPLICATION->AddHeadString("<script>{$script}</script>", true);
}
$id = 'canv_' . md5('CanvasPolygon' . $name . self::$counter);
$html = <<<EOD
\t<div style="max-width: 100%; max-height: 600px; overflow: scroll;">
\t\t<input type="hidden" value="{$value}" id="{$id}" name="{$name}">
\t</div>
\t<button id="reset_{$id}">Очистить</button>
\t<script type="text/javascript">
\t\t(function(\$) {
\t\t\tvar \$input = \$('#{$id}');
\t\t\tvar \$parent = \$input.parent();
\t\t\t\$parent.width(\$parent.parent().width());
\t\t\t\$input.canvasAreaDraw({
\t\t\t\timageUrl: "{$image}",
\t\t\t\treset: "#reset_{$id}"
\t\t\t});
\t\t})(jQuery);
\t</script>
EOD;
self::$counter++;
return $html;
}
示例5: l
static function l()
{
if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/bxd_log.txt")) {
$content = file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/bxd_log.txt");
global $APPLICATION;
CJSCore::Init(array('bxd'));
$APPLICATION->AddViewContent("bxd_debug", $content, 1);
}
}
示例6: initJs
static function initJs()
{
static $done = false;
if (!$done) {
$done = true;
\CJSCore::RegisterExt('input', array('js' => '/bitrix/js/sale/input.js', 'lang' => '/bitrix/modules/sale/lang/' . LANGUAGE_ID . '/lib/internals/input.php'));
\CJSCore::Init(array('input'));
print '<div style="display:none">';
$GLOBALS['APPLICATION']->IncludeComponent("bitrix:sale.location.selector." . \Bitrix\Sale\Location\Admin\LocationHelper::getWidgetAppearance(), "", array("ID" => '', "CODE" => '', "INPUT_NAME" => 'SALE_LOCATION_SELECTOR_RESOURCES', "PROVIDE_LINK_BY" => 'code', "FILTER_BY_SITE" => 'Y', "SHOW_DEFAULT_LOCATIONS" => 'Y', "SEARCH_BY_PRIMARY" => 'Y', "JS_CONTROL_GLOBAL_ID" => 'SALE_LOCATION_SELECTOR_RESOURCES', "USE_JS_SPAWN" => 'Y'), false, array('HIDE_ICONS' => 'Y'));
print '</div>';
}
}
示例7: CComponentAjax
function CComponentAjax($componentName, $componentTemplate, &$arParams, $parentComponent)
{
/** @global CMain $APPLICATION */
global $APPLICATION, $USER;
if ($USER->IsAdmin()) {
if ($_GET['bitrix_disable_ajax'] == 'N') {
unset($_SESSION['bitrix_disable_ajax']);
}
if ($_GET['bitrix_disable_ajax'] == 'Y' || $_SESSION['bitrix_disable_ajax'] == 'Y') {
$_SESSION['bitrix_disable_ajax'] = 'Y';
return null;
}
}
if ($parentComponent && $this->_checkParent($parentComponent)) {
return false;
}
$this->componentName = $componentName;
$this->componentTemplate = $componentTemplate;
$this->arParams = $arParams;
$this->bShadow = $this->arParams['AJAX_OPTION_SHADOW'] != 'N';
$this->bJump = $this->arParams['AJAX_OPTION_JUMP'] != 'N';
$this->bStyle = $this->arParams['AJAX_OPTION_STYLE'] != 'N';
$this->bHistory = $this->arParams['AJAX_OPTION_HISTORY'] != 'N';
if (!$this->CheckSession()) {
return false;
}
CJSCore::Init(array('ajax'));
$arParams['AJAX_ID'] = $this->componentID;
if ($this->bAjaxSession) {
// dirty hack: try to get breadcrumb call params
for ($i = 0, $cnt = count($APPLICATION->buffer_content_type); $i < $cnt; $i++) {
if ($APPLICATION->buffer_content_type[$i]['F'][1] == 'GetNavChain') {
$this->__nav_params = $APPLICATION->buffer_content_type[$i]['P'];
}
}
$APPLICATION->RestartBuffer();
define('PUBLIC_AJAX_MODE', 1);
if (is_set($_REQUEST, 'AJAX_CALL')) {
$this->bIFrameMode = true;
}
}
if ($this->bStyle) {
$this->arCSSList = $APPLICATION->sPath2css;
}
$this->arHeadScripts = $APPLICATION->arHeadScripts;
if (!$this->bAjaxSession) {
$APPLICATION->AddBufferContent(array($this, '__BufferDelimiter'));
}
$this->buffer_start_counter = count($APPLICATION->buffer_content);
$this->LocalRedirectHandlerId = AddEventHandler('main', 'OnBeforeLocalRedirect', array($this, "LocalRedirectHandler"));
$this->RestartBufferHandlerId = AddEventHandler('main', 'OnBeforeRestartBuffer', array($this, 'RestartBufferHandler'));
return null;
}
示例8: executeComponent
/**
* @return bool
*/
public function executeComponent()
{
if (!CModule::IncludeModule('pull')) {
return false;
}
global $USER;
$this->arResult['userId'] = $USER->getId();
$this->arResult['signalingLink'] = $this->getPath() . '/call.ajax.php';
CJSCore::RegisterExt('pullDemoWebrtc', array('js' => $this->getPath() . '/demo_webrtc.js', 'lang' => $this->getPath() . '/lang/' . LANGUAGE_ID . '/js_demo_webrtc.php', 'rel' => array('webrtc')));
CJSCore::Init('pullDemoWebrtc');
$this->includeComponentTemplate();
return true;
}
示例9: GetPropertyFieldHtml
function GetPropertyFieldHtml($arProperty, $value, $strHTMLControlName)
{
$tableID = md5($strHTMLControlName['VALUE']);
$id = $arProperty['ID'];
CJSCore::Init('jquery');
global $APPLICATION;
$APPLICATION->AddHeadScript('https://cdnjs.cloudflare.com/ajax/libs/tinyColorPicker/1.1.0/jqColorPicker.min.js');
ob_start();
?>
<script>$(function () {
$('#<?php
echo $tableID;
?>
').colorPicker({
opacity: false, renderCallback: function ($elm, toggled) {
if ($elm.val()) {
$elm.val('#' + this.color.colors.HEX);
}
}
});
})</script>
<input type="text" name="<?php
echo $strHTMLControlName['VALUE'];
?>
"
value="<?php
echo $value['VALUE'];
?>
"
id="<?php
echo $tableID;
?>
">
<?php
$return = ob_get_contents();
ob_end_clean();
return $return;
}
示例10: 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;
}
示例11: strpos
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
CJSCore::Init(array('fx', 'ajax', 'dd'));
$APPLICATION->AddHeadScript('/bitrix/js/main/file_upload_agent.js');
$uid = $arParams['CONTROL_ID'];
$controller = "BX('file-selectdialog-" . $uid . "')";
$controlName = $arParams['INPUT_NAME'];
$controlNameFull = $controlName . ($arParams['MULTIPLE'] == 'Y' ? '[]' : '');
$arValue = $arResult['FILES'];
$addClass = strpos($_SERVER['HTTP_USER_AGENT'], 'Mac OS') !== false ? 'file-filemacos' : '';
if (!function_exists('mfi_format_line')) {
function mfi_format_line($arValue, $uid, $controlNameFull)
{
$result = '';
if (is_array($arValue) && sizeof($arValue) > 0) {
ob_start();
foreach ($arValue as $arElement) {
$elementID = intval($arElement['ID']);
?>
<tr class="file-inline-file" id="wd-doc<?php
echo $elementID;
?>
">
<td class="files-name">
<span class="files-text">
<span class="f-wrap"><?php
echo htmlspecialcharsEx($arElement['ORIGINAL_NAME']);
?>
示例12: define
/**
* @global CUser $USER
* @global CMain $APPLICATION
*/
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/prolog.php";
define("HELP_FILE", "settings/site_speed.php");
use Bitrix\Main;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\Analytics;
Loc::loadMessages(__FILE__);
if (!$USER->CanDoOperation("view_other_settings") || !Analytics\SiteSpeed::isLicenseAccepted()) {
$APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED"));
}
CJSCore::Init(array("site_speed", "date"));
$APPLICATION->SetAdditionalCSS("/bitrix/panel/main/site_speed.css");
$APPLICATION->SetTitle(Loc::getMessage("MAIN_SITE_SPEED_TITLE"));
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
?>
<div class="site-speed-page">
<?php
$currentHost = preg_replace("/:(80|443)\$/", "", $_SERVER["HTTP_HOST"]);
$currentHost = htmlspecialcharsbx($currentHost);
$currentHostTitle = htmlspecialcharsbx(\CBXPunycode::ToUnicode($currentHost, $errors));
?>
<div class="site-speed-domains">
<span class="site-speed-domains-label"><?php
echo Loc::getMessage("MAIN_SITE_SPEED_DOMAINS_LABEL");
?>
示例13:
}
if (!empty($arResult['ERROR'])) {
echo $arResult['ERROR'];
return false;
}
if (!empty($arResult['FORM_ERROR'])) {
?>
<font color='red'><?php
echo $arResult['FORM_ERROR'];
?>
</font><br/><br/>
<?php
}
$GLOBALS['APPLICATION']->SetAdditionalCSS('/bitrix/js/report/css/report.css');
$GLOBALS['APPLICATION']->AddHeadScript('/bitrix/js/report/construct.js');
CJSCore::Init(array('date', 'access'));
?>
<!-- Redefinition of some styles -->
<style type="text/css">
#sale-report-construct-buttons-block { padding-top: 18px; }
.reports-filter-quan-item {height: 30px;}
.reports-filter-quan-item .reports-checkbox { margin: 0;}
.reports-filter-block { width: 800px; }
.report-filter-calendar { margin-left: 4px; }
.reports-forming-column { height: 38px; padding-top: 0px; }
.reports-add-col-button-down,
.reports-add-col-button-up,
.reports-checkbox { vertical-align: middle; margin-top: 8px; padding: 0;}
/* grouping */
示例14:
return;
endif;
if($arParams["PWD"] == ""):
ShowError(GetMessage('PR_PWD_ERR_PWD'));
return;
endif;
if($arParams["FILE"] == "" OR !file_exists($_SERVER['DOCUMENT_ROOT'].SITE_DIR.$arParams["FILE"])):
ShowError(GetMessage('PR_PWD_ERR_FILE'));
return;
endif;
if($arParams['AJAX'] == 'Y')
{
CJSCore::Init(array("jquery"));
$APPLICATION->AddHeadScript( '/bitrix/components/pr/pwd/script/pr.pwd.js');
}
$PWD = new prPWD;
$arParams["ID"] = md5($arParams["PWD"].$arParams["FILE"]);
$arParams["PWD"] = md5($arParams["PWD"]);
$arResult = $PWD->getResult($arParams);
echo '<div class="pr_pwd">';
if($arResult['status'] === false)
echo '<div class="error">'.$arResult['result'].'</div>';
$this->IncludeComponentTemplate();
示例15: CDBResult
$str_VISIBLE = "Y";
if ($ID > 0) {
$rubric = new CDBResult(\Bitrix\Sender\MailingTable::getById($ID));
if (!$rubric->ExtractFields("str_")) {
$ID = 0;
}
}
$GROUP_EXIST = array();
$groupDb = \Bitrix\Sender\GroupTable::getList(array('select' => array('NAME', 'ID', 'ADDRESS_COUNT'), 'filter' => array('ACTIVE' => 'Y'), 'order' => array('SORT' => 'ASC', 'NAME' => 'ASC')));
while ($arGroup = $groupDb->fetch()) {
$GROUP_EXIST[] = $arGroup;
}
if ($bVarsFromForm) {
$DB->InitTableVarsForEdit("b_sender_mailing", "", "str_");
}
\CJSCore::Init(array("sender_admin"));
$APPLICATION->SetTitle($ID > 0 ? GetMessage("sender_mailing_edit_title_edit") . $ID : GetMessage("sender_mailing_edit_title_new"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
$aMenu = array(array("TEXT" => GetMessage("sender_mailing_edit_list"), "TITLE" => GetMessage("sender_mailing_edit_list_title"), "LINK" => "sender_mailing_admin.php?lang=" . LANG, "ICON" => "btn_list"));
if ($ID > 0) {
$aMenu[] = array("SEPARATOR" => "Y");
$aMenu[] = array("TEXT" => GetMessage("sender_mailing_edit_add"), "TITLE" => GetMessage("sender_mailing_edit_add_title"), "LINK" => "sender_mailing_edit.php?lang=" . LANG, "ICON" => "btn_new");
$aMenu[] = array("TEXT" => GetMessage("sender_mailing_edit_del"), "TITLE" => GetMessage("sender_mailing_edit_del_title"), "LINK" => "javascript:if(confirm('" . GetMessage("sender_mailing_edit_del_confirm") . "'))window.location='sender_mailing_admin.php?ID=" . $ID . "&action=delete&lang=" . LANGUAGE_ID . "&" . bitrix_sessid_get() . "';", "ICON" => "btn_delete");
$aMenu[] = array("SEPARATOR" => "Y");
}
$context = new CAdminContextMenu($aMenu);
$context->Show();
?>
<?php
if ($_REQUEST["mess"] == "ok" && $ID > 0) {