From bbeb1b968f5234a62c32681c2ed9e4a7a189bd34 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Thu, 3 Oct 2013 22:33:09 +0200 Subject: During callback, separate loading of stylesheet files and code snippets; fixes #480 --- framework/Web/UI/TClientScriptManager.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'framework/Web/UI/TClientScriptManager.php') 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) @@ -424,6 +421,15 @@ class TClientScriptManager extends TApplicationComponent return $stylesheets; } + /** + * 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 -- cgit v1.2.3