a custom function to provide additional information/custom formatting of
messages in the mailbox message list? If so, make sure you define
_imp_hook_msglist_format() in hooks.php.">false</configboolean>
+ <configboolean name="display_folder" required="false" desc="Should we use
+ a custom function to dynamically determine if we show a specified IMAP
+ mailbox in the folderlist ? If so, make sure you define
+ _imp_hook_display_folder() in hooks.php.">false</configboolean>
</configsection>
</configtab>
// }
// }
+// This is an example hook function to hide specified IMAP mailboxes in
+// folder listings. If the hook returns false, the mailbox will not be
+// displayed.
+
+// if (!function_exists('_imp_hook_display_folder')) {
+// function _imp_hook_display_folder($mailbox) {
+// return ($mailbox == 'DONOTDISPLAY');
+// }
+// }
+
// This is an example hook function for the IMP spam reporting email option.
// This function is called when the message is about to be forwarded - it
// will return the email address to forward to. This is handy for spam
return $icons;
}
}
+
+ if (!function_exists('_imp_hook_display_folder')) {
+ function _imp_hook_display_folder($mailbox) {
+ $type = Kolab::getMailboxType($mailbox);
+ return empty($type) || ($type == 'mail');
+ }
+ }
}
// Sample function for returning the quota. Uses the PECL ssh2
v4.3.4-cvs
----------
-[jan] Fix rendering of subjects in RTL scripts when using LTR translations
- (vilius@lnk.lt, Bug #3511).
[mms] Add hook to allow hiding of IMAP folders (Request #7353, Gunnar
Wrobel <p@rdus.de>).
+[jan] Fix rendering of subjects in RTL scripts when using LTR translations
+ (vilius@lnk.lt, Bug #3511).
[jan] Fix logging of messages forwarded with attachments (Bug #7911).
div = new Element('DIV', { className: ob.cl || 'base', id: fid + '_div' });
if (ob.i) {
- div.setStyle({ background-image: 'url("' + ob.i + '")' });
+ div.setStyle({ backgroundImage: 'url("' + ob.i + '")' });
}
if (ob.ch) {
div.writeAttribute({ className: 'exp' });
const ELT_NEED_SORT = 64;
const ELT_VFOLDER = 128;
const ELT_NONIMAP = 256;
+ const ELT_INVISIBLE = 512;
/* The isOpen() expanded mode constants. */
const OPEN_NONE = 0;
/* Get the mailbox label. */
$elt['l'] = IMP::getLabel($tmp[$elt['c']]);
+
if ($_SESSION['imp']['protocol'] != 'pop') {
+ if (!empty($GLOBALS['conf']['hooks']['display_folder'])) {
+ $this->_setInvisible($elt, !Horde::callHook('_imp_hook_display_folder', array($elt['v']), 'imp'));
+ }
+
if ($elt['c'] != 0) {
$elt['p'] = implode(is_null($ns_info) ? $this->_delimiter : $ns_info['delimiter'], array_slice($tmp, 0, $elt['c']));
}
}
/**
+ * Is the element invisible?
+ *
+ * @param array $elt A tree element.
+ *
+ * @return integer True if the element is marked as invisible.
+ */
+ public function isInvisible($elt)
+ {
+ return $elt['a'] & self::ELT_INVISIBLE;
+ }
+
+ /**
+ * Set the invisible attribute for an element.
+ *
+ * @param array &$elt A tree element.
+ * @param boolean $bool The setting.
+ */
+ protected function _setInvisible(&$elt, $bool)
+ {
+ $this->_setAttribute($elt, self::ELT_INVISIBLE, $bool);
+ }
+
+ /**
* Flag the element as needing its children to be sorted.
*
* @param array &$elt A tree element.
*/
protected function _activeElt($elt)
{
- return ($this->_showunsub ||
- ($this->isSubscribed($elt) && !$this->isContainer($elt)) ||
- $this->hasChildren($elt));
+ return (!$this->isInvisible($elt) &&
+ ($this->_showunsub ||
+ ($this->isSubscribed($elt) && !$this->isContainer($elt)) ||
+ $this->hasChildren($elt)));
}
/**