summaryrefslogtreecommitdiff
path: root/app/php/web/ClientScriptManager.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-04-29 14:02:09 +0200
committeremkael <emkael@tlen.pl>2016-04-29 14:02:09 +0200
commit558eb849057849bac4b2acabad790a6e846dc37b (patch)
treeb187c5c000a35f7d0c5502a37e8d428fce7bb5cf /app/php/web/ClientScriptManager.php
parent6b8515f0fe678744efec278f1e2eeae302991adf (diff)
* assets store key refactored to accomodate different asset types
Diffstat (limited to 'app/php/web/ClientScriptManager.php')
-rw-r--r--app/php/web/ClientScriptManager.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/app/php/web/ClientScriptManager.php b/app/php/web/ClientScriptManager.php
index 84b9d6f..f43ac02 100644
--- a/app/php/web/ClientScriptManager.php
+++ b/app/php/web/ClientScriptManager.php
@@ -57,16 +57,22 @@ class ClientScriptManager extends TClientScriptManager {
return max(array_map('filemtime', $files));
}
- private $_renderedScriptsInitialized = FALSE;
-
- private function _getRenderedScriptsStoreKey() {
+ private function _getRenderedAssetsStoreKey($type) {
$template = $this->_page->Master;
if (!$template instanceof Layout) {
throw new TNotSupportedException(
'Compiled assets may only be used within Layout master class controls'
);
}
- return 'RenderedScripts.' . $template->generateViewID();
+ return 'Rendered' . $type . '.' . $template->generateViewID();
+ }
+
+ private function _getRenderedScriptsStoreKey() {
+ return $this->_getRenderedAssetsStoreKey('Scripts');
+ }
+
+ private function _getRenderedSheetsStoreKey() {
+ return $this->_getRenderedAssetsStoreKey('Sheets');
}
private function _getCache() {
@@ -79,6 +85,10 @@ class ClientScriptManager extends TClientScriptManager {
return $cache;
}
+ // Scripts
+
+ private $_renderedScriptsInitialized = FALSE;
+
private function _getRenderedScripts() {
$sessionKey = $this->_getRenderedScriptsStoreKey();
if ($this->_page->IsCallBack || $this->_renderedScriptsInitialized) {