X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fpage_header.php;h=b3a3dbd00fcf20bdb9cad24c8128c24c7a837860;hb=5e8de8b65156fa98e9d9ffb284ebd24050a6f3bd;hp=7ea711d077d104ddff771755a0e8eeb39ea8e5f2;hpb=602b2bdf52fee8f2fb0e3fc672336cdc782ced6f;p=squirrelmail.git diff --git a/functions/page_header.php b/functions/page_header.php index 7ea711d0..b3a3dbd0 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -11,14 +11,24 @@ * $Id$ */ -require_once('../functions/strings.php'); -//require_once('../functions/imap_utf7_decode_local.php'); -require_once('../functions/html.php'); -require_once('../functions/imap_mailbox.php'); +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 ) { - global $theme_css, $custom_css, $base_uri; + if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) { + global $_SESSION; + } + if (isset($_SESSION['base_uri'])) { + $base_uri = $_SESSION['base_uri']; + } + else { + global $base_uri; + } + global $theme_css, $custom_css; echo '' . "\n\n\n\n"; @@ -41,8 +51,11 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE function displayInternalLink($path, $text, $target='') { - global $base_uri; + if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) { + global $_SESSION; + } + $base_uri = $_SESSION['base_uri']; if ($target != '') { $target = " target=\"$target\""; } @@ -51,10 +64,16 @@ function displayInternalLink($path, $text, $target='') { function displayPageHeader($color, $mailbox, $xtra='', $session=false) { - global $delimiter, $hide_sm_attributions, $base_uri, $PHP_SELF, $frame_top, + global $hide_sm_attributions, $PHP_SELF, $frame_top, $compose_new_win, $username, $datadir, $compose_width, $compose_height, - $attachemessages, $session; + $attachemessages, $provider_name, $provider_uri; + + if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) { + global $_SESSION; + } + $base_uri = $_SESSION['base_uri']; + $delimiter = $_SESSION['delimiter']; $module = substr( $PHP_SELF, ( strlen( $PHP_SELF ) - strlen( $base_uri ) ) * -1 ); if ($qmark = strpos($module, '?')) { $module = substr($module, 0, $qmark); @@ -63,7 +82,7 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) { $frame_top = '_top'; } - if ($session != false) { + if ($session) { $compose_uri = $base_uri.'src/compose.php?mailbox='. urlencode($mailbox).'&attachedmessages=true&session='."$session"; } else { $compose_uri = $base_uri.'src/compose.php?newmessage=1'; @@ -102,7 +121,7 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) { "\n"; } - displayHtmlHeader ('Squirrelmail', $js); + displayHtmlHeader ('SquirrelMail', $js); $onload = $xtra; break; case 'src/compose.php': @@ -131,7 +150,7 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) { $js .= "// -->\n". "\n"; $onload = "onLoad=\"checkForm();\""; - displayHtmlHeader ('Squirrelmail', $js); + displayHtmlHeader ('SquirrelMail', $js); break; default: @@ -180,7 +199,7 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) { $onload = "onLoad=\"checkForm();\""; - displayHtmlHeader ('Squirrelmail', $js); + displayHtmlHeader ('SquirrelMail', $js); break; } @@ -231,11 +250,13 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) { echo " \n" . html_tag( 'td', '', 'right' ) ."\n"; + if (!isset($provider_uri)) $provider_uri= 'http://www.squirrelmail.org/'; + if (!isset($provider_name)) $provider_name= 'SquirrelMail'; echo ($hide_sm_attributions ? ' ' : - 'SquirrelMail'); + ''.$provider_name.''); echo "\n". " \n". - "\n\n"; + "
\n\n"; } /* blatently copied/truncated/modified from the above function */