X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fpage_header.php;h=808ce0bb0a026d3140c77d731de4b457efe6d4a4;hp=2b22afcc91e68e794577f805b0d2888afd80cd5e;hb=6767afba503f76ce843cc90284135f3395e18db7;hpb=a07cd1a401ba4efc7fdcf418cb51449bee09fbdc diff --git a/functions/page_header.php b/functions/page_header.php index 2b22afcc..808ce0bb 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -11,23 +11,30 @@ * $Id$ */ +require_once('../functions/strings.php'); + // Always set up the language before calling these functions function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) { - global $theme_css; + global $theme_css, $custom_css, $base_uri; - echo '' . - "\n\n\n\n"; + echo '' . + "\n\n\n\n"; + if ( !isset( $custom_css ) || $custom_css == 'none' ) { if ($theme_css != '') { echo "\n"; } - - if( $do_hook ) { - do_hook ("generic_header"); - } - - echo "$title$xtra\n\n"; + } else { + echo '\n"; + } + + if( $do_hook ) { + do_hook ("generic_header"); + } + + echo "$title$xtra\n\n"; } function displayInternalLink($path, $text, $target='') { @@ -41,21 +48,76 @@ function displayInternalLink($path, $text, $target='') { } function displayPageHeader($color, $mailbox) { - global $delimiter, $hide_sm_attributions; + + global $delimiter, $hide_sm_attributions, $base_uri, $PHP_SELF, $frame_top; + displayHtmlHeader (); - echo "\n\n"; + $module = substr( $PHP_SELF, ( strlen( $PHP_SELF ) - strlen( $base_uri ) ) * -1 ); + if (!isset($frame_top)) { + $frame_top = '_top'; + } + + /* + Locate the first displayable form element + */ + switch ( $module ) { + case 'src/search.php': + $pos = getPref($data_dir, $username, 'search_pos', 0 ) - 1; + $onload = "onLoad=\"document.forms[$pos].elements[2].focus();\""; + break; + default: + echo ' + + '; + $onload = "onLoad=\"checkForm();\""; + break; + + } + + echo "\n\n"; /** Here is the header and wrapping table **/ $shortBoxName = readShortMailboxName($mailbox, $delimiter); + if ( $shortBoxName == 'INBOX' ) { + $shortBoxName = _("INBOX"); + } echo "\n" . "\n" . " \n" - . " \n" + . " \n" . " \n" . " \n" . " \n" @@ -84,4 +146,4 @@ function displayPageHeader($color, $mailbox) { "
\n" - . ' ' . _("Current Folder") . ": $shortBoxName \n" - . " \n"; + if ( $shortBoxName <> '' && strtolower( $shortBoxName ) <> 'none' ) { + echo ' ' . _("Current Folder") . ": $shortBoxName \n"; + } else { + echo ' '; + } + echo " \n"; - displayInternalLink ('src/signout.php', _("Sign Out"), '_top'); + displayInternalLink ('src/signout.php', _("Sign Out"), $frame_top); echo "
\n\n"; } -?> \ No newline at end of file +?>