summaryrefslogtreecommitdiff
path: root/buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/block.strip.php
diff options
context:
space:
mode:
authorxue <>2006-06-19 18:38:29 +0000
committerxue <>2006-06-19 18:38:29 +0000
commit588727c7e2b8954ec3dbde293cf4c4d68b119f9b (patch)
treefdcc16181a20335547953ccf1550e0006c11bf28 /buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/block.strip.php
parent127f78a4db3cc0fbbbb92f5b1abcfdce4a9af93b (diff)
Merge from 3.0 branch till 1185.
Diffstat (limited to 'buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/block.strip.php')
-rw-r--r--buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/block.strip.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/block.strip.php b/buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/block.strip.php
new file mode 100644
index 00000000..a25df360
--- /dev/null
+++ b/buildscripts/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/block.strip.php
@@ -0,0 +1,35 @@
+<?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, &$this)
+{
+ /* 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: */
+
+?>