cvs: smarty / NEWS /libs Smarty.class.php Smarty_Compiler.class.php /libs/plugins block.textformat.php

From: Date: Sun, 20 Apr 2003 18:33:31 +0000
Subject: cvs: smarty / NEWS /libs Smarty.class.php Smarty_Compiler.class.php /libs/plugins block.textformat.php
Groups: php.smarty.cvs 
Request: Send a blank email to php-smarty-cvs+get-541@lists.php.net to get a copy of this message
mohrt Sun Apr 20 14:33:31 2003 EDT Modified files: /smarty NEWS /smarty/libs Smarty.class.php Smarty_Compiler.class.php /smarty/libs/plugins block.textformat.php Log: moved strip from smarty core to plugin, made textformat block function return output instead of echo it Index: smarty/NEWS diff -u smarty/NEWS:1.346 smarty/NEWS:1.347 --- smarty/NEWS:1.346 Sun Apr 20 14:08:04 2003 +++ smarty/NEWS Sun Apr 20 14:33:31 2003 @@ -1,3 +1,4 @@ + - moved strip from smarty core to plugin (Monte) - moved config_load from smarty core to plugin (Monte) - added &$repeat-paramter to block-functions (messju) - enabled hex-constants in function.math.php (messju) Index: smarty/libs/Smarty.class.php diff -u smarty/libs/Smarty.class.php:1.379 smarty/libs/Smarty.class.php:1.380 --- smarty/libs/Smarty.class.php:1.379 Sun Apr 20 14:08:04 2003 +++ smarty/libs/Smarty.class.php Sun Apr 20 14:33:31 2003 @@ -42,7 +42,7 @@ * @version 2.5.0 */ -/* $Id: Smarty.class.php,v 1.379 2003/04/20 18:08:04 mohrt Exp $ */ +/* $Id: Smarty.class.php,v 1.380 2003/04/20 18:33:31 mohrt Exp $ */ /** * set SMARTY_DIR to absolute path to Smarty library files. @@ -1281,7 +1281,7 @@ * @param string $scope */ function config_load($file, $section = null, $scope = 'global') - { + { require_once($this->_get_plugin_filepath('function', 'config_load')); smarty_function_config_load(array('file' => $file, 'section' => $section, 'scope' => $scope), $this); } Index: smarty/libs/Smarty_Compiler.class.php diff -u smarty/libs/Smarty_Compiler.class.php:1.214 smarty/libs/Smarty_Compiler.class.php:1.215 --- smarty/libs/Smarty_Compiler.class.php:1.214 Sun Apr 20 14:08:04 2003 +++ smarty/libs/Smarty_Compiler.class.php Sun Apr 20 14:33:31 2003 @@ -39,7 +39,7 @@ * @package Smarty */ -/* $Id: Smarty_Compiler.class.php,v 1.214 2003/04/20 18:08:04 mohrt Exp $ */ +/* $Id: Smarty_Compiler.class.php,v 1.215 2003/04/20 18:33:31 mohrt Exp $ */ class Smarty_Compiler extends Smarty { @@ -307,26 +307,6 @@ } $template_compiled .= $text_blocks[$i]; - /* Reformat data between 'strip' and '/strip' tags, removing spaces, tabs and newlines. */ - if (preg_match_all("!{$ldq}strip{$rdq}.*?{$ldq}/strip{$rdq}!s", $template_compiled, $_match)) { - $strip_tags = $_match[0]; - $_strip_search = array( - '%([^\\\\]\?>)\n%', // remove newlines after PHP close tags - "!{$ldq}/?strip{$rdq}|[\t ]+$|^[\t ]+!m", // remove leading/trailing space chars - '%[\r\n]+%m', // remove CRs and newlines - '%([^\\\\]\?>)%'); // replace newlines after PHP close tags - $_strip_replace = array( - '\\1', - '', - '', - '\\1' . "\n"); - $strip_tags_modified = preg_replace($_strip_search, $_strip_replace, $strip_tags); - for ($i = 0, $for_max = count($strip_tags); $i < $for_max; $i++) - $template_compiled = preg_replace("!{$ldq}strip{$rdq}.*?{$ldq}/strip{$rdq}!s", - $this->quote_replace($strip_tags_modified[$i]), - $template_compiled, 1); - } - // remove \n from the end of the file, if any if ($template_compiled{strlen($template_compiled) - 1} == "\n" ) { $template_compiled = substr($template_compiled, 0, -1); @@ -473,10 +453,6 @@ return "<?php endif; ?>"; else return "<?php endforeach; endif; ?>"; - - case 'strip': - case '/strip': - return $this->left_delimiter.$tag_command.$this->right_delimiter; case 'literal': list (,$literal_block) = each($this->_literal_blocks); Index: smarty/libs/plugins/block.textformat.php diff -u smarty/libs/plugins/block.textformat.php:1.2 smarty/libs/plugins/block.textformat.php:1.3 --- smarty/libs/plugins/block.textformat.php:1.2 Sun Apr 20 02:01:16 2003 +++ smarty/libs/plugins/block.textformat.php Sun Apr 20 14:33:31 2003 @@ -70,9 +70,8 @@ if($assign != null) { $this->assign($assign,$output); } else { - echo $output; + return $output; } - //echo $content; } /* vim: set expandtab: */

« previous php.smarty.cvs (#541) next »