当前位置: 首页>>代码示例>>PHP>>正文


PHP CJSCore::GetScriptsList方法代码示例

本文整理汇总了PHP中CJSCore::GetScriptsList方法的典型用法代码示例。如果您正苦于以下问题:PHP CJSCore::GetScriptsList方法的具体用法?PHP CJSCore::GetScriptsList怎么用?PHP CJSCore::GetScriptsList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CJSCore的用法示例。


在下文中一共展示了CJSCore::GetScriptsList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _PrepareAdditionalData

 function _PrepareAdditionalData()
 {
     /** @global CMain $APPLICATION */
     global $APPLICATION;
     // get CSS changes list
     if ($this->bStyle) {
         $arCSSList = $APPLICATION->sPath2css;
         $cnt_old = count($this->arCSSList);
         $cnt_new = count($arCSSList);
         $arCSSNew = array();
         if ($cnt_old != $cnt_new) {
             for ($i = $cnt_old; $i < $cnt_new; $i++) {
                 $css_path = $arCSSList[$i];
                 if (strtolower(substr($css_path, 0, 7)) != 'http://' && strtolower(substr($css_path, 0, 8)) != 'https://') {
                     if (($p = strpos($css_path, "?")) > 0) {
                         $css_file = substr($css_path, 0, $p);
                     } else {
                         $css_file = $css_path;
                     }
                     if (file_exists($_SERVER["DOCUMENT_ROOT"] . $css_file)) {
                         $arCSSNew[] = $arCSSList[$i];
                     }
                 } else {
                     $arCSSNew[] = $arCSSList[$i];
                 }
             }
         }
     }
     // get scripts changes list
     $arHeadScripts = $APPLICATION->arHeadScripts;
     $cnt_old = count($this->arHeadScripts);
     $cnt_new = count($arHeadScripts);
     $arHeadScriptsNew = array();
     if ($cnt_old != $cnt_new) {
         for ($i = $cnt_old; $i < $cnt_new; $i++) {
             $arHeadScriptsNew[] = $arHeadScripts[$i];
         }
     }
     if (!$APPLICATION->oAsset->optimizeJs()) {
         $arHeadScriptsNew = array_merge(CJSCore::GetScriptsList(), $arHeadScriptsNew);
     }
     // prepare additional data
     $arAdditionalData = array();
     $arAdditionalData['TITLE'] = htmlspecialcharsback($APPLICATION->GetTitle());
     $arAdditionalData['WINDOW_TITLE'] = htmlspecialcharsback($APPLICATION->GetTitle('title'));
     $arAdditionalData['SCRIPTS'] = array();
     $arHeadScriptsNew = array_unique($arHeadScriptsNew);
     foreach ($arHeadScriptsNew as $script) {
         $arAdditionalData['SCRIPTS'][] = CUtil::GetAdditionalFileURL($script);
     }
     if (null !== $this->__nav_params) {
         $arAdditionalData['NAV_CHAIN'] = $APPLICATION->GetNavChain($this->__nav_params[0], $this->__nav_params[1], $this->__nav_params[2], $this->__nav_params[3], $this->__nav_params[4]);
     }
     if ($this->bStyle) {
         $arAdditionalData["CSS"] = array();
         /** @noinspection PhpUndefinedVariableInspection */
         $arCSSNew = array_unique($arCSSNew);
         foreach ($arCSSNew as $style) {
             $arAdditionalData['CSS'][] = CUtil::GetAdditionalFileURL($style);
         }
     }
     $additional_data = '<script type="text/javascript" bxrunfirst="true">' . "\n";
     $additional_data .= 'var arAjaxPageData = ' . CUtil::PhpToJSObject($arAdditionalData) . ";\r\n";
     $additional_data .= 'top.BX.ajax.UpdatePageData(arAjaxPageData)' . ";\r\n";
     $additional_data .= '</script><script type="text/javascript">';
     if (!$this->bIFrameMode && $this->bHistory) {
         $additional_data .= 'top.BX.ajax.history.put(window.AJAX_PAGE_STATE.getState(), \'' . CUtil::JSEscape(CAjax::encodeURI($APPLICATION->GetCurPageParam('', array(BX_AJAX_PARAM_ID), false))) . '\')' . ";\r\n";
     }
     if ($this->bJump) {
         if ($this->bIFrameMode) {
             $additional_data .= 'top.setTimeout(\'BX.scrollToNode("comp_' . $this->componentID . '")\', 100)' . ";\r\n";
         } else {
             $additional_data .= 'top.BX.scrollToNode(\'comp_' . $this->componentID . '\')' . ";\r\n";
         }
     }
     $additional_data .= '</script>';
     echo $additional_data;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:78,代码来源:component_ajax.php

示例2: array

 $arCSSListNew = $APPLICATION->sPath2css;
 $arCSSNew = array();
 foreach ($arCSSListNew as $i => $css_path) {
     if (strtolower(substr($css_path, 0, 7)) != 'http://' && strtolower(substr($css_path, 0, 8)) != 'https://') {
         $css_file = ($p = strpos($css_path, "?")) > 0 ? substr($css_path, 0, $p) : $css_path;
         if (file_exists($_SERVER["DOCUMENT_ROOT"] . $css_file)) {
             $arCSSNew[] = $css_path;
         }
     } else {
         $arCSSNew[] = $css_path;
     }
 }
 $arCSSNew = array_unique($arCSSNew);
 $arHeadScriptsNew = $APPLICATION->arHeadScripts;
 if (!$APPLICATION->oAsset->optimizeJs()) {
     $arHeadScriptsNew = array_merge(CJSCore::GetScriptsList(), $arHeadScriptsNew);
 }
 $arAdditionalData["CSS"] = array();
 foreach ($arCSSNew as $style) {
     $arAdditionalData["CSS"][] = CUtil::GetAdditionalFileURL($style);
 }
 $arAdditionalData['SCRIPTS'] = array();
 $arHeadScriptsNew = array_unique($arHeadScriptsNew);
 foreach ($arHeadScriptsNew as $script) {
     $arAdditionalData["SCRIPTS"][] = CUtil::GetAdditionalFileURL($script);
 }
 $additional_data = '<script type="text/javascript" bxrunfirst="true">' . "\n";
 $additional_data .= 'top.__logGetNextPageLinkEntities(' . CUtil::PhpToJSObject($component->arResult["ENTITIES_XML_ID"]) . ', ' . CUtil::PhpToJSObject($component->arResult["ENTITIES_CORRESPONDENCE"]) . ');';
 $additional_data .= '</script>';
 if ($arResult["AJAX_CALL"]) {
     $strText = ob_get_clean();
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:template.php

示例3: getPageAdditionals

 public static function getPageAdditionals()
 {
     global $APPLICATION;
     $arCSSListNew = $APPLICATION->sPath2css;
     $arCSSNew = array();
     foreach ($arCSSListNew as $i => $css_path) {
         if (strtolower(substr($css_path, 0, 7)) != 'http://' && strtolower(substr($css_path, 0, 8)) != 'https://') {
             $css_file = ($p = strpos($css_path, "?")) > 0 ? substr($css_path, 0, $p) : $css_path;
             if (file_exists($_SERVER["DOCUMENT_ROOT"] . $css_file)) {
                 $arCSSNew[] = $css_path;
             }
         } else {
             $arCSSNew[] = $css_path;
         }
     }
     $arCSSNew = array_unique($arCSSNew);
     $arHeadScriptsNew = $APPLICATION->arHeadScripts;
     if (!$APPLICATION->oAsset->optimizeJs()) {
         $arHeadScriptsNew = array_merge(CJSCore::GetScriptsList(), $arHeadScriptsNew);
     }
     $arAdditionalData["CSS"] = array();
     foreach ($arCSSNew as $style) {
         $arAdditionalData["CSS"][] = CUtil::GetAdditionalFileURL($style);
     }
     $arAdditionalData['SCRIPTS'] = array();
     $arHeadScriptsNew = array_unique($arHeadScriptsNew);
     foreach ($arHeadScriptsNew as $script) {
         $arAdditionalData["SCRIPTS"][] = CUtil::GetAdditionalFileURL($script);
     }
     return $arAdditionalData;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:mobile_helper.php


注:本文中的CJSCore::GetScriptsList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。