| | |
| | | // $path is in UTF7-IMAP already |
| | | |
| | | $delimiter = $IMAP->get_hierarchy_delimiter(); |
| | | $options = strlen($old_imap) ? rcube_folder_options($old_imap) : array(); |
| | | $options = strlen($old_imap) ? rcmail_folder_options($old_imap) : array(); |
| | | |
| | | // Folder name checks |
| | | if ($options['protected'] || $options['norename']) { |
| | |
| | | $name_imap = $path . $delimiter . $name_imap; |
| | | } |
| | | else { |
| | | $name_imap = $RCMAIL->imap->mod_mailbox($name, 'in'); |
| | | $name_imap = $RCMAIL->imap->mod_mailbox($name_imap, 'in'); |
| | | } |
| | | |
| | | $folder['name'] = $name_imap; |
| | | $folder['oldname'] = $old_imap; |
| | | $folder['class'] = ''; |
| | | $folder['options'] = $options; |
| | | $folder['settings'] = array( |
| | | // List view mode: 0-list, 1-threads |
| | | 'view_mode' => (int) get_input_value('_viewmode', RCUBE_INPUT_POST), |
| | |
| | | // create a new mailbox |
| | | if (!$error && !strlen($old)) { |
| | | |
| | | $folder['subscribe'] = true; |
| | | |
| | | $plugin = $RCMAIL->plugins->exec_hook('folder_create', array('record' => $folder)); |
| | | |
| | | $folder = $plugin['record']; |
| | | |
| | | if (!$plugin['abort']) { |
| | | $created = $IMAP->create_mailbox($folder['name'], TRUE); |
| | | $created = $IMAP->create_mailbox($folder['name'], $folder['subscribe']); |
| | | } |
| | | else { |
| | | $created = $plugin['result']; |
| | |
| | | $RCMAIL->user->save_prefs(array('message_threading' => $a_threaded)); |
| | | } |
| | | |
| | | rcmail_update_folder_row($folder['name'], null, $folder['subscribe'], $folder['class']); |
| | | $OUTPUT->show_message('foldercreated', 'confirmation'); |
| | | $OUTPUT->command('reload', 250); |
| | | // reset folder preview frame |
| | | $OUTPUT->command('subscription_select'); |
| | | $OUTPUT->send('iframe'); |
| | | } |
| | | else { |
| | |
| | | |
| | | $OUTPUT->show_message('folderupdated', 'confirmation'); |
| | | if ($rename) { |
| | | $OUTPUT->command('reload', 250); |
| | | rcmail_update_folder_row($folder['name'], $folder['oldname'], $folder['subscribe'], $folder['class']); |
| | | $OUTPUT->send('iframe'); |
| | | } |
| | | } |