From: <pdo...@us...> - 2007-07-15 19:16:08
|
Revision: 12539 http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=12539&view=rev Author: pdontthink Date: 2007-07-15 12:16:05 -0700 (Sun, 15 Jul 2007) Log Message: ----------- Enable better plugin motd hooking Modified Paths: -------------- trunk/squirrelmail/src/right_main.php trunk/squirrelmail/templates/default/motd.tpl Modified: trunk/squirrelmail/src/right_main.php =================================================================== --- trunk/squirrelmail/src/right_main.php 2007-07-14 19:04:00 UTC (rev 12538) +++ trunk/squirrelmail/src/right_main.php 2007-07-15 19:16:05 UTC (rev 12539) @@ -277,7 +277,12 @@ displayPageHeader($color, $mailbox); } -do_hook('right_main_after_header', $null); +// plugins can operate normally here (don't output anything, of course!), +// but can also return TRUE if they want to enable the MOTD display +// even when SM's MOTD is empty (there is plugin output that can +// be then hooked into in motd.tpl) +// +$show_motd = boolean_hook_function('right_main_after_header', $null, 1); /* display a message to the user that their mail has been sent */ if (isset($mail_sent) && $mail_sent == 'yes') { @@ -294,7 +299,7 @@ sqsession_register($just_logged_in, 'just_logged_in'); $motd = trim($motd); - if (strlen($motd) > 0) { + if ($show_motd || strlen($motd) > 0) { $oTemplate->assign('motd', $motd); $oTemplate->display('motd.tpl'); } Modified: trunk/squirrelmail/templates/default/motd.tpl =================================================================== --- trunk/squirrelmail/templates/default/motd.tpl 2007-07-14 19:04:00 UTC (rev 12538) +++ trunk/squirrelmail/templates/default/motd.tpl 2007-07-15 19:16:05 UTC (rev 12539) @@ -22,7 +22,10 @@ <table class="sqm_motd" cellspacing="3"> <tr> <td> - <?php echo $motd; ?> + <?php echo $motd; + if (!empty($plugin_output['motd_inside'])) + echo $plugin_output['motd_inside']; + ?> </td> </tr> </table> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |