From c8b56fdd4cec11465467464b27eed1cc2e54fe5e Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sun, 9 Aug 2009 23:53:36 -0600 Subject: [PATCH] Handle display of non-IMAP mailboxes better --- imp/js/DimpBase.js | 17 +++++++++++------ imp/lib/Dimp.php | 4 ++++ imp/lib/Imap/Tree.php | 2 ++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/imp/js/DimpBase.js b/imp/js/DimpBase.js index 84d571e18..34d678eae 100644 --- a/imp/js/DimpBase.js +++ b/imp/js/DimpBase.js @@ -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 { diff --git a/imp/lib/Dimp.php b/imp/lib/Dimp.php index f70c074e7..5ba80b913 100644 --- a/imp/lib/Dimp.php +++ b/imp/lib/Dimp.php @@ -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']); diff --git a/imp/lib/Imap/Tree.php b/imp/lib/Imap/Tree.php index efdb961fb..facb7f082 100644 --- a/imp/lib/Imap/Tree.php +++ b/imp/lib/Imap/Tree.php @@ -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, -- 2.11.0