Improved empty search messages display
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 7 Sep 2009 10:24:54 +0000 (04:24 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 7 Sep 2009 10:24:54 +0000 (04:24 -0600)
imp/mailbox.php
imp/templates/mailbox/empty_mailbox.html

index 1a38d48..3f4f4a0 100644 (file)
@@ -236,11 +236,6 @@ $mbox_info = $imp_mailbox->getMailboxArray(range($pageOb['begin'], $pageOb['end'
 /* Determine sorting preferences. */
 $sortpref = IMP::getSort($imp_mbox['mailbox']);
 
-/* If search results are empty, inform the user. */
-if ($search_mbox && !$pageOb['msgcount']) {
-    $notification->push(_("No messages matched your search."), 'horde.warning');
-}
-
 /* Cache this value since we use it alot on this page. */
 $graphicsdir = $registry->getImageDir('horde');
 
@@ -472,6 +467,7 @@ if (empty($pageOb['end'])) {
 
     $empty_template = new Horde_Template();
     $empty_template->setOption('gettext', true);
+    $empty_template->set('search_mbox', $search_mbox);
     echo $empty_template->fetch(IMP_TEMPLATES . '/mailbox/empty_mailbox.html');
     require $registry->get('templates', 'horde') . '/common-footer.inc';
     exit;
index 06bc4fc..2dfa252 100644 (file)
@@ -1,3 +1,3 @@
 <div class="text">
- <em><gettext>There are no messages in this mailbox.</gettext></em>
+ <em><if:search_mbox><gettext>No messages matched your search criteria.</gettext><else:search_mbox><gettext>There are no messages in this mailbox.</gettext></else:search_mbox></if:search_mbox></em>
 </div>