From 9b0f85eb9bcbad3e81518f30b477dd94b55f36fc Mon Sep 17 00:00:00 2001 From: fidian Date: Wed, 16 May 2001 17:56:52 +0000 Subject: [PATCH] * Specified image width and height (solves a weird display funkiness in IE for a split second when the page is loading). * Ripped out code and made a separate function git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1369 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mailbox_display.php | 60 ++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 9f0aa2b2..862b6b5f 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -330,15 +330,15 @@ session_unregister("msgs"); if (($sort == 0) || ($sort == 1)) $msort = array_cleave ($msgs, 'TIME_STAMP'); - if (($sort == 2) || ($sort == 3)) + elseif (($sort == 2) || ($sort == 3)) $msort = array_cleave ($msgs, 'FROM-SORT'); - if (($sort == 4) || ($sort == 5)) + elseif (($sort == 4) || ($sort == 5)) $msort = array_cleave ($msgs, 'SUBJECT-SORT'); - if ($sort == 6) + else // ($sort == 6) $msort = $msgs; if ($sort < 6) { - if($sort % 2) { + if ($sort % 2) { asort($msort); } else { arsort($msort); @@ -556,6 +556,10 @@ echo ""; $urlMailbox=urlencode($mailbox); + + $upPointer = ''; + $downPointer = ''; + $noPointer = ''; // Print the headers for ($i=1; $i <= count($index_order); $i++) { @@ -570,38 +574,20 @@ echo ' '. _("To") .''; else echo ' '. _("From") .''; - - if ($sort == 2) - echo " \n"; - elseif ($sort == 3) - echo " \n"; - elseif ($sort != -1) - echo " \n"; - echo ""; + ShowSortButton($sort, $urlMailbox, 2, 3); + echo "\n"; break; case 3: # date echo ' '. _("Date") .''; - if ($sort == 0) - echo " \n"; - elseif ($sort == 1) - echo " \n"; - elseif ($sort == 6) - echo " \n"; - elseif ($sort != -1) - echo " \n"; - echo ''; + ShowSortButton($sort, $urlMailbox, 0, 1); + echo "\n"; break; case 4: # subject - echo ' '. _("Subject") ."\n"; - if ($sort == 4) - echo " \n"; - elseif ($sort == 5) - echo " \n"; - elseif ($sort != -1) - echo " \n"; - echo ""; + echo ' '. _("Subject") .' '; + ShowSortButton($sort, $urlMailbox, 4, 5); + echo "\n"; break; case 6: # size @@ -612,6 +598,22 @@ echo "\n"; } + function ShowSortButton($sort, $mailbox, $Up, $Down) { + if ($sort != $Up && $sort != $Down) { + $img = 'sort_none.gif'; + $which = $Up; + } elseif ($sort == $Up) { + $img = 'up_pointer.gif'; + $which = $Down; + } else { + $img = 'down_pointer.gif'; + $which = 6; + } + echo ' '; + } + function ShowSelectAllLink($startMessage, $sort) { global $checkall, $PHP_SELF, $what, $where, $mailbox; -- 2.25.1