[geeklog-cvs] geeklog: Added block_start and block_end template variables to s...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Mon Jan 16 16:42:14 EST 2012


changeset 8477:b91b9523a8d3
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/b91b9523a8d3
user: Tom <websitemaster at cogeco.net>
date: Mon Jan 16 16:41:08 2012 -0500
description:
Added block_start and block_end template variables to staticpage plugin templates to allow for better positioning of breadcrumbs.

diffstat:

 plugins/staticpages/functions.inc               |  41 ++++++++++++++----------
 plugins/staticpages/templates/centerblock.thtml |   2 +
 plugins/staticpages/templates/staticpage.thtml  |   2 +
 3 files changed, 27 insertions(+), 18 deletions(-)

diffs (103 lines):

diff -r 327e67d55a2f -r b91b9523a8d3 plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc	Mon Jan 16 13:46:35 2012 -0500
+++ b/plugins/staticpages/functions.inc	Mon Jan 16 16:41:08 2012 -0500
@@ -331,17 +331,18 @@
         if ($msg > 0) {
             $retval .= COM_showMessage($msg, 'staticpages');
         }
-        if ($A['sp_inblock'] == 1) {
-            $retval .= COM_startBlock(stripslashes($A['sp_title']), $A['sp_help'],
-                            COM_getBlockTemplate('_staticpages_block', 'header'));
-        }
 
         $template_path = staticpages_templatePath();
         $spage = COM_newTemplate($template_path);
         $spage->set_file(array('page'     => 'staticpage.thtml',
                                'comments' => 'spcomments.thtml'));
         
-        $spage->set_var('sp_id', $page);   
+        $spage->set_var('sp_id', $page);
+        
+        if ($A['sp_inblock'] == 1) {
+            $spage->set_var('block_start', COM_startBlock(stripslashes($A['sp_title']), $A['sp_help'],
+                            COM_getBlockTemplate('_staticpages_block', 'header')));            
+        }        
         
         if (XHTML != '') {
             $spage->set_var('xmlns', ' xmlns="http://www.w3.org/1999/xhtml"');
@@ -464,13 +465,15 @@
         }
 
         // Call to plugins to set template variables
-        PLG_templateSetVars('staticpage', $spage); 
+        PLG_templateSetVars('staticpage', $spage);
+        
+        if ($A['sp_inblock'] == 1) {
+            $spage->set_var('block_end', COM_endBlock(COM_getBlockTemplate('_staticpages_block',
+                                                         'footer')));
+        }
+        
 
         $retval .= $spage->finish($spage->parse('output', 'page'));
-        if ($A['sp_inblock'] == 1) {
-            $retval .= COM_endBlock(COM_getBlockTemplate('_staticpages_block',
-                                                         'footer'));
-        }
 
         if (!isset($_USER['noboxes'])) {
             if (COM_isAnonUser()) {
@@ -1033,15 +1036,15 @@
                 }
             }
 
-            if (($S['sp_inblock'] == 1) && !empty ($S['sp_title'])
-                && (($where != 0) || ($S['sp_format'] != 'blankpage'))) {
-                $retval .= COM_startBlock ($S['sp_title'], $S['sp_help'],
-                    COM_getBlockTemplate ('_staticpages_centerblock', 'header'));
-            }
-
             $template_path = staticpages_templatePath();
             $spage = COM_newTemplate($template_path);
             $spage->set_file(array('page' => 'centerblock.thtml'));
+            
+            if (($S['sp_inblock'] == 1) && !empty ($S['sp_title'])
+                && (($where != 0) || ($S['sp_format'] != 'blankpage'))) {
+               $spage->set_var('block_start', COM_startBlock ($S['sp_title'], $S['sp_help'],
+                    COM_getBlockTemplate ('_staticpages_centerblock', 'header')));                
+            }            
 
             if ($_CONF['hideprintericon'] == 0) {
                 $icon_url = $_CONF['layout_url'] . '/images/print.'
@@ -1109,11 +1112,13 @@
             }
             
             $spage->set_var('content', $content);
-            $retval .= $spage->finish($spage->parse('output', 'page'));
+            
             if (($S['sp_inblock'] == 1) && !empty ($S['sp_title']) &&
                     (($where != 0) || ($S['sp_format'] != 'blankpage'))) {
-                $retval .= COM_endBlock(COM_getBlockTemplate('_staticpages_centerblock', 'footer'));
+                $spage->set_var('block_end', COM_endBlock(COM_getBlockTemplate('_staticpages_centerblock', 'footer')));
             }
+            
+            $retval .= $spage->finish($spage->parse('output', 'page'));
 
             if ($where == 0) {
                 if ($S['sp_format'] == 'allblocks') {
diff -r 327e67d55a2f -r b91b9523a8d3 plugins/staticpages/templates/centerblock.thtml
--- a/plugins/staticpages/templates/centerblock.thtml	Mon Jan 16 13:46:35 2012 -0500
+++ b/plugins/staticpages/templates/centerblock.thtml	Mon Jan 16 16:41:08 2012 -0500
@@ -1,1 +1,3 @@
+{block_start}
 {content}
+{block_end}
diff -r 327e67d55a2f -r b91b9523a8d3 plugins/staticpages/templates/staticpage.thtml
--- a/plugins/staticpages/templates/staticpage.thtml	Mon Jan 16 13:46:35 2012 -0500
+++ b/plugins/staticpages/templates/staticpage.thtml	Mon Jan 16 16:41:08 2012 -0500
@@ -1,4 +1,6 @@
 {breadcrumb_trail}
+{block_start}
 {content}
+{block_end}
 <p class="aligncenter">{lastupdate}<span style="padding-left:5px;padding-right:5px;visibility:{info_separator}">|</span>{hits} {print_icon}{edit_icon}</p>
 {commentbar}



More information about the geeklog-cvs mailing list