X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ffortune%2Ffunctions.php;h=f5851d9f31e0d272fb9fcbfdf38245444bab565b;hp=dddfdabdb5c2f0cc1dbc8aa09a59d3c91907a54b;hb=a67cf4877d741cffdf17affd2fae6359921b12ab;hpb=c3806a9dc07e4bf45491e7120a1c931332f2e555 diff --git a/plugins/fortune/functions.php b/plugins/fortune/functions.php index dddfdabd..f5851d9f 100644 --- a/plugins/fortune/functions.php +++ b/plugins/fortune/functions.php @@ -3,7 +3,7 @@ /** * Fortune plugin functions * - * @copyright © 2004-2006 The SquirrelMail Project Team + * @copyright © 2004-2007 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package plugins @@ -31,17 +31,12 @@ if (file_exists(SM_PATH . 'config/fortune_config.php')) { * @since 1.5.1 */ function fortune_function() { - global $fortune_visible, $color, $fortune_command; + global $oTemplate, $fortune_visible, $color, $fortune_command; if (!$fortune_visible) { return; } - echo "\n". - "
\n". - "
\n"; - echo '
'; - /* open handle and get all command output*/ $handle = popen($fortune_command,'r'); $fortune = ''; @@ -53,11 +48,12 @@ function fortune_function() { // %s shows executed fortune cookie command. $fortune = sprintf(_("Unable to execute \"%s\"."),$fortune_command); } - echo "
" . _("Today's Fortune") . "
\n" .
-            htmlspecialchars($fortune) .
-            "
\n"; - echo '
'; + $oTemplate->assign('color', $color); + $oTemplate->assign('fortune', htmlspecialchars($fortune)); + $output = $oTemplate->fetch('plugins/fortune/mailbox_index_before.tpl'); + return array('mailbox_index_before' => $output); + } /**