| | |
| | | ), |
| | | ); |
| | | |
| | | if (strlen($path) || !strlen($mbox)) { |
| | | if (!empty($options) && ($options['norename'] || $options['namespace'] != 'personal')) { |
| | | // prevent user from moving folder |
| | | $hidden_path = new html_hiddenfield(array('name' => '_parent', 'value' => $path)); |
| | | $form['props']['fieldsets']['location']['content']['name']['value'] .= $hidden_path->show(); |
| | | } |
| | | else { |
| | | $selected = isset($_POST['_parent']) ? $_POST['_parent'] : $path_id; |
| | | $select = rcmail_mailbox_select(array( |
| | | 'name' => '_parent', |
| | | 'noselection' => '---', |
| | | 'realnames' => false, |
| | | 'maxlength' => 150 |
| | | )); |
| | | if (!empty($options) && ($options['norename'] || $options['protected'])) { |
| | | // prevent user from moving folder |
| | | $hidden_path = new html_hiddenfield(array('name' => '_parent', 'value' => $path)); |
| | | $form['props']['fieldsets']['location']['content']['name']['value'] .= $hidden_path->show(); |
| | | } |
| | | else { |
| | | $selected = isset($_POST['_parent']) ? $_POST['_parent'] : $path_id; |
| | | $select = rcmail_mailbox_select(array( |
| | | 'name' => '_parent', |
| | | 'noselection' => '---', |
| | | 'realnames' => false, |
| | | 'maxlength' => 150, |
| | | 'unsubscribed' => true, |
| | | 'exceptions' => array($mbox_imap), |
| | | )); |
| | | |
| | | $form['props']['fieldsets']['location']['content']['path'] = array( |
| | | 'label' => rcube_label('parentfolder'), |
| | | 'value' => $select->show($selected), |
| | | ); |
| | | } |
| | | $form['props']['fieldsets']['location']['content']['path'] = array( |
| | | 'label' => rcube_label('parentfolder'), |
| | | 'value' => $select->show($selected), |
| | | ); |
| | | } |
| | | |
| | | // Settings |
| | |
| | | $content = rcmail_get_form_part($tab); |
| | | } |
| | | |
| | | if ($content) { |
| | | if ($content) { |
| | | $out .= html::tag('fieldset', null, html::tag('legend', null, Q($tab['name'])) . $content) ."\n"; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | 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); |
| | | } |
| | | |
| | | |