X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fpage_header.php;h=3a407689fa5dbc49b0967acae6ff7fe66153e24f;hb=07337c9ba899ec77efabf5316c5dcb6279a8fcc6;hp=53c5d003e4603a30a125b22c3c586989405495ef;hpb=99ea51d389e159ea9cd6313520b5dd4da7ecef4d;p=squirrelmail.git diff --git a/functions/page_header.php b/functions/page_header.php index 53c5d003..3a407689 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -3,21 +3,32 @@ /** * page_header.php * - * Copyright (c) 1999-2003 The SquirrelMail Project Team + * Copyright (c) 1999-2005 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 ( !sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) { @@ -25,8 +36,12 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE } global $theme_css, $custom_css, $pageheader_sent; - echo '' . - "\n\n" . html_tag( 'html' ,'' , '', '', '' ) . "\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 != '') { @@ -36,16 +51,23 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE echo ''; } - + if ($squirrelmail_language == 'ja_JP') { + /* + * force correct detection of charset, when browser does not follow + * http content-type and tries to detect charset from page content. + * Shooting of browser's creator can't be implemented in php. + * We might get rid of it, if we follow http://www.w3.org/TR/japanese-xml/ + * recommendations and switch to unicode. + */ echo "\n"; - echo '' . "\n"; + echo '' . "\n"; } - + if ($do_hook) { do_hook('generic_header'); } - + echo "\n$title$xtra\n"; /* work around IE6's scrollbar bug */ @@ -53,9 +75,9 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE