- Move rcmail_localize_folderpath() to main.inc

release-0.6
alecpl 14 years ago
parent 1cd36267a1
commit 363514e30b

@ -1469,6 +1469,31 @@ function rcmail_localize_foldername($name)
} }
function rcmail_localize_folderpath($path)
{
global $RCMAIL;
$protect_folders = $RCMAIL->config->get('protect_default_folders');
$default_folders = (array) $RCMAIL->config->get('default_imap_folders');
$delimiter = $RCMAIL->imap->get_hierarchy_delimiter();
$path = explode($delimiter, $path);
$result = array();
foreach ($path as $idx => $dir) {
$directory = implode($delimiter, array_slice($path, 0, $idx+1));
if ($protect_folders && in_array($directory, $default_folders)) {
unset($result);
$result[] = rcmail_localize_foldername($directory);
}
else {
$result[] = rcube_charset_convert($dir, 'UTF7-IMAP');
}
}
return implode($delimiter, $result);
}
function rcmail_quota_display($attrib) function rcmail_quota_display($attrib)
{ {
global $OUTPUT; global $OUTPUT;
@ -2345,3 +2370,27 @@ function rcube_autocomplete_init()
$RCMAIL->output->set_env('autocomplete_min_length', $RCMAIL->config->get('autocomplete_min_length')); $RCMAIL->output->set_env('autocomplete_min_length', $RCMAIL->config->get('autocomplete_min_length'));
$RCMAIL->output->add_label('autocompletechars'); $RCMAIL->output->add_label('autocompletechars');
} }
function rcmail_localize_folderpath($path)
{
global $RCMAIL;
$protect_folders = $RCMAIL->config->get('protect_default_folders');
$default_folders = (array) $RCMAIL->config->get('default_imap_folders');
$delimiter = $RCMAIL->imap->get_hierarchy_delimiter();
$path = explode($delimiter, $path);
$result = array();
foreach ($path as $idx => $dir) {
$directory = implode($delimiter, array_slice($path, 0, $idx+1));
if ($protect_folders && in_array($directory, $default_folders)) {
unset($result);
$result[] = rcmail_localize_foldername($directory);
}
else {
$result[] = rcube_charset_convert($dir, 'UTF7-IMAP');
}
}
return implode($delimiter, $result);
}

@ -289,30 +289,6 @@ function rcmail_get_form_part($form)
return $content; return $content;
} }
function rcmail_localize_folderpath($path)
{
global $RCMAIL;
$protect_folders = $RCMAIL->config->get('protect_default_folders');
$default_folders = (array) $RCMAIL->config->get('default_imap_folders');
$delimiter = $RCMAIL->imap->get_hierarchy_delimiter();
$path = explode($delimiter, $path);
$result = array();
foreach ($path as $idx => $dir) {
$directory = implode($delimiter, array_slice($path, 0, $idx+1));
if ($protect_folders && in_array($directory, $default_folders)) {
unset($result);
$result[] = rcmail_localize_foldername($directory);
}
else {
$result[] = rcube_charset_convert($dir, 'UTF7-IMAP');
}
}
return implode($delimiter, $result);
}
//$OUTPUT->set_pagetitle(rcube_label('folders')); //$OUTPUT->set_pagetitle(rcube_label('folders'));

Loading…
Cancel
Save