From 6206f6c455a6010f2bd3e7999043a4074e7eb2bf Mon Sep 17 00:00:00 2001 From: thomppj Date: Wed, 21 Aug 2002 22:56:09 +0000 Subject: [PATCH] Lots of small user interface fixes. Added user option to enable/disable "forward as attachment". git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3396 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mailbox_display.php | 4 +- functions/options.php | 2 +- functions/page_header.php | 2 +- plugins/administrator/options.php | 4 +- plugins/filters/options.php | 3 +- plugins/newmail/newmail_opt.php | 3 +- plugins/translate/options.php | 3 +- src/compose.php | 12 ++-- src/folders.php | 2 +- src/help.php | 5 +- src/load_prefs.php | 6 +- src/options.php | 6 +- src/options_display.php | 27 +++++--- src/options_highlight.php | 11 ++-- src/options_order.php | 6 +- src/printer_friendly_bottom.php | 2 +- src/printer_friendly_top.php | 6 +- src/read_body.php | 105 +++++++++++++++--------------- src/right_main.php | 1 - src/search.php | 3 +- 20 files changed, 109 insertions(+), 104 deletions(-) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 03504144..29368b89 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -448,12 +448,14 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs, $msg_cnt_str, $paginator_str, $start_msg); + echo '
'; printHeader($mailbox, $srt, $color, !$thread_sort_messages); displayMessageArray($imapConnection, $num_msgs, $start_msg, $msort, $mailbox, $sort, $color, $show_num,0,0); mail_message_listing_end($num_msgs, $paginator_str, $msg_cnt_str, $color); + echo '
'; /** * TODO: Switch to using $_SESSION[] whenever we ditch the 4.0.x series. @@ -801,7 +803,7 @@ function mail_message_listing_end($num_msgs, $paginator_str, $msg_cnt_str, $colo function printHeader($mailbox, $sort, $color, $showsort=true) { global $index_order; - echo html_tag( 'table' ,'' , '', $color[9], 'border="0" width="100%" cellpadding="1" cellspacing="1"' ); + echo html_tag( 'table' ,'' , '', $color[4], 'border="0" width="100%" cellpadding="1" cellspacing="0"' ); echo html_tag( 'tr' ,'' , 'center', $color[5] ); for ($i=1; $i <= count($index_order); $i++) { switch ($index_order[$i]) { diff --git a/functions/options.php b/functions/options.php index d2caed53..bebd3a19 100644 --- a/functions/options.php +++ b/functions/options.php @@ -289,7 +289,7 @@ class SquirrelOption { } function changed() { - return ($this->value !== $this->new_value); + return ($this->value != $this->new_value); } } diff --git a/functions/page_header.php b/functions/page_header.php index 7ea711d0..3626507a 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -235,7 +235,7 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) { 'SquirrelMail'); echo "\n". " \n". - "\n\n"; + "
\n\n"; } /* blatently copied/truncated/modified from the above function */ diff --git a/plugins/administrator/options.php b/plugins/administrator/options.php index c87145d6..3963b972 100644 --- a/plugins/administrator/options.php +++ b/plugins/administrator/options.php @@ -181,7 +181,7 @@ if ( isset( $switch ) ) { } echo "
" . - "
'; } echo '
". + "
'; + echo '
". "" , ""; @@ -511,4 +511,4 @@ if( $fp = @fopen( $cfgfile, 'w' ) ) { ''; } -?> \ No newline at end of file +?> diff --git a/plugins/filters/options.php b/plugins/filters/options.php index 23df1be5..6e853166 100644 --- a/plugins/filters/options.php +++ b/plugins/filters/options.php @@ -64,8 +64,7 @@ $filters = load_filters(); $filters_user_scan = getPref($data_dir, $username, 'filters_user_scan'); - echo '
' . - html_tag( 'table', + echo html_tag( 'table', html_tag( 'tr', html_tag( 'td', '
' . _("Options") . ' - ' . _("Message Filtering") . '
' , diff --git a/plugins/newmail/newmail_opt.php b/plugins/newmail/newmail_opt.php index bd39948d..0f3c701b 100644 --- a/plugins/newmail/newmail_opt.php +++ b/plugins/newmail/newmail_opt.php @@ -32,8 +32,7 @@ // Set $allowsound to false if you don't want sound files available $allowsound = "true"; - echo '
' . - html_tag( 'table', '', 'center', '', 'width="95%" border="0" cellpadding="2" cellspacing="0"' ) . "\n" . + echo html_tag( 'table', '', 'center', '', 'width="95%" border="0" cellpadding="1" cellspacing="0"' ) . "\n" . html_tag( 'tr', "\n" . html_tag( 'td', '' . _("Options") . ' - ' . _("New Mail Notification") . '', 'center', $color[0] ) ) . "\n" . diff --git a/plugins/translate/options.php b/plugins/translate/options.php index 497eee34..c839f99a 100644 --- a/plugins/translate/options.php +++ b/plugins/translate/options.php @@ -89,8 +89,7 @@ } ?> -
-
" . _("Configuration Administrator") . "
'; $attachmentsdisplay = formatAttachments($message,$ent_ar,$mailbox, $passed_id); if ($attachmentsdisplay) { - echo ' '; - echo '
+
diff --git a/src/compose.php b/src/compose.php index bf628898..d064ddc2 100644 --- a/src/compose.php +++ b/src/compose.php @@ -758,7 +758,7 @@ function showInputForm ($session, $values=false) { if ($mail_sent == 'yes') { echo '
'. _("Your Message has been sent").'
'; } - echo '' . "\n"; + echo '
' . "\n"; if ($compose_new_win == '1') { echo '
'."\n"; echo ' '."\n"; @@ -864,8 +864,10 @@ function showInputForm ($session, $values=false) { if ($location_of_buttons == 'bottom') { showComposeButtonRow(); } else { - echo ' ' . "\n"; + echo ' ' . "\n"; } /* This code is for attachments */ @@ -948,7 +950,7 @@ function showComposeButtonRow() { if ($mdn_user_support) { echo "\n\t". _("Receipt") .': '. ''. _("On read"). + ($request_mdn=='1'?' checked':'') .'>'. _("On Read"). ' '. _("On Delivery"); } @@ -968,12 +970,12 @@ function showComposeButtonRow() { echo " "; } - echo "\n \n"; if ($save_as_draft) { echo '\n"; } + echo "\n \n"; do_hook('compose_button_row'); echo " \n\n"; diff --git a/src/folders.php b/src/folders.php index 3f4936df..69ee1a29 100644 --- a/src/folders.php +++ b/src/folders.php @@ -23,7 +23,7 @@ require_once('../functions/html.php'); displayPageHeader($color, 'None'); echo '
' . - html_tag( 'table', '', 'center', $color[0], 'width="95%" cellpadding="2" cellspacing="0" border="0"' ) . + html_tag( 'table', '', 'center', $color[0], 'width="95%" cellpadding="1" cellspacing="0" border="0"' ) . html_tag( 'tr' ) . html_tag( 'td', '', 'center' ) . '' . _("Folders") . '' . html_tag( 'table', '', 'center', '', 'width="100%" cellpadding="5" cellspacing="0" border="0"' ) . diff --git a/src/help.php b/src/help.php index f83bc088..3c3d8387 100644 --- a/src/help.php +++ b/src/help.php @@ -84,12 +84,11 @@ function get_info($doc, $pos) { -echo '
' . - html_tag( 'table', +echo html_tag( 'table', html_tag( 'tr', html_tag( 'td','
' . _("Help") .'
', 'center', $color[0] ) ) , - 'center', '', 'width="95%" cellpadding="2" cellspacing="2" border="0"' ); + 'center', '', 'width="95%" cellpadding="1" cellspacing="2" border="0"' ); do_hook("help_top"); diff --git a/src/load_prefs.php b/src/load_prefs.php index 457aef0e..0e8f7a9d 100644 --- a/src/load_prefs.php +++ b/src/load_prefs.php @@ -185,9 +185,11 @@ $location_of_buttons = $collapse_folders = getPref($data_dir, $username, 'collapse_folders', SMPREF_ON); -/* show_html_default is a int value. */ $show_html_default = - intval(getPref($data_dir, $username, 'show_html_default', SMPREF_OFF)); + getPref($data_dir, $username, 'show_html_default', SMPREF_OFF); + +$enable_forward_as_attachment = + getPref($data_dir, $username, 'enable_forward_as_attachment', SMPREF_ON); $show_xmailer_default = getPref($data_dir, $username, 'show_xmailer_default', SMPREF_OFF ); diff --git a/src/options.php b/src/options.php index 209afbd3..d913187f 100644 --- a/src/options.php +++ b/src/options.php @@ -47,7 +47,8 @@ function process_optionmode_submit($optpage, $optpage_data) { /* Remove Debug Mode Until Needed echo "name = '$option->name', " . "value = '$option->value', " - . "new_value = '$option->new_value'
\n"; + . "new_value = '$option->new_value'\n"; + echo "
"; */ if ($option->changed()) { $option->save(); @@ -202,8 +203,7 @@ if (isset($optpage_name) && ($optpage_name != '')) { $optpage_title .= " - $optpage_name"; } -echo '
' . - html_tag( 'table', '', 'center', $color[0], 'width="95%" cellpadding="2" cellspacing="0" border="0"' ) . "\n" . +echo html_tag( 'table', '', 'center', $color[0], 'width="95%" cellpadding="1" cellspacing="0" border="0"' ) . "\n" . html_tag( 'tr' ) . "\n" . html_tag( 'td', '', 'center' ) . "$optpage_title
\n". diff --git a/src/options_display.php b/src/options_display.php index a4714406..069e53c5 100644 --- a/src/options_display.php +++ b/src/options_display.php @@ -195,15 +195,22 @@ function load_optpage_data_display() { ); $optvals[SMOPT_GRP_MESSAGE][] = array( - 'name' => 'include_self_reply_all', - 'caption' => _("Include Me in CC when I Reply All"), + 'name' => 'enable_forward_as_attachment', + 'caption' => _("Enable Forward as Attachment"), 'type' => SMOPT_TYPE_BOOLEAN, 'refresh' => SMOPT_REFRESH_NONE ); $optvals[SMOPT_GRP_MESSAGE][] = array( 'name' => 'forward_cc', - 'caption' => _("Include CCs when forwarding messages"), + 'caption' => _("Include CCs when Forwarding Messages"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); + + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'include_self_reply_all', + 'caption' => _("Include Me in CC when I Reply All"), 'type' => SMOPT_TYPE_BOOLEAN, 'refresh' => SMOPT_REFRESH_NONE ); @@ -239,7 +246,7 @@ function load_optpage_data_display() { if ($default_use_mdn) { $optvals[SMOPT_GRP_MESSAGE][] = array( 'name' => 'mdn_user_support', - 'caption' => _("Enable request/confirm reading"), + 'caption' => _("Enable Mail Delivery Notification"), 'type' => SMOPT_TYPE_BOOLEAN, 'refresh' => SMOPT_REFRESH_NONE ); @@ -247,14 +254,14 @@ function load_optpage_data_display() { $optvals[SMOPT_GRP_MESSAGE][] = array( 'name' => 'compose_new_win', - 'caption' => _("Always compose in a new window"), + 'caption' => _("Compose Messages in New Window"), 'type' => SMOPT_TYPE_BOOLEAN, 'refresh' => SMOPT_REFRESH_ALL ); $optvals[SMOPT_GRP_MESSAGE][] = array( 'name' => 'compose_width', - 'caption' => _("Width of compose window"), + 'caption' => _("Width of Compose Window"), 'type' => SMOPT_TYPE_INTEGER, 'refresh' => SMOPT_REFRESH_ALL, 'size' => SMOPT_SIZE_TINY @@ -262,7 +269,7 @@ function load_optpage_data_display() { $optvals[SMOPT_GRP_MESSAGE][] = array( 'name' => 'compose_height', - 'caption' => _("Height of compose window"), + 'caption' => _("Height of Compose Window"), 'type' => SMOPT_TYPE_INTEGER, 'refresh' => SMOPT_REFRESH_ALL, 'size' => SMOPT_SIZE_TINY @@ -270,21 +277,21 @@ function load_optpage_data_display() { $optvals[SMOPT_GRP_MESSAGE][] = array( 'name' => 'sig_first', - 'caption' => _("Append signature before reply/forward text"), + 'caption' => _("Append Signature before Reply/Forward Text"), 'type' => SMOPT_TYPE_BOOLEAN, 'refresh' => SMOPT_REFRESH_NONE ); $optvals[SMOPT_GRP_MESSAGE][] = array( 'name' => 'internal_date_sort', - 'caption' => _("Use receive date for sort"), + 'caption' => _("Enable Sort by of Receive Date"), 'type' => SMOPT_TYPE_BOOLEAN, 'refresh' => SMOPT_REFRESH_ALL ); if ($allow_thread_sort == TRUE) { $optvals[SMOPT_GRP_MESSAGE][] = array( 'name' => 'sort_by_ref', - 'caption' => _("Use References header for thread sort"), + 'caption' => _("Enable Thread Sort by References Header"), 'type' => SMOPT_TYPE_BOOLEAN, 'refresh' => SMOPT_REFRESH_ALL ); diff --git a/src/options_highlight.php b/src/options_highlight.php index 8d21a745..0739a1be 100644 --- a/src/options_highlight.php +++ b/src/options_highlight.php @@ -58,14 +58,13 @@ if ($action == 'delete' && isset($theid)) { } displayPageHeader($color, 'None'); -echo '
' . +echo html_tag( 'table', "\n" . html_tag( 'tr', "\n" . - html_tag( 'td', '
' . _("Options") . ' - ' . _("Message Highlighting") . '
', - 'left', $color[0] ) - ) , -'center', '', 'width="95% border="0" cellpadding="2" cellspacing="0"' ) . "
\n" . -html_tag( 'table', '', '', '', 'width="100% border="0" cellpadding="0" cellspacing="0"' ) . + html_tag( 'td', '
' . _("Options") . ' - ' . _("Message Highlighting") . '
', 'left') + ), + 'center', $color[9], 'width="95% border="0" cellpadding="1" cellspacing="0"' ) . "
\n" . +html_tag( 'table', '', '', '', 'width="100% border="0" cellpadding="1" cellspacing="0"' ) . html_tag( 'tr' ) . "\n" . html_tag( 'td', '', 'left' ); diff --git a/src/options_order.php b/src/options_order.php index 629e83a8..2f64907e 100644 --- a/src/options_order.php +++ b/src/options_order.php @@ -25,12 +25,12 @@ if ($action == 'delete' && isset($theid)) { } displayPageHeader($color, 'None'); - echo '
' . - html_tag( 'table', '', 'center', '', 'width="95%" border="0" cellpadding="2" cellspacing="0"' ) . + echo + html_tag( 'table', '', 'center', '', 'width="95%" border="0" cellpadding="1" cellspacing="0"' ) . html_tag( 'tr' ) . html_tag( 'td', '', 'center', $color[0] ) . '' . _("Options") . ' - ' . _("Index Order") . '' . - html_tag( 'table', '', '', '', 'width="100%" border="0" cellpadding="1" cellspacing="1"' ) . + html_tag( 'table', '', '', '', 'width="100%" border="0" cellpadding="8" cellspacing="0"' ) . html_tag( 'tr' ) . html_tag( 'td', '', 'center', $color[4] ); diff --git a/src/printer_friendly_bottom.php b/src/printer_friendly_bottom.php index c7c5ed86..eb839ecd 100644 --- a/src/printer_friendly_bottom.php +++ b/src/printer_friendly_bottom.php @@ -88,7 +88,7 @@ displayHtmlHeader( _("Printer Friendly"), '', FALSE ); echo "\n" . /* headers (we use table because translations are not all the same width) */ - html_tag( 'table', '', '', '', 'width="100%" cellspacing="0" cellpadding="0" border="0"' ) . + html_tag( 'table', '', 'center', '', 'cellspacing="0" cellpadding="0" border="0"' ) . html_tag( 'tr', html_tag( 'td', _("From").' ', 'left' ,'','valign="top"') . html_tag( 'td', htmlentities($from), 'left' ) diff --git a/src/printer_friendly_top.php b/src/printer_friendly_top.php index 37d1b440..7375ac86 100644 --- a/src/printer_friendly_top.php +++ b/src/printer_friendly_top.php @@ -30,16 +30,16 @@ displayHtmlHeader( _("Printer Friendly"), "\n", FALSE ); -echo "\n" . +echo "\n" . //'
'; - echo '  
'; + echo ' '; + echo '     

'; + echo '
'. html_tag( 'div', ''. ''. ' '. - ''. + ''. ''. '', - 'center' ); + 'right' ); //'
'. ''. "\n"; diff --git a/src/read_body.php b/src/read_body.php index bacaf59d..5e1ae71c 100644 --- a/src/read_body.php +++ b/src/read_body.php @@ -48,14 +48,12 @@ function findNextMessage($passed_id) { break; } } - } - elseif ($sort == 6 && !$allow_server_sort && + } else if ($sort == 6 && !$allow_server_sort && !$thread_sort_messages ) { if ($passed_id != 1) { $result = $passed_id - 1; } - } - elseif (!$allow_server_sort && !$thread_sort_messages ) { + } else if (!$allow_server_sort && !$thread_sort_messages ) { if (!is_array($msort)) { return -1; } @@ -95,14 +93,12 @@ function findPreviousMessage($numMessages, $passed_id) { break; } } - } - elseif ($sort == 6 && !$allow_server_sort && + } else if ($sort == 6 && !$allow_server_sort && !$thread_sort_messages) { if ($passed_id != $numMessages) { $result = $passed_id + 1; } - } - elseif (!$thread_sort_messages && !$allow_server_sort) { + } else if (!$thread_sort_messages && !$allow_server_sort) { if (!is_array($msort)) { return -1; } @@ -111,7 +107,7 @@ function findPreviousMessage($numMessages, $passed_id) { prev($msort); $key = key($msort); if (isset($key)) { - echo $msort[$key]; + //echo $msort[$key]; /* Why again were we echoing here? */ $result = $msgs[$key]['ID']; break; } @@ -384,7 +380,8 @@ function formatEnvheader($mailbox, $passed_id, $passed_ent_id, $message, function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_response) { global $base_uri, $sent_folder, $draft_folder, $where, $what, $color, $sort, - $startMessage, $compose_new_win, $PHP_SELF, $save_as_draft; + $startMessage, $compose_new_win, $PHP_SELF, $save_as_draft, + $enable_forward_as_attachment; $topbar_delimiter = ' | '; $urlMailbox = urlencode($mailbox); @@ -403,7 +400,7 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp } $s .= ''.$msgs_str.''; $s .= $topbar_delimiter; - + $delete_url = $base_uri . 'src/delete_message.php?mailbox='.$urlMailbox. '&message='.$passed_id.'&'; if (!(isset($passed_ent_id) && $passed_ent_id)) { @@ -482,15 +479,16 @@ function formatMenubar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_resp } $s .= $topbar_delimiter; - $comp_action_uri = $comp_uri . '&action=forward_as_attachment'; - if ($compose_new_win == '1') { - $s .= ''._("Forward as Attachment").''; - } else { - $s .= ''._("Forward as Attachment").''; + if ($enable_forward_as_attachment) { + $comp_action_uri = $comp_uri . '&action=forward_as_attachment'; + if ($compose_new_win == '1') { + $s .= ''._("Forward as Attachment").''; + } else { + $s .= ''._("Forward as Attachment").''; + } + $s .= $topbar_delimiter; } - $s .= $topbar_delimiter; - $comp_action_uri = decodeHeader($comp_uri . '&action=reply'); @@ -536,10 +534,9 @@ function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) { } - -/* - * Main of read_boby.php -------------------------------------------------- - */ +/***************************/ +/* Main of read_boby.php */ +/***************************/ /* Urled vars @@ -553,9 +550,7 @@ if (isset($mailbox)) { $mailbox = urldecode( $mailbox ); } -$imapConnection = sqimap_login($username, $key, $imapServerAddress, - $imapPort, 0); - +$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); $mbx_response = sqimap_mailbox_select($imapConnection, $mailbox, false, false, true); if (!isset($messages)) { @@ -600,11 +595,9 @@ $header = $message->header; do_hook('html_top'); -/* ============================================================================= - * block for handling incoming url vars - * - * ============================================================================= - */ +/****************************************/ +/* Block for handling incoming url vars */ +/****************************************/ if (isset($sendreceipt)) { if ( !$message->is_mdnsent ) { @@ -627,11 +620,10 @@ if (isset($sendreceipt)) { ClearAttachments(); } } -/* ============================================================================= - * end block for handling incoming url vars - * - * ============================================================================= - */ +/***********************************************/ +/* End of block for handling incoming url vars */ +/***********************************************/ + $msgs[$passed_id]['FLAG_SEEN'] = true; $messagebody = ''; @@ -652,30 +644,37 @@ for ($i = 0; $i < $cnt; $i++) { displayPageHeader($color, $mailbox); formatMenuBar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_response); formatEnvheader($mailbox, $passed_id, $passed_ent_id, $message, $color, $FirstTimeSee); -echo ''; -echo ' '; +echo '
'; -echo ' '; +echo '
'; +echo ' '; +echo '
'; +echo ' '; echo ' '; -echo '
'; -echo ' '; -echo ' '; -echo '
'.$messagebody. '
'; -echo '
'; +echo ' '; +echo '
'; +echo ' '; +echo ' '; +echo '

' . $messagebody . '
'; +echo '
'; +echo '
'; - echo ' '; + echo ' '; echo '
'; + echo ' '; echo ' '; + echo ' '; + echo '
'; echo ' '; - echo '
'; - echo _("Attachments").':
'; - echo ' '; - echo $attachmentsdisplay; - echo '
'; + echo ' ' . _("Attachments") . ':'; + echo '
'; + echo '
'; + echo $attachmentsdisplay; + echo '
'; + echo '
'; - echo '
'; + echo '
'; diff --git a/src/right_main.php b/src/right_main.php index e38d5450..fb68c392 100644 --- a/src/right_main.php +++ b/src/right_main.php @@ -112,7 +112,6 @@ if (isset($composenew) && $composenew) { } else { displayPageHeader($color, $mailbox); } -echo "
\n"; do_hook('right_main_after_header'); if (isset($note)) { echo html_tag( 'div', '' . $note .'', 'center' ) . "
\n"; diff --git a/src/search.php b/src/search.php index 3acc5b12..29b31592 100644 --- a/src/search.php +++ b/src/search.php @@ -240,8 +240,7 @@ elseif ($submit == 'delete') { do_hook('search_before_form'); -echo "
\n". - html_tag( 'table', +echo html_tag( 'table', html_tag( 'tr', "\n" . html_tag( 'td', '' . _("Search") . '', 'center', $color[0] ) ) , -- 2.25.1