[geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.367,1.368
blaine at iowaoutdoors.org
blaine at iowaoutdoors.org
Wed Aug 25 23:35:29 EDT 2004
Update of /var/cvs/geeklog-1.3/public_html
In directory www:/tmp/cvs-serv22828/public_html
Modified Files:
lib-common.php
Log Message:
Added call to PLG_templateSetVars so that any plugins have a chance to set any new template variables in header.html.
Added capability to COM_siteHeader and COM_siteFooter to specify a custom function that will be used to format or control what blocks are used. Plugins can now take control and display custom blocks and over-ride defaults. A plugin function can just call COM_formatBlock with the desired blocks.
Index: lib-common.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.367
retrieving revision 1.368
diff -C2 -d -r1.367 -r1.368
*** lib-common.php 25 Aug 2004 22:56:02 -0000 1.367
--- lib-common.php 26 Aug 2004 03:35:27 -0000 1.368
***************
*** 913,917 ****
}
! if( $what <> 'none' )
{
// Now show any blocks -- need to get the topic if not on home page
--- 913,931 ----
}
! /* Check if an array has been passed that includes the name of a plugin function or custom function
! * This can be used to take control over what blocks are then displayed
! */
! if (is_array($what))
! {
! $function = $what['0'];
! if (function_exists($function)) {
! $lblocks = $function($what['1'],'left');
! if ($lblocks != '') {
! $header->set_var( 'geeklog_blocks', $lblocks);
! $header->parse( 'left_blocks', 'leftblocks', true );
! }
! }
! }
! elseif( $what <> 'none' )
{
// Now show any blocks -- need to get the topic if not on home page
***************
*** 928,931 ****
--- 942,948 ----
$header->set_var( 'plg_headercode', PLG_getHeaderCode());
+ // Call to plugins to set template variables in the header
+ PLG_templateSetVars ('header', $header);
+
// The following line allows users to embed PHP in their templates. This
// is almost a contradition to the reasons for using templates but this may
***************
*** 949,958 ****
* HTML for the site footer.
*
! * @param boolean $rightblock Whether or not to show blocks on right hand side default is no
* @see function COM_siteHeader
* @return string Formated HTML containing site footer and optionally right blocks
*
*/
! function COM_siteFooter( $rightblock = false )
{
global $_CONF, $LANG01, $_PAGE_TIMER, $_TABLES, $topic;
--- 966,976 ----
* HTML for the site footer.
*
! * @param boolean $rightblock Whether or not to show blocks on right hand side default is no
! * @param array $custom An array defining custom function to be used to format Rightblocks
* @see function COM_siteHeader
* @return string Formated HTML containing site footer and optionally right blocks
*
*/
! function COM_siteFooter( $rightblock = false, $custom='')
{
global $_CONF, $LANG01, $_PAGE_TIMER, $_TABLES, $topic;
***************
*** 1010,1014 ****
$footer->set_var( 'execution_textandtime', $exectext );
! if( $rightblock )
{
$rblocks = COM_showBlocks( 'right', $topic );
--- 1028,1042 ----
$footer->set_var( 'execution_textandtime', $exectext );
! /* Check if an array has been passed that includes the name of a plugin function or custom function
! * This can be used to take control over what blocks are then displayed
! */
! if (is_array($custom))
! {
! $function = $custom['0'];
! if (function_exists($function)) {
! $rblocks = $function($custom['1'],'right');
! }
! }
! elseif( $rightblock )
{
$rblocks = COM_showBlocks( 'right', $topic );
More information about the geeklog-cvs
mailing list