本文整理汇总了PHP中CJSCore::bInited方法的典型用法代码示例。如果您正苦于以下问题:PHP CJSCore::bInited方法的具体用法?PHP CJSCore::bInited怎么用?PHP CJSCore::bInited使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CJSCore
的用法示例。
在下文中一共展示了CJSCore::bInited方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Init
public static function Init($arExt = array(), $bReturn = false)
{
if (!self::$bInited)
{
self::_RegisterStandardExt();
self::$bInited = true;
}
$str = '';
if (!is_array($arExt) && strlen($arExt) > 0)
$arExt = array($arExt);
$bReturn = ($bReturn === true); // prevent syntax mistake
if (defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1 && !$bReturn)
{
$bOldReturn = false;
$bReturn = true;
}
$bNeedCore = false;
if (count($arExt) > 0)
{
foreach ($arExt as $ext)
{
if (self::$arRegisteredExt[$ext] && !self::$arRegisteredExt[$ext]['skip_core'])
{
$bNeedCore = true;
break;
}
}
}
else
{
$bNeedCore = true;
}
$ret = '';
if ($bNeedCore && !self::$arCurrentlyLoadedExt['core'])
{
$autoTimeZone = "N";
if(is_object($GLOBALS["USER"]))
$autoTimeZone = trim($GLOBALS["USER"]->GetParam("AUTO_TIME_ZONE"));
$arLang = array(
'LANGUAGE_ID' => LANGUAGE_ID,
'FORMAT_DATE' => FORMAT_DATE,
'FORMAT_DATETIME' => FORMAT_DATETIME,
'COOKIE_PREFIX' => COption::GetOptionString("main", "cookie_name", "BITRIX_SM"),
'USER_ID' => $GLOBALS['USER']->GetID(),
'SERVER_TIME' => time(),
'SERVER_TZ_OFFSET' => date("Z"),
'USER_TZ_OFFSET' => CTimeZone::GetOffset(),
'USER_TZ_AUTO' => $autoTimeZone == 'N'? 'N': 'Y',
'bitrix_sessid' => bitrix_sessid(),
);
if(!defined("ADMIN_SECTION") || ADMIN_SECTION !== true)
$arLang["SITE_ID"] = SITE_ID;
$ret .= self::_loadCSS('/bitrix/js/main/core/css/core.css', $bReturn);
$ret .= self::_loadJS('/bitrix/js/main/core/core.js', $bReturn);
$ret .= self::_loadLang(BX_ROOT.'/modules/main/lang/'.LANGUAGE_ID.'/js_core.php', $bReturn, $arLang);
self::$arCurrentlyLoadedExt['core'] = true;
}
for ($i = 0, $len = count($arExt); $i < $len; $i++)
{
$ret .= self::_loadExt($arExt[$i], $bReturn);
}
if (defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1 && !$bOldReturn)
echo $ret;
return $bReturn ? $ret : true;
}
示例2: Init
public static function Init($arExt = array(), $bReturn = false)
{
global $USER;
if (!self::$bInited) {
self::_RegisterStandardExt();
self::$bInited = true;
}
if (!is_array($arExt) && strlen($arExt) > 0) {
$arExt = array($arExt);
}
$bReturn = $bReturn === true;
// prevent syntax mistake
$bNeedCore = false;
if (count($arExt) > 0) {
foreach ($arExt as $ext) {
if (self::$arRegisteredExt[$ext] && (!isset(self::$arRegisteredExt[$ext]['skip_core']) || !self::$arRegisteredExt[$ext]['skip_core'])) {
$bNeedCore = true;
break;
}
}
} else {
$bNeedCore = true;
}
$ret = '';
if ($bNeedCore && !self::$arCurrentlyLoadedExt['core']) {
$ret .= self::_loadCSS('/bitrix/js/main/core/css/core.css', $bReturn);
$ret .= self::_loadJS('/bitrix/js/main/core/core.js', $bReturn);
$ret .= self::_loadLang(BX_ROOT . '/modules/main/lang/' . LANGUAGE_ID . '/js_core.php', $bReturn);
self::$arCurrentlyLoadedExt['core'] = true;
}
for ($i = 0, $len = count($arExt); $i < $len; $i++) {
$ret .= self::_loadExt($arExt[$i], $bReturn);
}
if (defined('BX_PUBLIC_MODE') && BX_PUBLIC_MODE == 1) {
echo $ret;
}
return $bReturn ? $ret : true;
}