Source for file page_header.php
Documentation is available at page_header.php
 * Prints the page header (duh)  
 * @copyright © 1999-2006 The SquirrelMail Project Team  
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License  
 * @version $Id: page_header.php,v 1.148.2.27 2006/06/14 14:25:41 indiri69 Exp $  
/** Include required files from SM */  
require_once(SM_PATH . 
'functions/strings.php');  
require_once(SM_PATH . 
'functions/html.php');  
require_once(SM_PATH . 
'functions/imap_mailbox.php');  
require_once(SM_PATH . 
'functions/global.php');  
/* Always set up the language before calling these functions */  
    global $squirrelmail_language;  
    echo 
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">' .
 
         "\n\n" . 
html_tag( 'html' ,'' , '', '', '' ) . 
"\n<head>\n" .
  
         "<meta name=\"robots\" content=\"noindex,nofollow\">\n";  
    if ( !isset
( $custom_css ) || 
$custom_css == 
'none' ) {  
            echo 
"<link rel=\"stylesheet\" type=\"text/css\" href=\"$theme_css\" />"; 
        echo 
'<link rel="stylesheet" type="text/css" href="' .
 
             $base_uri . 
'themes/css/'.
$custom_css.
'" />';  
    if ($squirrelmail_language == 
'ja_JP') {  
        // Why is it added here? Header ('Content-Type:..) is used in i18n.php  
        echo 
"<!-- \xfd\xfe -->\n"; 
        echo 
'<meta http-equiv="Content-type" content="text/html; charset=euc-jp" />' . 
"\n"; 
    echo 
"\n<title>$title</title>$xtra\n"; 
    /* work around IE6's scrollbar bug */  
/* 
avoid stupid IE6 bug with frames and scrollbars */
 
    width: 
expression(
document.
documentElement.
clientWidth - 30);
  
    /* this is used to check elsewhere whether we should call this function */  
        $target = 
" target=\"$target\"";  
    return '<a href="'.
$base_uri.
$path.
'"'.
$target.
'>'.
$text.
'</a>';  
           $compose_new_win, $compose_width, $compose_height,  
    if ($qmark = 
strpos($module, '?')) {  
        $module = 
substr($module, 0, $qmark);  
    if (!isset
($frame_top)) {  
        $compose_uri = 
$base_uri.
'src/compose.php?mailbox='.
urlencode($mailbox).
'&attachedmessages=true&session='.
"$session";  
        $compose_uri = 
$base_uri.
'src/compose.php?newmessage=1';  
    // only output JavaScript if actually turned on  
    if($javascript_on || 
strpos($xtra, 'new_js_autodetect_results.value') ) {  
        case 'src/read_body.php':
  
            // compose in new window code  
            if ($compose_new_win == 
'1') {  
                if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {  
                if (!preg_match("/^[0-9]{3,4}$/", $compose_height)) {  
                $js .= 
"function comp_in_new(comp_uri) {\n".
  
                     '           comp_uri = "'.
$compose_uri.
"\";\n".
  
                     '    var newwin = window.open(comp_uri' .
  
                     '"width='.
$compose_width. 
',height='.
$compose_height.
  
                     ',scrollbars=yes,resizable=yes,status=yes");'.
"\n".
  
            // javascript for sending read receipts  
            if($default_use_mdn && 
$mdn_user_support) {  
                $js .= 
"function sendMDN() {\n".
  
                         "    mdnuri=window.location+'&sendreceipt=1';\n" .
  
                         "    if (window.top != window.self) {\n" .
  
                         "      var newwin = window.open(mdnuri,'right');\n" .
  
                         "      var newwin = window.location = mdnuri;\n" .
  
            // if any of the above passes, add the JS tags too.  
                $js = 
"\n".
'<script language="JavaScript" type="text/javascript">' .
  
                      "\n<!--\n" . 
$js . 
"// -->\n</script>\n";  
            $js = 
'<script language="JavaScript" type="text/javascript">' .
  
             "var alreadyFocused = false;\n" .
  
             "function checkForm() {\n" .
  
             "\n    if (alreadyFocused) return;\n";  
            global $action, $reply_focus;  
            if (strpos($action, 'reply') !== 
FALSE && 
$reply_focus)  
                if ($reply_focus == 
'select') $js .= 
"document.forms['compose'].body.select();}\n";  
                else if ($reply_focus == 
'focus') $js .= 
"document.forms['compose'].body.focus();}\n";  
                else if ($reply_focus == 
'none') $js .= 
"}\n";  
            // no reply focus also applies to composing new messages  
            else if ($reply_focus == 
'none')  
                $js .= 
"    var f = document.forms.length;\n".
  
                "    while( pos == -1 && i < f ) {\n".
  
                "        var e = document.forms[i].elements.length;\n".
  
                "        while( pos == -1 && j < e ) {\n".
  
                "            if ( document.forms[i].elements[j].type == 'text' ) {\n".
  
                "        document.forms[i-1].elements[pos].focus();\n".
  
            $onload = 
'onload="checkForm();"';  
            $js = 
'<script language="JavaScript" type="text/javascript">' .
  
             "function checkForm() {\n".
  
             "   var f = document.forms.length;\n".
  
             "   while( pos == -1 && i < f ) {\n".
  
             "       var e = document.forms[i].elements.length;\n".
  
             "       while( pos == -1 && j < e ) {\n".
  
             "           if ( document.forms[i].elements[j].type == 'text' " .
  
             "           || document.forms[i].elements[j].type == 'password' ) {\n".
  
             "       document.forms[i-1].elements[pos].focus();\n".
  
            if ($compose_new_win == 
'1') {  
                if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {  
                if (!preg_match("/^[0-9]{3,4}$/", $compose_height)) {  
                $js .= 
"function comp_in_new(comp_uri) {\n".
  
                     '           comp_uri = "'.
$compose_uri.
"\";\n".
  
                     '    var newwin = window.open(comp_uri' .
  
                     '"width='.
$compose_width. 
',height='.
$compose_height.
  
                     ',scrollbars=yes,resizable=yes,status=yes");'.
"\n".
  
        $js .= 
"// -->\n". 
"</script>\n";  
        $onload = 
'onload="checkForm();"';  
    echo 
"<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\" $onload>\n\n"; 
    /** Here is the header and wrapping table **/  
    if ( $shortBoxName == 
'INBOX' ) {  
        $shortBoxName = 
_("INBOX");  
    echo 
"<a name=\"pagetop\"></a>\n" 
        . 
html_tag( 'table', '', '', $color[4], 'border="0" width="100%" cellspacing="0" cellpadding="2"' ) .
"\n" 
        . 
html_tag( 'tr', '', '', $color[9] ) .
"\n" 
    if ( $shortBoxName <> 
'' && 
strtolower( $shortBoxName ) <> 
'none' ) {  
        echo 
'         ' . 
_("Current Folder") . 
": <b>$shortBoxName </b>\n"; 
        . 
html_tag( 'td', '', 'right' ) .
"<b>\n"; 
        . 
html_tag( 'tr', '', '', $color[4] ) .
"\n" 
        . 
($hide_sm_attributions ? 
html_tag( 'td', '', 'left', '', 'colspan="2"' ) 
    $startMessage = (int)
$startMessage;  
    echo 
makeComposeLink('src/compose.php?mailbox='.
$urlMailbox.
'&startMessage='.
$startMessage); 
    if (!$hide_sm_attributions)  
        echo 
html_tag( 'td', '', 'right' ) .
"\n"; 
        if (!isset
($provider_uri)) $provider_uri= 
'http://www.squirrelmail.org/';  
        if (!isset
($provider_name)) $provider_name= 
'SquirrelMail';  
        echo 
'<a href="'.
$provider_uri.
'" target="_blank">'.
$provider_name.
'</a>'; 
/* blatently copied/truncated/modified from the above function */  
    if (!isset
($frame_top)) {  
        Locate the first displayable form element  
        $pos = 
getPref($data_dir, $username, 'search_pos', 0 ) - 
1;  
        $onload = 
"onload=\"document.forms[$pos].elements[2].focus();\"";  
        $js = 
'<script language="JavaScript" type="text/javascript">' .
  
             "var alreadyFocused = false;\n" .
  
             "function checkForm() {\n" .
  
             "\n    if (alreadyFocused) return;\n";  
            global $action, $reply_focus;  
            if (strpos($action, 'reply') !== 
FALSE && 
$reply_focus)  
                if ($reply_focus == 
'select') $js .= 
"document.forms['compose'].body.select();}\n";  
                else if ($reply_focus == 
'focus') $js .= 
"document.forms['compose'].body.focus();}\n";  
                else if ($reply_focus == 
'none') $js .= 
"}\n";  
            // no reply focus also applies to composing new messages  
            else if ($reply_focus == 
'none')  
                $js .= 
"var f = document.forms.length;\n".
  
                "while( pos == -1 && i < f ) {\n".
  
                    "var e = document.forms[i].elements.length;\n".
  
                    "while( pos == -1 && j < e ) {\n".
  
                        "if ( document.forms[i].elements[j].type == 'text' ) {\n".
  
                    "document.forms[i-1].elements[pos].focus();\n".
  
        $onload = 
'onload="checkForm();"';  
    echo 
"<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\" $onload>\n\n"; 
 
 
	
		Documentation generated on Sat, 07 Oct 2006 16:33:00 +0300 by phpDocumentor 1.3.0RC6