[geeklog-cvs] geeklog: Added the ability to allow post processing done on the ...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Wed Aug 11 20:37:12 EDT 2010
changeset 7960:f81f1b719488
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/f81f1b719488
user: Tom <websitemaster at cogeco.net>
date: Wed Aug 11 20:35:29 2010 -0400
description:
Added the ability to allow post processing done on the return string of the template. It defaults to the Autotags function.
diffstat:
system/classes/template.class.php | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
diffs (53 lines):
diff -r 4df4cb41453b -r f81f1b719488 system/classes/template.class.php
--- a/system/classes/template.class.php Sat Jun 12 00:02:45 2010 -0400
+++ b/system/classes/template.class.php Wed Aug 11 20:35:29 2010 -0400
@@ -144,6 +144,34 @@
* @see halt
*/
var $last_error = '';
+
+ /**
+ * The name of a function is retained in this variable and is used to do any post processing work. Defaults to checking for Autotags
+ *
+ * @var string
+ * @access public
+ * @see halt
+ */
+ var $postprocess_fn = 'PLG_replaceTags';
+
+
+ /**
+* Replace Tags
+*
+* Perform any post processing work by calling the function held in $postprocess_fn
+*
+* @param string $str String to search for Autotags
+* @access private
+*/
+function _postprocess($str)
+{
+ $function = $this->postprocess_fn;
+ if (function_exists($function)) {
+ $str = $function($str);
+ }
+
+ return $str;
+}
/******************************************************************************
* Class constructor. May be called with two optional parameters.
@@ -748,6 +776,8 @@
break;
}
+ $str = $this->_postprocess($str);
+
return $str;
}
@@ -929,4 +959,5 @@
}
}
+
?>
More information about the geeklog-cvs
mailing list