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


PHP CJSCore::GetCoreMessages方法代碼示例

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


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

示例1: onEndBufferContent

 /**
  * OnEndBufferContent handler
  * There are two variants of content's modification in this method.
  * The first one:
  * If it's ajax-hit the content will be replaced by json data with dynamic blocks,
  * javascript files and etc. - dynamic part
  *
  * The second one:
  * If it's simple hit the content will be modified also,
  * all dynamic blocks will be cutted out of the content - static part.
  *
  * @param $content
  */
 public function onEndBufferContent(&$content)
 {
     global $APPLICATION;
     $dividedData = self::getInstance()->getDividedPageData($content);
     $htmlCacheChanged = false;
     if (self::getUseHTMLCache()) {
         $staticHTMLCache = \Bitrix\Main\Data\StaticHtmlCache::getInstance();
         if ($staticHTMLCache->isCacheable()) {
             if (!$staticHTMLCache->isExists() || $staticHTMLCache->getSubstring(-35, 32) !== $dividedData["md5"]) {
                 $staticHTMLCache->delete();
                 $staticHTMLCache->write($dividedData["static"] . "<!--" . $dividedData["md5"] . "-->");
             }
             $frame = self::getInstance();
             $ids = $frame->getDynamicIDs();
             foreach ($ids as $i => $id) {
                 if (isset($frame->containers[$id])) {
                     unset($ids[$i]);
                 }
             }
             $dividedData["static"] = preg_replace(array('/<!--\'start_frame_cache_(' . implode("|", $ids) . ')\'-->/', '/<!--\'end_frame_cache_(' . implode("|", $ids) . ')\'-->/'), array('<div id="bxdynamic_\\1">', '</div>'), $content);
             if ($frame->injectedJS) {
                 if (isset($frame->injectedJS["start"])) {
                     $dividedData["static"] = str_replace($frame->injectedJS["start"], "", $dividedData["static"]);
                 }
             }
         } elseif (!$staticHTMLCache->isCacheable()) {
             $staticHTMLCache->delete();
             return;
         }
     }
     if (self::getUseAppCache() == true) {
         \Bitrix\Main\Data\AppCacheManifest::getInstance()->generate($dividedData["static"]);
     } else {
         \Bitrix\Main\Data\AppCacheManifest::checkObsoleteManifest();
     }
     if (self::isAjaxRequest()) {
         header("Content-Type: application/x-javascript; charset=" . SITE_CHARSET);
         $content = array("js" => $APPLICATION->arHeadScripts, "additional_js" => $APPLICATION->arAdditionalJS, "lang" => \CJSCore::GetCoreMessages(), "css" => $APPLICATION->GetCSSArray(), "htmlCacheChanged" => $htmlCacheChanged, "isManifestUpdated" => \Bitrix\Main\Data\AppCacheManifest::getInstance()->getIsModified(), "dynamicBlocks" => $dividedData["dynamic"], "spread" => array_map(array("CUtil", "JSEscape"), $APPLICATION->GetSpreadCookieUrls()));
         $content = \CUtil::PhpToJSObject($content);
     } else {
         $content = $dividedData["static"];
     }
 }
開發者ID:spas-viktor,項目名稱:books,代碼行數:56,代碼來源:frame.php

示例2: processPageContent

 /**
  * * There are two variants of content's modification in this method.
  * The first one:
  * If it's ajax-hit the content will be replaced by json data with dynamic blocks,
  * javascript files and etc. - dynamic part
  *
  * The second one:
  * If it's simple hit the content will be modified also,
  * all dynamic blocks will be cutted out of the content - static part.
  *
  * @param string $content Html page content.
  *
  * @return string
  */
 public function processPageContent($content)
 {
     global $APPLICATION;
     $dividedData = $this->getDividedPageData($content);
     $htmlCacheChanged = false;
     if (self::getUseHTMLCache()) {
         $isLicenseExpired = self::isLicenseExpired();
         $staticHTMLCache = StaticHtmlCache::getInstance();
         if ($staticHTMLCache->isCacheable()) {
             $cacheExists = $staticHTMLCache->exists();
             if ((!$cacheExists || $staticHTMLCache->getMd5() !== $dividedData["md5"]) && !\CHTMLPagesCache::isIE9()) {
                 if ($cacheExists) {
                     $staticHTMLCache->delete();
                 }
                 if (!$isLicenseExpired) {
                     $success = $staticHTMLCache->write($dividedData["static"], $dividedData["md5"]);
                     if ($success) {
                         $htmlCacheChanged = true;
                         $staticHTMLCache->setUserPrivateKey();
                     }
                 }
             } else {
                 if ($isLicenseExpired) {
                     $staticHTMLCache->delete();
                 }
             }
             $dividedData["static"] = $this->replaceInjections($content);
         } else {
             $staticHTMLCache->delete();
             return $this->getAjaxError("not_cacheable");
         }
     }
     if (self::getUseAppCache() == true) {
         AppCacheManifest::getInstance()->generate($dividedData["static"]);
     } else {
         AppCacheManifest::checkObsoleteManifest();
     }
     if (self::isAjaxRequest()) {
         self::sendRandHeader();
         header("Content-Type: application/x-javascript; charset=" . SITE_CHARSET);
         header("X-Bitrix-Composite: Ajax " . ($htmlCacheChanged ? "(changed)" : "(stable)"));
         $content = array("js" => $APPLICATION->arHeadScripts, "additional_js" => $APPLICATION->arAdditionalJS, "lang" => \CJSCore::GetCoreMessages(), "css" => $APPLICATION->GetCSSArray(), "htmlCacheChanged" => $htmlCacheChanged, "isManifestUpdated" => AppCacheManifest::getInstance()->getIsModified(), "dynamicBlocks" => $dividedData["dynamic"], "spread" => array_map(array("CUtil", "JSEscape"), $APPLICATION->GetSpreadCookieUrls()));
         $content = \CUtil::PhpToJSObject($content);
     } else {
         $content = $dividedData["static"];
     }
     return $content;
 }
開發者ID:rasuldev,項目名稱:torino,代碼行數:62,代碼來源:frame.php

示例3: define

<?php

define("NO_KEEP_STATISTIC", true);
define("NOT_CHECK_FILE_PERMISSIONS", true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
header("Content-Type: application/x-javascript; charset=" . LANG_CHARSET);
echo CUtil::PhpToJSObject(CJSCore::GetCoreMessages());
die;
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:8,代碼來源:composite_data.php


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