Improved mail.default and mail.inbox types handling
This commit is contained in:
parent
dc58fd1a28
commit
20c57736f5
2 changed files with 23 additions and 7 deletions
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue