X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fpage_header.php;h=60c8ec7ab044960cf26798be4266211ec486b569;hb=a714cb95df2960fe30903a1a8e0c0757352a91e2;hp=2b22afcc91e68e794577f805b0d2888afd80cd5e;hpb=a07cd1a401ba4efc7fdcf418cb51449bee09fbdc;p=squirrelmail.git diff --git a/functions/page_header.php b/functions/page_header.php index 2b22afcc..60c8ec7a 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -14,20 +14,24 @@ // Always set up the language before calling these functions function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) { - global $theme_css; - - echo '' . - "\n\n\n\n"; - + global $theme_css, $custom_css; + + 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,10 +45,56 @@ function displayInternalLink($path, $text, $target='') { } function displayPageHeader($color, $mailbox) { - global $delimiter, $hide_sm_attributions; + + global $delimiter, $hide_sm_attributions, $base_uri, $PHP_SELF; + displayHtmlHeader (); - echo "\n\n"; + $module = substr( $PHP_SELF, ( strlen( $PHP_SELF ) - strlen( $base_uri ) ) * -1 ); + + /* + 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);