X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=functions%2Fpage_header.php;h=9999df71b6083b968aeb5cb966cda3ef65443fae;hb=1d80c108a1d741b7dcb562ea1cf6d2214322b192;hp=c3d9a66643b51ef15f26752b1e7f0119eb7b2859;hpb=15e6162eacc97158393bc75aed3afeb7b19c24a6;p=squirrelmail.git diff --git a/functions/page_header.php b/functions/page_header.php index c3d9a666..9999df71 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -3,103 +3,409 @@ /** * page_header.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Copyright (c) 1999-2003 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Prints the page header (duh) * * $Id$ + * @package squirrelmail */ -/*****************************************************************/ -/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!! ***/ -/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION. ***/ -/*** + Base level indent should begin at left margin, as ***/ -/*** the first line of the function definition below. ***/ -/*** + All identation should consist of four space blocks ***/ -/*** + Tab characters are evil. ***/ -/*** + all comments should use "slash-star ... star-slash" ***/ -/*** style -- no pound characters, no slash-slash style ***/ -/*** + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD ***/ -/*** ALWAYS USE { AND } CHARACTERS!!! ***/ -/*** + Please use ' instead of ", when possible. Note " ***/ -/*** should always be used in _( ) function calls. ***/ -/*** Thank you for your help making the SM code more readable. ***/ -/*****************************************************************/ - -// 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"; +/** 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'); +/** + * 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 + * @return void + */ +function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) { + global $squirrelmail_language; + + if ( !sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) { + global $base_uri; + } + global $theme_css, $custom_css, $pageheader_sent; + + echo '' . + "\n\n" . html_tag( 'html' ,'' , '', '', 'lang="'.$squirrelmail_language.'"' ) . "\n\n"; + + if ( !isset( $custom_css ) || $custom_css == 'none' ) { if ($theme_css != '') { - echo "\n"; + echo ""; + } + } else { + echo ''; + } + + if ($squirrelmail_language == 'ja_JP') { + echo "\n"; + echo '' . "\n"; + } + + if ($do_hook) { + do_hook('generic_header'); + } + + echo "\n\n" - . ' ' . _("Current Folder") . ": $shortBoxName \n" - . " | \n" - . "\n"; - displayInternalLink ('src/signout.php', _("Sign Out"), '_top'); - echo " | \n" - . "
\n"; - $urlMailbox = urlencode($mailbox); - displayInternalLink ("src/compose.php?mailbox=$urlMailbox", _("Compose"), "right"); - echo " \n"; - displayInternalLink ("src/addressbook.php", _("Addresses"), "right"); - echo " \n"; - displayInternalLink ("src/folders.php", _("Folders"), "right"); - echo " \n"; - displayInternalLink ("src/options.php", _("Options"), "right"); - echo " \n"; - displayInternalLink ("src/search.php?mailbox=$urlMailbox", _("Search"), "right"); - echo " \n"; - displayInternalLink ("src/help.php", _("Help"), "right"); - echo " \n"; - - do_hook("menuline"); - - echo " | \n"; - echo ($hide_sm_attributions ? ' ' : - "SquirrelMail\n"); - echo " | \n". - "