[geeklog-cvs] geeklog: Themes can now have their own display funtions for the ...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Wed Sep 8 10:04:19 EDT 2010
changeset 7973:26940599bc4c
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/26940599bc4c
user: Tom <websitemaster at cogeco.net>
date: Wed Sep 08 10:03:00 2010 -0400
description:
Themes can now have their own display funtions for the start and end of Blocks. (request by Wayne)
diffstat:
public_html/docs/history | 2 ++
public_html/lib-common.php | 22 +++++++++++++++-------
2 files changed, 17 insertions(+), 7 deletions(-)
diffs (62 lines):
diff -r c5a608f996c1 -r 26940599bc4c public_html/docs/history
--- a/public_html/docs/history Sun Sep 05 13:04:57 2010 +0200
+++ b/public_html/docs/history Wed Sep 08 10:03:00 2010 -0400
@@ -3,6 +3,8 @@
Sep ?, 2010 (1.7.1rc1)
-----------
+- Themes can now have their own display funtions for the start and end of Blocks.
+ (Feature #0001188) [Tom]
- Reverted a change in 1.7.0 that would send a Content-Type header when calling
COM_refresh since this conflicts with some plugins (e.g. the Forum) [Dirk]
- Fixed wrong view after posting a comment on a poll (bug #0001080, patch
diff -r c5a608f996c1 -r 26940599bc4c public_html/lib-common.php
--- a/public_html/lib-common.php Sun Sep 05 13:04:57 2010 +0200
+++ b/public_html/lib-common.php Wed Sep 08 10:03:00 2010 -0400
@@ -1532,6 +1532,12 @@
function COM_startBlock( $title='', $helpfile='', $template='blockheader.thtml' )
{
global $_CONF, $LANG01, $_IMAGE_TYPE;
+
+ // If the theme implemented this for us then call their version instead.
+ $function = $_CONF['theme'] . '_startBlock';
+ if( function_exists( $function )) {
+ return $function( $title, $helpfile, $template );
+ }
$block = new Template( $_CONF['path_layout'] );
$block->set_file( 'block', $template );
@@ -1542,17 +1548,13 @@
$block->set_var( 'layout_url', $_CONF['layout_url'] );
$block->set_var( 'block_title', stripslashes( $title ));
- if( !empty( $helpfile ))
- {
+ if( !empty( $helpfile )) {
$helpimg = $_CONF['layout_url'] . '/images/button_help.' . $_IMAGE_TYPE;
$help_content = '<img src="' . $helpimg. '" alt="?"' . XHTML . '>';
$help_attr = array('class'=>'blocktitle');
- if( !stristr( $helpfile, 'http://' ))
- {
+ if( !stristr( $helpfile, 'http://' )) {
$help_url = $_CONF['site_url'] . "/help/$helpfile";
- }
- else
- {
+ } else {
$help_url = $helpfile;
}
$help = COM_createLink($help_content, $help_url, $help_attr);
@@ -1575,6 +1577,12 @@
function COM_endBlock( $template='blockfooter.thtml' )
{
global $_CONF;
+
+ // If the theme implemented this for us then call their version instead.
+ $function = $_CONF['theme'] . '_endBlock';
+ if( function_exists( $function )) {
+ return $function( $template );
+ }
$block = new Template( $_CONF['path_layout'] );
$block->set_file( 'block', $template );
More information about the geeklog-cvs
mailing list