[geeklog-cvs] geeklog: Fixed autotags not always being replaced in templates (...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Jan 16 10:52:42 EST 2011
changeset 8054:d81201789f6b
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/d81201789f6b
user: Tom <websitemaster at cogeco.net>
date: Sun Jan 16 10:51:15 2011 -0500
description:
Fixed autotags not always being replaced in templates (Bug: #0001246)
diffstat:
public_html/lib-common.php | 12 ++++++++++--
system/classes/config.class.php | 3 ---
system/classes/template.class.php | 7 ++++---
3 files changed, 14 insertions(+), 8 deletions(-)
diffs (96 lines):
diff -r c9d234367f10 -r d81201789f6b public_html/lib-common.php
--- a/public_html/lib-common.php Tue Jan 11 14:57:37 2011 +0000
+++ b/public_html/lib-common.php Sun Jan 16 10:51:15 2011 -0500
@@ -887,8 +887,12 @@
'leftblocks' => 'leftblocks.thtml',
'rightblocks' => 'rightblocks.thtml'
));
+
+ $header->postprocess_fn = 'PLG_replaceTags';
+
$header->set_var('doctype', $doctype);
$header->set_var('xhtml', XHTML);
+
if (XHTML == '') {
$header->set_var('xmlns', '');
} else {
@@ -1342,6 +1346,8 @@
'rightblocks' => 'rightblocks.thtml',
'leftblocks' => 'leftblocks.thtml'
));
+
+ $footer->postprocess_fn = 'PLG_replaceTags';
// Do variable assignments
$footer->set_var( 'xhtml', XHTML );
@@ -1537,6 +1543,8 @@
$block = new Template( $_CONF['path_layout'] );
$block->set_file( 'block', $template );
+
+ $block->postprocess_fn = 'PLG_replaceTags';
$block->set_var( 'xhtml', XHTML );
$block->set_var( 'site_url', $_CONF['site_url'] );
@@ -1582,6 +1590,8 @@
$block = new Template( $_CONF['path_layout'] );
$block->set_file( 'block', $template );
+
+ $block->postprocess_fn = 'PLG_replaceTags';
$block->set_var( 'xhtml', XHTML );
$block->set_var( 'site_url', $_CONF['site_url'] );
@@ -6764,8 +6774,6 @@
$tooltip = new Template($_CONF['path_layout'] .'tooltips/');
$tooltip->set_file(array('tooltip' => $template . '.thtml'));
- $tooltip->preprocess_fn = ''; // Do not process for autotags in text since tooltip
-
$tooltip->set_var('xhtml', XHTML);
$tooltip->set_var('layout_url', $_CONF['layout_url']);
$tooltip->set_var('class', $class);
diff -r c9d234367f10 -r d81201789f6b system/classes/config.class.php
--- a/system/classes/config.class.php Tue Jan 11 14:57:37 2011 +0000
+++ b/system/classes/config.class.php Sun Jan 16 10:51:15 2011 -0500
@@ -472,9 +472,6 @@
$t->set_file(array('main' => 'configuration.thtml',
'menugroup' => 'menu_element.thtml'));
- // Disable autotags in templates for configuration
- $t->preprocess_fn = '';
-
$t->set_var('xhtml', XHTML);
$t->set_var('site_url', $_CONF['site_url']);
$t->set_var('site_admin_url', $_CONF['site_admin_url']);
diff -r c9d234367f10 -r d81201789f6b system/classes/template.class.php
--- a/system/classes/template.class.php Tue Jan 11 14:57:37 2011 +0000
+++ b/system/classes/template.class.php Sun Jan 16 10:51:15 2011 -0500
@@ -146,7 +146,7 @@
* @access public
* @see _preprocess
*/
- var $preprocess_fn = 'PLG_replaceTags';
+ var $preprocess_fn = '';
/**
* The name of a function is retained in this variable and is used to do any post processing work.
@@ -621,8 +621,6 @@
}
}
}
-
- $str = $this->_preprocess($str);
if ($this->debug & 4) {
echo "<p><b>parse:</b> completed</p>\n";
@@ -924,6 +922,9 @@
if ($this->debug & 4) {
printf("<b>loadfile:</b> loaded $filename into $varname<br" . XHTML . ">\n");
}
+
+ $str = $this->_preprocess($str);
+
$this->set_var($varname, $str);
return true;
More information about the geeklog-cvs
mailing list