From 715225af1f3ef09897a7c1db61acdeb0ba842455 Mon Sep 17 00:00:00 2001 From: philippe_mingo Date: Fri, 11 Jan 2002 11:32:37 +0000 Subject: [PATCH] The auto focus module has been a little bit improved in order to be more flexible. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2114 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/page_header.php | 50 +++++++++++++++++++++++++++++++++++++-- src/compose.php | 6 ++--- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/functions/page_header.php b/functions/page_header.php index 2b22afcc..26e8f61c 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -41,10 +41,56 @@ function displayInternalLink($path, $text, $target='') { } function displayPageHeader($color, $mailbox) { - global $delimiter, $hide_sm_attributions; + + global $delimiter, $hide_sm_attributions, $base_uri, $PHP_SELF; + displayHtmlHeader (); - echo "\n\n"; + $module = substr( $PHP_SELF, ( strlen( $PHP_SELF ) - strlen( $base_uri ) ) * -1 ); + + /* + Locate the first displayable form element + */ + switch ( $module ) { + case 'src/search.php': + $pos = getPref($data_dir, $username, 'search_pos', 0 ) - 1; + $onload = "onLoad=\"document.forms[$pos].elements[2].focus();\""; + break; + default: + echo ' + + '; + $onload = "onLoad=\"checkForm();\""; + break; + + } + + echo "\n\n"; /** Here is the header and wrapping table **/ $shortBoxName = readShortMailboxName($mailbox, $delimiter); diff --git a/src/compose.php b/src/compose.php index c2433a26..37a15656 100644 --- a/src/compose.php +++ b/src/compose.php @@ -35,7 +35,7 @@ if (!isset($mailbox) || $mailbox == '' || ($mailbox == 'None')) { } if (isset($draft)) { - require_once ('../src/draft_actions.php'); + include_once ('../src/draft_actions.php'); if (!saveMessageAsDraft($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id)) { showInputForm(); exit(); @@ -454,8 +454,8 @@ function showInputForm () { showComposeButtonRow(); } - $idents = getPref($data_dir, $username, 'identities'); - if ($idents != '' && $idents > 1) { + $idents = getPref($data_dir, $username, 'identities', 0); + if ($idents > 1) { echo ' ' . "\n" . ' ' . "\n" . -- 2.25.1