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


PHP CJSCore::IsInited方法代碼示例

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


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

示例1: EndBufferContent

	function EndBufferContent($content="")
	{
		if ($this->buffer_man)
		{
			$this->auto_buffer_cleaned = true;
			return "";
		}

		Frame::checkAdminPanel();

		if (function_exists("getmoduleevents"))
		{
			foreach (GetModuleEvents("main", "OnBeforeEndBufferContent", true) as $arEvent)
			{
				ExecuteModuleEventEx($arEvent, array());
			}
		}

		$asset = Asset::getInstance();
		if (Frame::getUseAppCache())
		{
			$asset->addString(CJSCore::GetCoreMessagesScript(), false, AssetLocation::AFTER_CSS, AssetMode::ALL);
		}
		else
		{
			$asset->addString(CJSCore::GetCoreMessagesScript(), false, AssetLocation::AFTER_CSS, AssetMode::STANDARD);
			$asset->addString(CJSCore::GetCoreMessagesScript(true), false, AssetLocation::AFTER_CSS, AssetMode::COMPOSITE);
		}

		$asset->addString($this->GetSpreadCookieHTML(), false, AssetLocation::AFTER_JS, AssetMode::STANDARD);
		if ($asset->canMoveJsToBody() && \CJSCore::IsInited())
		{
			$asset->addString(\CJSCore::GetInlineCoreJs(), false, AssetLocation::BEFORE_CSS, AssetMode::ALL);
		}

		if (is_object($GLOBALS["APPLICATION"])) //php 5.1.6 fix: http://bugs.php.net/bug.php?id=40104
		{
			$cnt = count($this->buffer_content_type);
			for ($i = 0; $i < $cnt; $i++)
			{
				$this->buffer_content[$i*2+1] = call_user_func_array($this->buffer_content_type[$i]["F"], $this->buffer_content_type[$i]["P"]);
			}
		}

		$composite = Frame::getInstance();
		$compositeContent = $composite->startBuffering($content);
		$content = implode("", $this->buffer_content).$content;

		if (function_exists("getmoduleevents"))
		{
			foreach (GetModuleEvents("main", "OnEndBufferContent", true) as $arEvent)
			{
				ExecuteModuleEventEx($arEvent, array(&$content));
			}
		}

		$wasContentModified = $composite->endBuffering($content, $compositeContent);
		if (!$wasContentModified && $asset->canMoveJsToBody())
		{
			$asset->moveJsToBody($content);
		}

		return $content;
	}
開發者ID:nycmic,項目名稱:bittest,代碼行數:64,代碼來源:main.php

示例2: showFilesList

	/**
	 * Insert JS code to set assets included in page
	 * @return string
	 */
	private function showFilesList()
	{
		$res = '';
		if (!\CJSCore::IsInited())
		{
			return $res;
		}

		if(!empty($this->assetList['JS']))
		{
			$assetList = array();
			$setList = $this->getTargetList('JS');
			foreach($setList as $set)
			{
				if($this->mode & $set['MODE']
					&& isset($this->assetList['JS'][$set['PARENT_NAME']][$set['NAME']])
					&& is_array($this->assetList['JS'][$set['PARENT_NAME']][$set['NAME']]))
				{
					$assetList = array_merge($assetList, $this->assetList['JS'][$set['PARENT_NAME']][$set['NAME']]);
				}
			}

			if(!empty($assetList))
			{
				$res .= '<script type="text/javascript">'."BX.setJSList(['".implode("','", $assetList)."']); </script>\n";
			}
		}

		if(!empty($this->assetList['CSS']))
		{
			$assetList = array();
			$setList = $this->getTargetList('CSS');
			foreach($setList as $set)
			{
				if($this->mode & $set['MODE']
					&& isset($this->assetList['CSS'][$set['PARENT_NAME']][$set['NAME']])
					&& is_array($this->assetList['CSS'][$set['PARENT_NAME']][$set['NAME']])
				)
				{
					$assetList = array_merge($assetList, $this->assetList['CSS'][$set['PARENT_NAME']][$set['NAME']]);
				}
			}

			if(!empty($assetList))
			{
				$res .= '<script type="text/javascript">'."BX.setCSSList(['".implode("','", $assetList)."']); </script>\n";
			}
		}
		return $res;
	}
開發者ID:nycmic,項目名稱:bittest,代碼行數:54,代碼來源:asset.php


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