From 8e265988cdc07180960c42a97dcd3486abd7cdae Mon Sep 17 00:00:00 2001 From: lkehresman Date: Sat, 7 Oct 2000 16:23:18 +0000 Subject: [PATCH] made message index order customizable git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@778 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + functions/mailbox_display.php | 109 ++++++++++++++++++++++------------ src/load_prefs.php | 14 +++++ src/options.php | 12 ++++ 4 files changed, 98 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7daad06..e4722c4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ Version 0.6pre1 -- DEVELOPMENT ------------------------------ +- Made message index order customizable (from, subject, date) can be (date, from, subject) - Fixed some security problems with uploading attachments - Added Catalan translation from Josep Sanz diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index ff9bc5d3..77b3c526 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -14,6 +14,7 @@ global $color, $msgs, $msort; global $sent_folder; global $message_highlight_list; + global $index_order; $msg = $msgs[$key]; @@ -49,15 +50,31 @@ if ($where && $what) { $search_stuff = "&where=".urlencode($where)."&what=".urlencode($what); } - - echo " \n"; - echo " $italic$bold$flag$senderName$flag_end$bold_end$italic_end\n"; - echo "
$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end
\n"; - if ($msg["FLAG_ANSWERED"] == true) echo " A\n"; - elseif (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) echo " !\n"; - else echo "  \n"; - echo " $bold$flag$subject$flag_end$bold_end\n"; + for ($i=1; $i <= count($index_order); $i++) { + switch ($index_order[$i]) { + case 1: # checkbox + echo " \n"; + break; + case 2: # from + echo " $italic$bold$flag$senderName$flag_end$bold_end$italic_end\n"; + break; + case 3: # date + echo "
$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end
\n"; + break; + case 4: # subject + echo " $bold$flag$subject$flag_end$bold_end\n"; + break; + case 5: # flags + if ($msg["FLAG_ANSWERED"] == true) echo " A\n"; + elseif (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) echo " !\n"; + else echo "  \n"; + break; + case 6: # size + break; + } + } + echo "\n"; } @@ -181,6 +198,7 @@ function displayMessageArray($imapConnection, $numMessages, $startMessage, &$msgs, $msort, $mailbox, $sort, $color,$show_num) { global $folder_prefix, $sent_folder; global $imapServerAddress; + global $index_order; // if cache isn't already set, do it now if (!session_is_registered("msgs")) @@ -268,39 +286,54 @@ echo ""; echo ""; echo ""; - echo " "; - /** FROM HEADER **/ - if ($mailbox == $sent_folder) - echo " \n"; - else if ($sort == 3) - echo " \n"; - else - echo " \n"; - /** DATE HEADER **/ - echo " \n"; - else if ($sort == 1) - echo " \n"; - else - echo " \n"; - echo " \n"; - /** SUBJECT HEADER **/ - echo " \n"; - else if ($sort == 5) - echo " \n"; - else - echo " \n"; + for ($i=1; $i <= count($index_order); $i++) { + switch ($index_order[$i]) { + case 1: # checkbox + echo " "; + break; + case 2: # from + if ($mailbox == $sent_folder) + echo " \n"; + else if ($sort == 3) + echo " \n"; + else + echo " \n"; + break; + case 3: # date + echo " \n"; + else if ($sort == 1) + echo " \n"; + else + echo " \n"; + break; + case 4: # subject + echo " \n"; + else if ($sort == 5) + echo " \n"; + else + echo " \n"; + break; + case 5: # flags + echo " \n"; + break; + case 6: # size + echo " \n"; + break; + } + } echo ""; + // loop through and display the info for each message. $t = 0; // $t is used for the checkbox number diff --git a/src/load_prefs.php b/src/load_prefs.php index 391ff213..dcef5e2e 100644 --- a/src/load_prefs.php +++ b/src/load_prefs.php @@ -147,6 +147,20 @@ $message_highlight_list[$i]["value"] = $ary[2]; $message_highlight_list[$i]["match_type"] = $ary[3]; } + + #index order lets you change the order of the message index + $order = getPref($data_dir, $username, "order1"); + for ($i=1; $order; $i++) { + $index_order[$i] = $order; + $order = getPref($data_dir, $username, "order".($i+1)); + } + if (!$index_order) { + $index_order[1] = 1; + $index_order[2] = 2; + $index_order[3] = 3; + $index_order[4] = 5; + $index_order[5] = 4; + } $location_of_bar = getPref($data_dir, $username, 'location_of_bar'); if ($location_of_bar == '') diff --git a/src/options.php b/src/options.php index 7e2b1aa4..14edf1a8 100644 --- a/src/options.php +++ b/src/options.php @@ -137,6 +137,18 @@
 ". _("To") .""; - else - echo " ". _("From") .""; - - if ($sort == 2) - echo " ". _("Date") .""; - if ($sort == 0) - echo "  ". _("Subject") ."\n"; - if ($sort == 4) - echo "  ". _("To") .""; + else + echo " ". _("From") .""; + + if ($sort == 2) + echo " ". _("Date") .""; + if ($sort == 0) + echo " ". _("Subject") ."\n"; + if ($sort == 4) + echo "  Size

+ + + + + + + +
+ +
+ +

-- 2.25.1