summaryrefslogtreecommitdiff
path: root/plugins/kolab_folders
diff options
context:
space:
mode:
authorAleksander Machniak (Kolab Systems) <machniak@kolabsys.com>2011-07-07 17:39:34 (GMT)
committerAleksander Machniak (Kolab Systems) <machniak@kolabsys.com>2011-07-07 17:39:34 (GMT)
commit20c57736f53b779412a8f7d4d58eea87c4219212 (patch)
treee61a168e78a94fac8b525e4c05023db3270455e0 /plugins/kolab_folders
parentdc58fd1a284c5879e9ed1904507b42fdbbf4cc47 (diff)
downloadroundcubemail-plugins-kolab-20c57736f53b779412a8f7d4d58eea87c4219212.tar.gz
Improved mail.default and mail.inbox types handling
Diffstat (limited to 'plugins/kolab_folders')
-rw-r--r--plugins/kolab_folders/kolab_folders.js10
-rw-r--r--plugins/kolab_folders/kolab_folders.php20
2 files changed, 23 insertions, 7 deletions
diff --git a/plugins/kolab_folders/kolab_folders.js b/plugins/kolab_folders/kolab_folders.js
index 6fffb1f..0e63a6d 100644
--- a/plugins/kolab_folders/kolab_folders.js
+++ b/plugins/kolab_folders/kolab_folders.js
@@ -19,11 +19,15 @@ $(document).ready(function() {
// For non-mail folders we must hide mail-specific subtypes
$('option', sub).each(function() {
var opt = $(this), val = opt.val();
- if (val == '' || val == 'default') {
+ if (val == '')
return;
- }
+ // there's no mail.default
+ if (val == 'default' && type != 'mail') {
+ opt.show();
+ return;
+ };
- if (type == 'mail')
+ if (type == 'mail' && val != 'default')
opt.show();
else if (bw.ie)
opt.remove();
diff --git a/plugins/kolab_folders/kolab_folders.php b/plugins/kolab_folders/kolab_folders.php
index 0cd1f02..1490a0b 100644
--- a/plugins/kolab_folders/kolab_folders.php
+++ b/plugins/kolab_folders/kolab_folders.php
@@ -28,7 +28,7 @@ class kolab_folders extends rcube_plugin
public $task = '?(?!login).*';
public $types = array('mail', 'event', 'journal', 'task', 'note', 'contact');
- public $mail_types = array('inbox', 'drafts', 'sentitems', 'outbox', 'wastebasket', 'junkemail');
+ public $mail_types = array('drafts', 'sentitems', 'outbox', 'wastebasket', 'junkemail');
private $rc;
const CTYPE_KEY = '/shared/vendor/kolab/folder-type';
@@ -172,11 +172,24 @@ class kolab_folders extends rcube_plugin
if (!$this->metadata_support()) {
return $args;
}
+ // load translations
+ $this->add_texts('localization/', false);
+
+ // INBOX folder is of type mail.inbox and this cannot be changed
+ if ($args['name'] == 'INBOX') {
+ $args['form']['props']['fieldsets']['settings']['content']['foldertype'] = array(
+ 'label' => $this->gettext('folderctype'),
+ 'value' => sprintf('%s (%s)', $this->gettext('foldertypemail'), $this->gettext('inbox')),
+ );
+
+ return $args;
+ }
$mbox = strlen($args['name']) ? $args['name'] : $args['parent_name'];
+
if (isset($_POST['_ctype'])) {
$new_ctype = trim(get_input_value('_ctype', RCUBE_INPUT_POST));
- $new_subtype = trim(get_input_value('_subtype', RCUBE_INPUT_POST));
+ $new_subtype = trim(get_input_value('_subtype', RCUBE_INPUT_POST));
}
// Get type of the folder or the parent
@@ -190,8 +203,7 @@ class kolab_folders extends rcube_plugin
$ctype = 'mail';
}
- // load translations
- $this->add_texts('localization/', false);
+ // Add javascript script to the client
$this->include_script('kolab_folders.js');
// build type SELECT fields