X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fpage_header.php;h=59efe1ef96c6200f0d1516c36260b185cc3587c1;hb=dad8c15a03d38a6f5a3091cb3a9291b4a6ffc684;hp=1673fac147b0d37a9949eb915e0eaf4e94d6cc39;hpb=de19cd7342abc1fb96dce8403128152b7708ec58;p=squirrelmail.git
diff --git a/functions/page_header.php b/functions/page_header.php
index 1673fac1..59efe1ef 100644
--- a/functions/page_header.php
+++ b/functions/page_header.php
@@ -12,8 +12,11 @@
*/
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
+/* Always set up the language before calling these functions */
function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE ) {
global $theme_css, $custom_css, $base_uri;
@@ -23,14 +26,18 @@ function displayHtmlHeader( $title = 'SquirrelMail', $xtra = '', $do_hook = TRUE
if ( !isset( $custom_css ) || $custom_css == 'none' ) {
if ($theme_css != '') {
- echo "\n";
+ echo "";
}
} else {
echo '\n";
+ $base_uri . 'themes/css/'.$custom_css.'">';
+ }
+
+ if ($do_hook) {
+ do_hook ("generic_header");
}
- echo "
$title$xtra\n\n";
+ echo "\n$title$xtra\n\n";
}
function displayInternalLink($path, $text, $target='') {
@@ -43,11 +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;
+ global $delimiter, $hide_sm_attributions, $base_uri, $PHP_SELF, $frame_top,
+ $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';
}
@@ -55,12 +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/search.php':
- $pos = getPref($data_dir, $username, 'search_pos', 0 ) - 1;
- $onload = "onLoad=\"document.forms[$pos].elements[2].focus();\"";
- displayHtmlHeader ();
+ 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 = '