From cbd0a1e886ec321ba456c026138080936f5ea28a Mon Sep 17 00:00:00 2001 From: rvelices Date: Thu, 27 Jun 2013 04:37:38 +0000 Subject: fix define_derivative (matter of smarty3 variable scope) git-svn-id: http://piwigo.org/svn/trunk@23588 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/template.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/template.class.php b/include/template.class.php index 6fab611c5..e4a731aef 100644 --- a/include/template.class.php +++ b/include/template.class.php @@ -406,7 +406,7 @@ class Template { .'">'; } - $this->output = substr_replace( $this->output, "\n".implode( "\n", $content ), $pos, strlen(self::COMBINED_SCRIPTS_TAG) ); + $this->output = substr_replace( $this->output, implode( "\n", $content ), $pos, strlen(self::COMBINED_SCRIPTS_TAG) ); } //else maybe error or warning ? } @@ -574,13 +574,13 @@ class Template { } } - function func_define_derivative($params) + function func_define_derivative($params, $smarty) { !empty($params['name']) or fatal_error('define_derivative missing name'); if (isset($params['type'])) { $derivative = ImageStdParams::get_by_type($params['type']); - $this->smarty->assign( $params['name'], $derivative); + $smarty->assign( $params['name'], $derivative); return; } !empty($params['width']) or fatal_error('define_derivative missing width'); @@ -612,7 +612,7 @@ class Template { } } - $this->smarty->assign( $params['name'], ImageStdParams::get_custom($w, $h, $crop, $minw, $minh) ); + $smarty->assign( $params['name'], ImageStdParams::get_custom($w, $h, $crop, $minw, $minh) ); } /** @@ -830,13 +830,13 @@ var s,after = document.getElementsByTagName(\'script\')[document.getElementsByTa $tags = array('if','foreach','section','footer_script'); foreach($tags as $tag) { - array_push($regex, "#^[ \t]+($ldq$tag"."[^$ld$rd]*$rdq)\s*$#m"); - array_push($regex, "#^[ \t]+($ldq/$tag$rdq)\s*$#m"); + $regex[] = "#^[ \t]+($ldq$tag"."[^$ld$rd]*$rdq)\s*$#m"; + $regex[] = "#^[ \t]+($ldq/$tag$rdq)\s*$#m"; } $tags = array('include','else','combine_script','html_head'); foreach($tags as $tag) { - array_push($regex, "#^[ \t]+($ldq$tag"."[^$ld$rd]*$rdq)\s*$#m"); + $regex[] = "#^[ \t]+($ldq$tag"."[^$ld$rd]*$rdq)\s*$#m"; } $source = preg_replace( $regex, "$1", $source); return $source; @@ -866,13 +866,13 @@ var s,after = document.getElementsByTagName(\'script\')[document.getElementsByTa $f = PWG_LOCAL_DIR.'css/'.$theme['id'].'-rules.css'; if (file_exists(PHPWG_ROOT_PATH.$f)) { - array_push($css, "{combine_css path='$f' order=10}"); + $css[] = "{combine_css path='$f' order=10}"; } } $f = PWG_LOCAL_DIR.'css/rules.css'; if (file_exists(PHPWG_ROOT_PATH.$f)) { - array_push($css, "{combine_css path='$f' order=10}"); + $css[] = "{combine_css path='$f' order=10}"; } if (!empty($css)) -- cgit v1.2.3