X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fmailbox_display.php;h=cad21478b0d36251a303367a4583e5744b4f59e1;hb=c6b144ddc3e49b4dab25f68477d6e9110db31879;hp=1298b6b25dd5432ebac04145ad0b5f7bb5e6a0a1;hpb=0700d853a85e210e05c94b5dc1703f90d9a4b2be;p=squirrelmail.git diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 1298b6b2..cad21478 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -27,7 +27,7 @@ } $GLOBALS["row_count"]++; if ($GLOBALS["row_count"] % 2) { - if (!isset($color[12])) $color[12] = "#EAEAEA"; + if (!isset($color[12])) $color[12] = '#EAEAEA'; $color_string = $color[12]; } } @@ -35,6 +35,13 @@ $msg = $msgs[$key]; $senderName = sqimap_find_displayable_name($msg['FROM']); + if( $mailbox == _("None") ) { + // $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); + $boxes = sqimap_mailbox_list($imapConnection); + // sqimap_logout($imapConnection); + $mailbox = $boxes[0]['unformatted']; + unset( $boxes ); + } $urlMailbox = urlencode($mailbox); $subject = processSubject($msg['SUBJECT']); @@ -71,7 +78,7 @@ $italic_end = ''; } if (isset($msg['FLAG_DELETED']) && $msg['FLAG_DELETED']) - { + { $fontstr = ""; $fontstr_end = ''; } @@ -123,6 +130,14 @@ if (! isset($search_stuff)) { $search_stuff = ''; } echo "$flag$subject$flag_end$bold_end\n"; break; case 5: # flags @@ -133,6 +148,10 @@ echo "A\n"; $stuff = true; } + if (ereg('(5)',substr($msg['PRIORITY'],0,1))) { + echo "v\n"; + $stuff = true; + } if ($msg['TYPE0'] == 'multipart') { echo "+\n"; $stuff = true; @@ -333,7 +352,7 @@ global $folder_prefix, $sent_folder; global $imapServerAddress; global $index_order, $real_endMessage, $real_startMessage, $checkall; - + // if cache isn't already set, do it now if (!session_is_registered('msgs')) session_register('msgs'); @@ -365,30 +384,58 @@ $Message = _("Viewing message") ." $startMessage ($numMessages " . _("total") . ")\n"; } - $More = ''; if ($sort == 6) { $use = 0; } else { $use = 1; } + $lMore = ''; + $rMore = ''; if (($nextGroup <= $numMessages) && ($prevGroup >= 0)) { - $More = "". _("Previous") ." | \n"; - $More .= "". _("Next") ."\n"; + $lMore = "". _("Previous") . ''; + $rMore = "". _("Next") ."\n"; } elseif (($nextGroup > $numMessages) && ($prevGroup >= 0)) { - $More = "". _("Previous") ." | \n"; - $More .= ""._("Next")."\n"; + $lMore = "". _("Previous") . ''; + $rMore = ""._("Next")."\n"; } elseif (($nextGroup <= $numMessages) && ($prevGroup < 0)) { - $More = ""._("Previous")." | \n"; - $More .= "". _("Next") ."\n"; + $lMore = ""._("Previous") . ''; + $rMore = "". _("Next") ."\n"; + } + if( $lMore <> '' ) + $lMore .= ' | '; + + // Page selector block. Following code computes page links. + $mMore = ''; + if( getPref($data_dir, $username, 'page_selector') && $numMessages > $show_num ) { + + $j = intval( $numMessages / $show_num ); + if( $numMessages % $show_num <> 0 ) + $j++; + $startMessage = min( $startMessage, $numMessages ); + for( $i = 0; $i < $j; $i++ ) { + + $start = ( ( $i * $show_num ) + 1 ); + + if( $startMessage >= $start && + $startMessage < $start + $show_num ) { + $mMore .= '' . ($i+1) . ' '; + } else { + $mMore .= "" . + ($i+1) . + ' '; + } + } + $mMore .= ' | '; } if (! isset($msg)) - $msg = ""; + $msg = ''; mail_message_listing_beginning($imapConnection, "move_messages.php?msg=$msg&mailbox=$urlMailbox&startMessage=$startMessage", - $mailbox, $sort, $Message, $More, $startMessage); + $mailbox, $sort, $Message, $lMore . $mMore . $rMore, $startMessage); $groupNum = $startMessage % ($show_num - 1); $real_startMessage = $startMessage; @@ -447,13 +494,11 @@ echo ""; echo '
'; - echo "$More\n"; + echo "$lMore$mMore$rMore\n"; if (!$startMessage) $startMessage=1; ShowSelectAllLink($startMessage, $sort); - echo '
'; - echo ''; - echo ''; /** End of message-list table */ + echo ''; /** End of message-list table */ do_hook('mailbox_index_after'); } @@ -485,13 +530,12 @@ echo "$More\n"; ShowSelectAllLink($startMessage, $sort); - echo ''; - echo ''; + echo ''; /** The delete and move options */ echo ""; - echo "\n\n\n
\n"; + echo "\n\n"; echo "\n"; echo " \n"; echo "
\n"; @@ -590,32 +634,25 @@ function ShowSelectAllLink($startMessage, $sort) { global $checkall, $PHP_SELF, $what, $where, $mailbox; - - // If you can figure out some working javascript, - // feel free to put it in here! - // Allegedly this stuff works for someone somewhere - // Don't forget to uncomment the at the end! - - // This code is from Kevin Cawthorne - // It was adapted by Tyler to use a document.write for drawing the - // input checkbox and to use the