From: Seth E. R. <ind...@us...> - 2004-07-07 00:00:07
|
Update of /cvsroot/squirrelmail/squirrelmail/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1740 Modified Files: search.php Log Message: Remove the multiple lines of 'No Messages Found' when searching multiple folders Index: search.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/src/search.php,v retrieving revision 1.134 retrieving revision 1.135 diff -u -w -r1.134 -r1.135 --- search.php 7 Jun 2004 11:14:34 -0000 1.134 +++ search.php 6 Jul 2004 23:59:58 -0000 1.135 @@ -862,7 +862,6 @@ function asearch_print_mailbox_msgs($imapConnection, &$aMailbox, $color) { - if (fetchMessageHeaders($imapConnection, $aMailbox)) { /** * A mailbox can contain different sets with uid's. Default, for normal * message list view we use '0' as setindex and for search a different @@ -911,9 +910,6 @@ echo '</td></tr>'; echo '</table>'; - } else { - echo '<br />' . html_tag('div', asearch_get_error_display($color, _("No Messages Found")), 'center') . "\n"; - } } /** @@ -1398,6 +1394,7 @@ do_hook('search_after_form'); if ($submit == $search_button_text) { + $msgsfound = false; echo html_tag('table', '', 'center', $color[9], 'width="100%" cellpadding="1" cellspacing="0" border="0"'); echo html_tag('tr', html_tag('td', asearch_get_title_display($color, _("Search Results")), 'center', $color[5])); echo html_tag('tr', html_tag('td', asearch_get_query_display($color, $mailbox_array, $biop_array, $unop_array, $where_array, $what_array, $exclude_array, $sub_array), 'center', $color[4])); @@ -1450,7 +1447,6 @@ $aMailboxPref[MBX_PREF_AUTO_EXPUNGE] = (bool) $auto_expunge; $aMailboxPref[MBX_PREF_INTERNALDATE] = (bool) getPref($data_dir, $username, 'internal_date_sort'); - echo '<br />'; $aConfig['search'] = $search['search']; $aConfig['charset'] = $search['charset']; $aConfig['setindex'] = 1; // $what $where = 'search' @@ -1464,12 +1460,20 @@ handleMessageListForm($imapConnection,$aMailbox); } } + if (fetchMessageHeaders($imapConnection, $aMailbox)) { + $msgsfound = true; + echo '<br />'; asearch_print_mailbox_msgs($imapConnection, $aMailbox, $color); + flush(); + } /* add the mailbox to the cache */ $mailbox_cache[$aMailbox['NAME']] = $aMailbox; } } + if(!$msgsfound) { + echo '<br />' . html_tag('div', asearch_get_error_display($color, _("No Messages Found")), 'center') . "\n"; + } } do_hook('search_bottom'); |