Better search status display for virtual folders
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 11 Sep 2010 04:35:34 +0000 (22:35 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Sat, 11 Sep 2010 17:05:51 +0000 (11:05 -0600)
imp/js/dimpbase.js
imp/lib/Views/ListMessages.php
imp/templates/dimp/javascript_defs_dimp.php

index 163d7cd..e52d00d 100644 (file)
@@ -551,10 +551,19 @@ var DimpBase = {
 
             if (this.isSearch()) {
                 tmp = this.viewport.getMetaData('slabel');
+                if (this.viewport.getMetaData('vfolder')) {
+                    $('search_close').hide();
+                    if (tmp) {
+                        tmp = DIMP.text.vfolder.sub('%s', tmp);
+                    }
+                } else {
+                    $('search_close').show();
+                }
+
                 if (tmp) {
                     $('search_label').update(tmp.stripTags().escapeHTML());
                 }
-                [ $('search_edit') ].invoke(this.search ? 'hide' : 'show');
+                [ $('search_edit') ].invoke(this.search || this.viewport.getMetaData('noedit') ? 'hide' : 'show');
                 $('searchbar').show();
             } else {
                 this.setFolderLabel(this.folder, this.viewport.getMetaData('unseen') || 0);
index 1f1c9af..9bb269a 100644 (file)
@@ -184,6 +184,12 @@ class IMP_Views_ListMessages
         if ($is_search &&
             ($args['initial'] || strlen($args['qsearchmbox']))) {
             $md->slabel = $imp_search->searchQueryText($mbox);
+            if ($imp_search->isVFolder($mbox)) {
+                $md->vfolder = 1;
+                if (!$imp_search->isEditableVFolder($mbox)) {
+                    $md->noedit = 1;
+                }
+            }
         }
 
         $imp_imap = $GLOBALS['injector']->getInstance('IMP_Imap')->getOb();
index 1477a97..3d3a948 100644 (file)
@@ -147,6 +147,7 @@ $code['text'] = array(
     'rename_prompt' => _("Rename folder to:"),
     'search' => _("Search"),
     'verify' => _("Verifying..."),
+    'vfolder' => _("Virtual Folder: %s"),
     'vp_empty' => _("There are no messages in this mailbox."),
 );