Changeset 23588


Ignore:
Timestamp:
Jun 27, 2013, 6:37:38 AM (11 years ago)
Author:
rvelices
Message:

fix define_derivative (matter of smarty3 variable scope)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/template.class.php

    r23495 r23588  
    407407          }
    408408
    409           $this->output = substr_replace( $this->output, "\n".implode( "\n", $content ), $pos, strlen(self::COMBINED_SCRIPTS_TAG) );
     409          $this->output = substr_replace( $this->output, implode( "\n", $content ), $pos, strlen(self::COMBINED_SCRIPTS_TAG) );
    410410      } //else maybe error or warning ?
    411411    }
     
    575575  }
    576576
    577   function func_define_derivative($params)
     577  function func_define_derivative($params, $smarty)
    578578  {
    579579    !empty($params['name']) or fatal_error('define_derivative missing name');
     
    581581    {
    582582      $derivative = ImageStdParams::get_by_type($params['type']);
    583       $this->smarty->assign( $params['name'], $derivative);
     583      $smarty->assign( $params['name'], $derivative);
    584584      return;
    585585    }
     
    613613    }
    614614
    615     $this->smarty->assign( $params['name'], ImageStdParams::get_custom($w, $h, $crop, $minw, $minh) );
     615    $smarty->assign( $params['name'], ImageStdParams::get_custom($w, $h, $crop, $minw, $minh) );
    616616  }
    617617
     
    831831    foreach($tags as $tag)
    832832    {
    833       array_push($regex, "#^[ \t]+($ldq$tag"."[^$ld$rd]*$rdq)\s*$#m");
    834       array_push($regex, "#^[ \t]+($ldq/$tag$rdq)\s*$#m");
     833      $regex[] = "#^[ \t]+($ldq$tag"."[^$ld$rd]*$rdq)\s*$#m";
     834      $regex[] = "#^[ \t]+($ldq/$tag$rdq)\s*$#m";
    835835    }
    836836    $tags = array('include','else','combine_script','html_head');
    837837    foreach($tags as $tag)
    838838    {
    839       array_push($regex, "#^[ \t]+($ldq$tag"."[^$ld$rd]*$rdq)\s*$#m");
     839      $regex[] = "#^[ \t]+($ldq$tag"."[^$ld$rd]*$rdq)\s*$#m";
    840840    }
    841841    $source = preg_replace( $regex, "$1", $source);
     
    867867      if (file_exists(PHPWG_ROOT_PATH.$f))
    868868      {
    869         array_push($css, "{combine_css path='$f' order=10}");
     869        $css[] = "{combine_css path='$f' order=10}";
    870870      }
    871871    }
     
    873873    if (file_exists(PHPWG_ROOT_PATH.$f))
    874874    {
    875       array_push($css, "{combine_css path='$f' order=10}");
     875      $css[] = "{combine_css path='$f' order=10}";
    876876    }
    877877
Note: See TracChangeset for help on using the changeset viewer.