Merge branch 'master' of ssh://git.kolab.org/git/roundcubemail-plugins-kolab
This commit is contained in:
commit
4ac69cdaf4
1 changed files with 14 additions and 25 deletions
|
@ -331,17 +331,8 @@ class kolab_folders extends rcube_plugin
|
||||||
return $args;
|
return $args;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load configuration
|
|
||||||
$this->load_config();
|
|
||||||
|
|
||||||
// Check that configuration is not disabled
|
|
||||||
$dont_override = (array) $this->rc->config->get('dont_override', array());
|
$dont_override = (array) $this->rc->config->get('dont_override', array());
|
||||||
|
|
||||||
// special handling for 'default_folders'
|
|
||||||
if (in_array('default_folders', $dont_override)) {
|
|
||||||
return $args;
|
|
||||||
}
|
|
||||||
|
|
||||||
// map config option name to kolab folder type annotation
|
// map config option name to kolab folder type annotation
|
||||||
$opts = array(
|
$opts = array(
|
||||||
'drafts_mbox' => 'mail.drafts',
|
'drafts_mbox' => 'mail.drafts',
|
||||||
|
@ -354,7 +345,7 @@ class kolab_folders extends rcube_plugin
|
||||||
foreach ($opts as $opt_name => $type) {
|
foreach ($opts as $opt_name => $type) {
|
||||||
$new = $args['prefs'][$opt_name];
|
$new = $args['prefs'][$opt_name];
|
||||||
$old = $this->rc->config->get($opt_name);
|
$old = $this->rc->config->get($opt_name);
|
||||||
if ($new === $old) {
|
if (!strlen($new) || $new === $old || in_array($opt_name, $dont_override)) {
|
||||||
unset($opts[$opt_name]);
|
unset($opts[$opt_name]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -371,7 +362,6 @@ class kolab_folders extends rcube_plugin
|
||||||
|
|
||||||
foreach ($opts as $opt_name => $type) {
|
foreach ($opts as $opt_name => $type) {
|
||||||
$foldername = $args['prefs'][$opt_name];
|
$foldername = $args['prefs'][$opt_name];
|
||||||
if (strlen($foldername)) {
|
|
||||||
|
|
||||||
// get all folders of specified type
|
// get all folders of specified type
|
||||||
$folders = array_intersect($folderdata, array($type));
|
$folders = array_intersect($folderdata, array($type));
|
||||||
|
@ -390,7 +380,6 @@ class kolab_folders extends rcube_plugin
|
||||||
$this->set_folder_type($folder, $maintype);
|
$this->set_folder_type($folder, $maintype);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return $args;
|
return $args;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue