{
var div, f_node, li, ll, parent_e,
fid = this.getFolderId(ob.m),
+ label = ob.l || ob.m,
mbox = decodeURIComponent(ob.m),
submboxid = this.getSubFolderId(fid),
submbox = $(submboxid),
ftype = ob.v ? (ob.co ? 'vcontainer' : 'virtual') : (ob.co ? 'container' : (ob.s ? 'special' : 'folder'));
- li = new Element('LI', { className: 'folder', id: fid, l: ob.l, mbox: mbox, ftype: ftype });
+ li = new Element('LI', { className: 'folder', id: fid, l: label, mbox: mbox, ftype: ftype });
div = new Element('DIV', { className: ob.cl || 'base', id: fid + '_div' });
if (ob.i) {
div.writeAttribute({ className: 'exp' });
}
- li.insert(div).insert(new Element('A', { id: fid + '_label', title: ob.l }).insert(ob.l));
+ li.insert(div).insert(new Element('A', { id: fid + '_label', title: label }).insert(label));
// Now walk through the parent <ul> to find the right place to
// insert the new folder.
if (ob.s) {
parent_e = $('specialfolders');
} else {
- parent_e = $(this.getSubFolderId(this.getFolderId(ob.pa)));
+ parent_e = $(this.getSubFolderId(this.getFolderId(ob.pa || DIMP.conf.base_mbox)));
parent_e = parent_e ? parent_e.down() : $('normalfolders');
}
'ham_spammbox' => intval(!empty($conf['notspam']['spamfolder'])),
'refresh_time' => intval($prefs->getValue('refresh_time')),
+ 'base_mbox' => IMP_Imap_Tree::BASE_ELT,
'fixed_folders' => empty($conf['server']['fixed_folders'])
? array()
: array_map(array('DIMP', '_appendedFolderPref'), $conf['server']['fixed_folders']),
* 'co' (container) = Is this folder a container element? [boolean]
* [DEFAULT: no]
* 'i' (icon) = A user defined icon to use. [string] [DEFAULT: none]
- * 'l' (label) = The folder display label. [string]
+ * 'l' (label) = The folder display label. [string] [DEFAULT: 'm' val]
* 'm' (mbox) = The mailbox value. [string]
- * 'pa' (parent) = The parent element. [string]
+ * 'pa' (parent) = The parent element. [string] [DEFAULT:
+ * DIMP.conf.base_mbox]
* 'po' (polled) = Is the element polled? [boolean] [DEFAULT: no]
* 's' (special) = Is this a "special" element? [boolean] [DEFAULT: no]
* 'u' (unseen) = The number of unseen messages. [integer]
if ($elt['children']) {
$ob->ch = 1;
}
- $ob->l = $elt['base_elt']['l'];
$ob->m = rawurlencode($elt['value']);
- $ob->pa = rawurlencode($elt['parent']);
+ if ($ob->m != $elt['base_elt']['l']) {
+ $ob->l = $elt['base_elt']['l'];
+ }
+ if ($elt['parent'] != IMP_Imap_Tree::BASE_ELT) {
+ $ob->pa = rawurlencode($elt['parent']);
+ }
if ($elt['polled']) {
$ob->po = 1;
}