| | |
| | | <?php |
| | | |
| | | /** |
| | | /* |
| | | +-----------------------------------------------------------------------+ |
| | | | program/steps/settings/save_folder.inc | |
| | | | | |
| | |
| | | |
| | | // init IMAP connection |
| | | $STORAGE = $RCMAIL->get_storage(); |
| | | |
| | | |
| | | $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true)); |
| | | $old = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true); |
| | |
| | | |
| | | // create a new mailbox |
| | | if (!$error && !strlen($old)) { |
| | | |
| | | $folder['subscribe'] = true; |
| | | |
| | | $plugin = $RCMAIL->plugins->exec_hook('folder_create', array('record' => $folder)); |
| | |
| | | $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error', null, false); |
| | | } |
| | | } |
| | | |
| | | // update a mailbox |
| | | else if (!$error) { |
| | | $plugin = $RCMAIL->plugins->exec_hook('folder_update', array('record' => $folder)); |
| | |
| | | rcmail_update_folder_row($folder['name'], $folder['oldname'], $folder['subscribe'], $folder['class']); |
| | | $OUTPUT->send('iframe'); |
| | | } |
| | | else if (!empty($folder['class'])) { |
| | | rcmail_update_folder_row($folder['name'], $folder['oldname'], $folder['subscribe'], $folder['class']); |
| | | } |
| | | } |
| | | else { |
| | | // show error message |