X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fpage_header.php;h=c4d8f3af2e0a0a3fc5d59ad304e3e48fde18fd39;hb=e35045b7dff675fe28acaa63c77cef33d4a49f18;hp=fe30f23c3b06d1e7ae50acbc8b78815ac1c90a0b;hpb=869ece5d542664e592ec632eb2612a92dca90c9a;p=squirrelmail.git diff --git a/functions/page_header.php b/functions/page_header.php index fe30f23c..c4d8f3af 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -13,6 +13,7 @@ require_once('../functions/strings.php'); require_once('../functions/imap_utf7_decode_local.php'); +require_once('../functions/html.php'); /* Always set up the language before calling these functions */ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) { @@ -44,10 +45,11 @@ function displayInternalLink($path, $text, $target='') { echo ''.$text.''; } -function displayPageHeader($color, $mailbox, $xtra='') { +function displayPageHeader($color, $mailbox, $xtra='', $session=false) { global $delimiter, $hide_sm_attributions, $base_uri, $PHP_SELF, $frame_top, - $compose_new_win, $username, $datadir, $compose_width, $compose_height; + $compose_new_win, $username, $datadir, $compose_width, $compose_height, + $attachemessages, $session; $module = substr( $PHP_SELF, ( strlen( $PHP_SELF ) - strlen( $base_uri ) ) * -1 ); if ($qmark = strpos($module, '?')) { @@ -60,6 +62,14 @@ function displayPageHeader($color, $mailbox, $xtra='') { /* Locate the first displayable form element */ + + if ($session != false) { + $compose_uri = 'src/compose.php?mailbox='. urlencode($mailbox).'&attachedmessages=true&session='."$session"; + } else { + $compose_uri = 'src/compose.php?newmessage=1'; + $session = 0; + } + switch ( $module ) { case 'src/read_body.php': if ($compose_new_win == '1') { @@ -71,19 +81,56 @@ function displayPageHeader($color, $mailbox, $xtra='') { } $js = "\n".'\n"; displayHtmlHeader ('Squirrelmail', $js); } displayHtmlHeader(); - $onload = ''; + $onload = $xtra; break; + case 'src/compose.php': + $js = '\n"; + $onload = "onLoad=\"checkForm();\""; + displayHtmlHeader ('Squirrelmail', $js); + break; + default: $js = '