Files
smarty/libs/plugins/block.strip.php
mohrt f42a23f504 fix config_load, compile fetched arrays to compile_dir, switch display
back to runtime. clean up var names and function names,  split up compile
testing and compiling to separate funcs, rename some template_* functions to
file_* functions and update logic so they can be used for file resources
other than templates.
2003-06-16 19:45:11 +00:00

36 lines
955 B
PHP

<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty {strip}{/strip} block plugin
*
* Type: block function<br>
* Name: strip<br>
* Purpose: strip unwanted white space from text<br>
* @link http://smarty.php.net/manual/en/language.function.strip.php {strip}
* (Smarty online manual)
* @param array unused, no parameters for this block
* @param string content of {strip}{/strip} tags
* @param Smarty clever method emulation
* @return string $content stripped of whitespace
*/
function smarty_block_strip($params, $content, &$smarty)
{
/* Reformat data between 'strip' and '/strip' tags, removing spaces, tabs and newlines. */
$_strip_search = array(
"![\t ]+$|^[\t ]+!m", // remove leading/trailing space chars
'%[\r\n]+%m'); // remove CRs and newlines
$_strip_replace = array(
'',
'');
return preg_replace($_strip_search, $_strip_replace, $content);
}
/* vim: set expandtab: */
?>