Handle display of non-IMAP mailboxes better
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 10 Aug 2009 05:53:36 +0000 (23:53 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 10 Aug 2009 23:46:27 +0000 (17:46 -0600)
imp/js/DimpBase.js
imp/lib/Dimp.php
imp/lib/Imap/Tree.php

index 84d571e..34d678e 100644 (file)
@@ -1945,7 +1945,7 @@ var DimpBase = {
         } else {
             switch (li.readAttribute('ftype')) {
             case 'container':
-            case 'vcontainer':
+            case 'scontainer':
                 e.stop();
                 break;
 
@@ -2002,16 +2002,20 @@ var DimpBase = {
             title = ob.t || ob.m;
 
         if (ob.v) {
-            ftype = ob.co ? 'vcontainer' : 'virtual';
+            ftype = ob.co ? 'scontainer' : 'virtual';
             title = label;
         } else if (ob.co) {
-            ftype = 'container';
+            if (ob.n) {
+                ftype = 'scontainer';
+                title = label;
+            } else {
+                ftype = 'container';
+            }
 
             /* This is a dummy container element to display child elements of
              * a mailbox displayed in the 'specialfolders' section. */
-            if (ob.s) {
+            if (ob.dummy) {
                 fid += '_special';
-                ob.s = false;
                 cname += ' specialContainer';
             }
         } else {
@@ -2049,7 +2053,8 @@ var DimpBase = {
                     div.removeClassName('exp').addClassName(ob.cl || 'folderImg');
 
                     tmp = Object.clone(ob);
-                    tmp.co = true;
+                    tmp.co = tmp.dummy = true;
+                    tmp.s = false;
                     this.createFolder(tmp);
                 }
             } else {
index f70c074..5ba80b9 100644 (file)
@@ -174,6 +174,7 @@ class IMP_Dimp
      * 'i' (icon) = A user defined icon to use. [string] [DEFAULT: none]
      * 'l' (label) = The folder display label. [string] [DEFAULT: 'm' val]
      * 'm' (mbox) = The mailbox value. [string]
+     * 'n' (non-imap) = A non-IMAP element? [boolean] [DEFAULT: no]
      * 'pa' (parent) = The parent element. [string] [DEFAULT:
      *                 DIMP.conf.base_mbox]
      * 'po' (polled) = Is the element polled? [boolean] [DEFAULT: no]
@@ -218,6 +219,9 @@ class IMP_Dimp
         if ($elt['container']) {
             $ob->cl = 'exp';
             $ob->co = 1;
+            if ($elt['nonimap']) {
+                $ob->n = 1;
+            }
         } else {
             if ($elt['polled']) {
                 $ob->u = intval($elt['unseen']);
index efdb961..facb7f0 100644 (file)
@@ -1811,6 +1811,7 @@ class IMP_Imap_Tree
      * 'msgs' - (integer) The number of total messages in the element (if
      *          polled).
      * 'name' - (string) A html-ized version of 'label'.
+     * 'nonimap' - (boolean) Is this a non-IMAP element?
      * 'parent' - (array) The parent element value.
      * 'polled' - (boolean) Show polled information?
      * 'recent' - (integer) The number of new messages in the element (if
@@ -1847,6 +1848,7 @@ class IMP_Imap_Tree
             'level' => $mailbox['c'],
             'mbox_val' => htmlspecialchars($mailbox['v']),
             'name' => htmlspecialchars($mailbox['l']),
+            'nonimap' => $this->_isNonIMAPElt($mailbox),
             'parent' => $mailbox['p'],
             'polled' => false,
             'recent' => 0,