From 44b8f1f6ee1cf1a587f10bd26245416c05a3389e Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 11 Aug 2014 18:55:50 +0200 Subject: [PATCH] Added folder type selection options to folder filter (#476) --- plugins/kolab_folders/kolab_folders.js | 83 ++++++++++++++++++++++++- plugins/kolab_folders/kolab_folders.php | 26 ++++++++ 2 files changed, 108 insertions(+), 1 deletion(-) diff --git a/plugins/kolab_folders/kolab_folders.js b/plugins/kolab_folders/kolab_folders.js index 30d81704..a710657e 100644 --- a/plugins/kolab_folders/kolab_folders.js +++ b/plugins/kolab_folders/kolab_folders.js @@ -25,7 +25,31 @@ * for the JavaScript code in this file. */ -$(document).ready(function() { +window.rcmail && rcmail.env.action == 'folders' && rcmail.addEventListener('init', function() { + var filter = $(rcmail.gui_objects.foldersfilter), + optgroup = $('').attr('label', rcmail.gettext('kolab_folders.folderctype')); + + // remove disabled namespaces + filter.children('option').each(function(i, opt) { + $.each(rcmail.env.skip_roots || [], function() { + if (opt.value == this) { + $(opt).remove(); + } + }); + }); + + // add type options to the filter + $.each(rcmail.env.foldertypes, function() { + optgroup.append($('