From 54343578e9f824dcdebb7874308fff4dc71c3619 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Mon, 18 Nov 2013 08:53:24 +0000 Subject: [PATCH] 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 --- include/template.class.php | 13 ++++++++++--- 1 file 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()