cvs: smarty / Smarty.class.php
| From: | Andrei Zmievski | Date: | Tue, 16 Apr 2002 20:06:31 +0000 |
| Subject: | cvs: smarty / Smarty.class.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-65@lists.php.net to get a copy of this message | ||
andrei Tue Apr 16 16:06:31 2002 EDT
Modified files:
/smarty Smarty.class.php
Log:
Add register/unregister API for output filters.
Index: smarty/Smarty.class.php
diff -u smarty/Smarty.class.php:1.268 smarty/Smarty.class.php:1.269
--- smarty/Smarty.class.php:1.268 Tue Apr 16 16:04:06 2002
+++ smarty/Smarty.class.php Tue Apr 16 16:06:31 2002
@@ -380,10 +380,7 @@
\*======================================================================*/
function unregister_prefilter($function)
{
- if (isset($this->_plugins['prefilter'][$function]))
- unset($this->_plugins['prefilter'][$function]);
- else
- $this->_plugins['prefilter'][$function] = false;
+ unset($this->_plugins['prefilter'][$function]);
}
/*======================================================================*\
@@ -403,10 +400,27 @@
\*======================================================================*/
function unregister_postfilter($function)
{
- if (isset($this->_plugins['postfilter'][$function]))
- unset($this->_plugins['postfilter'][$function]);
- else
- $this->_plugins['postfilter'][$function] = false;
+ unset($this->_plugins['postfilter'][$function]);
+ }
+
+/*======================================================================*\
+ Function: register_outputfilter
+ Purpose: Registers an output filter function to apply
+ to a template output
+\*======================================================================*/
+ function register_outputfilter($function)
+ {
+ $this->_plugins['postfilter'][$function]
+ = array($function, null, null, false);
+ }
+
+/*======================================================================*\
+ Function: unregister_outputfilter
+ Purpose: Unregisters an outputfilter function
+\*======================================================================*/
+ function unregister_outputfilter($function)
+ {
+ unset($this->_plugins['outputfilter'][$function]);
}
/*======================================================================*\