aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2013-11-18 08:53:24 +0000
committermistic100 <mistic@piwigo.org>2013-11-18 08:53:24 +0000
commit54343578e9f824dcdebb7874308fff4dc71c3619 (patch)
tree8b3514b4e4b03943e9486e0edced7f0ad423320c /include
parent77261474451422594d42d4327c62fc448776afbf (diff)
feature 2963 & feature 2985 : more flexibility for FileCombiner (keep API compatibility)
git-svn-id: http://piwigo.org/svn/trunk@25547 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/template.class.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/template.class.php b/include/template.class.php
index b91d34b2a..32c224581 100644
--- a/include/template.class.php
+++ b/include/template.class.php
@@ -1366,7 +1366,7 @@ final class FileCombiner
private $is_css;
private $combinables;
- function FileCombiner($type, $combinables)
+ function FileCombiner($type, $combinables=array())
{
$this->type = $type;
$this->is_css = $type=='css';
@@ -1386,8 +1386,15 @@ final class FileCombiner
function add($combinables)
{
- foreach($combinables as $combinable)
- $this->combinables[] = $combinable;
+ if ($combinables instanceof Combinable)
+ {
+ $this->combinables[] = $combinables;
+ }
+ else
+ {
+ foreach($combinables as $combinable)
+ $this->combinables[] = $combinable;
+ }
}
function combine()