}
function error_box($string, $color) {
- echo ' <table width="100%" cellpadding="1" cellspacing="0" align="center"'.' border="0" bgcolor="'.$color[9].'">';
- echo ' <tr><td>';
- echo ' <table width="100%" cellpadding="0" cellspacing="0" align="center" border="0" bgcolor="'.$color[4].'">';
- echo ' <tr><td ALIGN="center" bgcolor="'.$color[0].'">';
- echo ' <font color="' . $color[2].'"><b>' . _("ERROR") . ':</b></font>';
- echo ' </td></tr>';
- echo ' <tr><td>';
- echo ' <table cellpadding="1" cellspacing="5" align="center" border="0">';
- echo ' <tr>' . html_tag( 'td', $string."\n", 'left')
- . '</tr>';
- echo ' </table>';
- echo ' </table></td></tr>';
- echo ' </table>';
- echo ' </td></tr>';
+ global $pageheader_sent;
+
+ $err = _("ERROR");
+
+ /* check if the page header has been sent; if not, send it! */
+ if(!isset($pageheader_sent) && !$pageheader_sent) {
+ /* include this just to be sure */
+ include_once( SM_PATH . 'functions/page_header.php' );
+ displayHtmlHeader('SquirrelMail: '.$err);
+ $pageheader_sent = TRUE;
+ echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\">\n\n";
+ }
+
+ echo ' <table width="100%" cellpadding="1" cellspacing="0" align="center" border="0" bgcolor="'.$color[9].'">'
+ . ' <tr><td>'
+ . ' <table width="100%" cellpadding="0" cellspacing="0" align="center" border="0" bgcolor="'.$color[4].'">'
+ . ' <tr><td ALIGN="center" bgcolor="'.$color[0].'">'
+ . ' <font color="' . $color[2].'"><b>' . $err . ':</b></font>'
+ . ' </td></tr>'
+ . ' <tr><td>'
+ . ' <table cellpadding="1" cellspacing="5" align="center" border="0">'
+ . ' <tr>' . html_tag( 'td', $string."\n", 'left') . '</tr>'
+ . ' </table>'
+ . ' </table></td></tr>'
+ . ' </table>'
+ . ' </td></tr>';
}
?>
if ( !sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) {
global $base_uri;
}
- global $theme_css, $custom_css;
+ global $theme_css, $custom_css, $pageheader_sent;
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' .
"\n\n" . html_tag( 'html' ,'' , '', '', '' ) . "\n<head>\n";
ECHO;
echo "\n</head>\n\n";
+
+ /* this is used to check elsewhere whether we should call this function */
+ $pageheader_sent = TRUE;
}
function makeInternalLink($path, $text, $target='') {