From 0255b986be64fedcdffc6cfcbfe3a47383e14144 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Sun, 15 Jul 2007 19:16:05 +0000 Subject: [PATCH] Enable better plugin motd hooking git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12539 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/right_main.php | 9 +++++++-- templates/default/motd.tpl | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/right_main.php b/src/right_main.php index 0522221f..858998a3 100644 --- a/src/right_main.php +++ b/src/right_main.php @@ -277,7 +277,12 @@ if (isset($aMailbox['FORWARD_SESSION'])) { 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 @@ if ( sqgetGlobalVar('just_logged_in', $just_logged_in, SQ_SESSION) ) { 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'); } diff --git a/templates/default/motd.tpl b/templates/default/motd.tpl index 19fcaf9a..9abf5719 100644 --- a/templates/default/motd.tpl +++ b/templates/default/motd.tpl @@ -22,7 +22,10 @@ extract($t);
- +
-- 2.25.1