X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fpage_header.php;h=9561f0f4a1e3603179126b85b4a318b316873ba2;hb=b0d8461bee7238b3eb1fae970edd4015cd4c9336;hp=227c857582349729bc1710cff076ad4c7b7e2283;hpb=5ca4b1eedc3a22f4180a8aec011c076ae3133776;p=squirrelmail.git diff --git a/functions/page_header.php b/functions/page_header.php index 227c8575..9561f0f4 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -3,49 +3,64 @@ /** * page_header.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Copyright (c) 1999-2004 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Prints the page header (duh) * - * $Id$ + * @version $Id$ + * @package squirrelmail */ +/** 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 */ -function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) { +/** + * Output a SquirrelMail page header, from to + * Always set up the language before calling these functions. + * + * @param string title the page title, default SquirrelMail. + * @param string xtra extra HTML to insert into the header + * @param bool do_hook whether to execute hooks, default true + * @param bool frames generate html frameset doctype (since 1.5.1) + * @return void + */ +function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = true, $frames = false ) { + global $squirrelmail_language; - if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) { - global $_SESSION; - } - if (isset($_SESSION['base_uri'])) { - $base_uri = $_SESSION['base_uri']; - } - else { + if ( !sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) { global $base_uri; } - global $theme_css, $custom_css; + global $theme_css, $custom_css, $pageheader_sent; - echo '' . - "\n\n\n\n"; + if ($frames) { + echo ''; + } else { + echo ''; + } + echo "\n\n" . html_tag( 'html' ,'' , '', '', 'lang="'.$squirrelmail_language.'"' ) . "\n\n"; if ( !isset( $custom_css ) || $custom_css == 'none' ) { if ($theme_css != '') { - echo ""; + echo ""; } } else { - echo ''; + echo ''; + } + + if ($squirrelmail_language == 'ja_JP') { + echo "\n"; + echo '' . "\n"; } - + if ($do_hook) { - do_hook("generic_header"); + do_hook('generic_header'); } - + echo "\n$title$xtra\n"; /* work around IE6's scrollbar bug */ @@ -53,9 +68,9 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE