X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fpage_header.php;h=1d2734be24b34bd57f2e12767a97773a38c78ed3;hp=7e63f0af9c2b9af27b9955da29aec17e331c488e;hb=ec291321c8699ff8f0735c96dc6c0b013da6cdc1;hpb=7884e6c4db03cf2c316fdcc256ae0e4f62186f60
diff --git a/functions/page_header.php b/functions/page_header.php
index 7e63f0af..1d2734be 100644
--- a/functions/page_header.php
+++ b/functions/page_header.php
@@ -13,7 +13,8 @@
require_once('../functions/strings.php');
require_once('../functions/imap_utf7_decode_local.php');
-
+require_once('../functions/html.php');
+require_once('../class/html.class');
/* Always set up the language before calling these functions */
function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) {
@@ -31,6 +32,10 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE
echo '';
}
+
+ if ($do_hook) {
+ do_hook ("generic_header");
+ }
echo "\n
$title$xtra\n\n";
}
@@ -45,12 +50,16 @@ 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, $session, $attachemessages;
+ $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, '?')) {
+ $module = substr($module, 0, $qmark);
+ }
if (!isset($frame_top)) {
$frame_top = '_top';
}
@@ -58,7 +67,75 @@ 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') {
+ if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {
+ $compose_width = '640';
+ }
+ if (!preg_match("/^[0-9]{3,4}$/", $compose_height)) {
+ $compose_height = '550';
+ }
+ $js = "\n".'\n";
+ displayHtmlHeader ('Squirrelmail', $js);
+ }
+ displayHtmlHeader();
+ $onload = $xtra;
+ break;
+ case 'src/compose.php':
+ $js = '\n";
+ $onload = "onLoad=\"checkForm();\"";
+ displayHtmlHeader ('Squirrelmail', $js);
+ break;
+
default:
$js = '