bug 2963: Ability to create css/js smarty templates with caching (scripts was not using template parameter)

git-svn-id: http://piwigo.org/svn/trunk@26718 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2014-01-14 21:13:40 +00:00
parent a6cc81af3c
commit 089c4542fb
+5 -3
View File
@@ -2,7 +2,7 @@
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2014 Piwigo Team http://piwigo.org |
// | Copyright(C) 2008-2013 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
@@ -797,7 +797,8 @@ class Template
$this->scriptLoader->add( $params['id'], $load,
empty($params['require']) ? array() : explode( ',', $params['require'] ),
@$params['path'],
isset($params['version']) ? $params['version'] : 0 );
isset($params['version']) ? $params['version'] : 0,
@$params['template']);
}
/**
@@ -1494,7 +1495,7 @@ class ScriptLoader
* @param string $path
* @param string $version
*/
function add($id, $load_mode, $require, $path, $version=0)
function add($id, $load_mode, $require, $path, $version=0, $is_template=false)
{
if ($this->did_head && $load_mode==0)
{
@@ -1507,6 +1508,7 @@ class ScriptLoader
if (! isset( $this->registered_scripts[$id] ) )
{
$script = new Script($load_mode, $id, $path, $version, $require);
$script->is_template = $is_template;
self::fill_well_known($id, $script);
$this->registered_scripts[$id] = $script;