summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TClientScriptManager.php
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2013-10-03 22:33:09 +0200
committerFabio Bas <ctrlaltca@gmail.com>2013-10-03 22:33:09 +0200
commitbbeb1b968f5234a62c32681c2ed9e4a7a189bd34 (patch)
tree1b4103c885fd1bfc555fb93313c1dd2c3a20a603 /framework/Web/UI/TClientScriptManager.php
parenta5d1b481a09c14d2e1459648efdeae4b8371ed01 (diff)
During callback, separate loading of stylesheet files and code snippets; fixes #480
Diffstat (limited to 'framework/Web/UI/TClientScriptManager.php')
-rw-r--r--framework/Web/UI/TClientScriptManager.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php
index 0cdf3e32..ea828187 100644
--- a/framework/Web/UI/TClientScriptManager.php
+++ b/framework/Web/UI/TClientScriptManager.php
@@ -402,17 +402,14 @@ class TClientScriptManager extends TApplicationComponent
/**
* Returns the URLs of all stylesheet files referenced on the page
- * @return array Combined list of all stylesheet urls used in the page
+ * @return array List of all stylesheet urls used in the page
*/
public function getStyleSheetUrls()
{
$stylesheets = array_values(
- array_merge(
- array_map(
- create_function('$e', 'return is_array($e) ? $e[0] : $e;'),
- $this->_styleSheetFiles),
- $this->_styleSheets
- )
+ array_map(
+ create_function('$e', 'return is_array($e) ? $e[0] : $e;'),
+ $this->_styleSheetFiles)
);
foreach(Prado::getApplication()->getAssetManager()->getPublished() as $path=>$url)
@@ -425,6 +422,15 @@ class TClientScriptManager extends TApplicationComponent
}
/**
+ * Returns all the stylesheet code snippets referenced on the page
+ * @return array List of all stylesheet snippets used in the page
+ */
+ public function getStyleSheetCodes()
+ {
+ return array_unique(array_values($this->_styleSheets));
+ }
+
+ /**
* Registers a javascript file in the page head
* @param string a unique key identifying the file
* @param string URL to the javascript file