X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ffortune%2Ffunctions.php;h=0173e3bb91bd0789ba29a57d1126a97b3fdcfbab;hp=dddfdabdb5c2f0cc1dbc8aa09a59d3c91907a54b;hb=1e532e26cb164aba478840773ca0b68ebb92a148;hpb=c3806a9dc07e4bf45491e7120a1c931332f2e555 diff --git a/plugins/fortune/functions.php b/plugins/fortune/functions.php index dddfdabd..0173e3bb 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-2009 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 = ''; @@ -50,14 +45,15 @@ function fortune_function() { } /* if pclose return != 0, popen command failed. Yes, I know that it is broken when --enable-sigchild is used */ if (pclose($handle)) { - // %s shows executed fortune cookie command. + // i18n: %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); + } /**