| | |
| | | if ($result) { |
| | | // Handle subscription of protected folder (#1487656) |
| | | if ($RCMAIL->config->get('protect_default_folders') |
| | | && in_array($mbox, (array)$RCMAIL->config->get('default_folders')) |
| | | && $STORAGE->is_special_folder($mbox) |
| | | ) { |
| | | $OUTPUT->command('disable_subscription', $mbox); |
| | | } |
| | |
| | | $success = $STORAGE->delete_message('*', $mbox); |
| | | $delete = true; |
| | | } |
| | | // copy to Trash |
| | | // move to Trash |
| | | else { |
| | | $success = $STORAGE->move_message('1:*', $trash_mbox, $mbox); |
| | | $delete = false; |
| | |
| | | $OUTPUT->set_env('messagecount', 0); |
| | | if ($delete) { |
| | | $OUTPUT->show_message('folderpurged', 'confirmation'); |
| | | $OUTPUT->command('set_quota', $RCMAIL->quota_content()); |
| | | $OUTPUT->command('set_quota', $RCMAIL->quota_content(null, $mbox)); |
| | | } |
| | | else { |
| | | $OUTPUT->show_message('messagemoved', 'confirmation'); |
| | |
| | | // get folders from server |
| | | $STORAGE->clear_cache('mailboxes', true); |
| | | |
| | | $a_unsubscribed = $STORAGE->list_folders(); |
| | | $a_subscribed = $STORAGE->list_folders_subscribed('', '*', null, null, true); // unsorted |
| | | $delimiter = $STORAGE->get_hierarchy_delimiter(); |
| | | $namespace = $STORAGE->get_namespace(); |
| | | $a_js_folders = array(); |
| | | $seen = array(); |
| | | $list_folders = array(); |
| | | |
| | | $default_folders = (array) $RCMAIL->config->get('default_folders'); |
| | | $a_unsubscribed = $STORAGE->list_folders(); |
| | | $a_subscribed = $STORAGE->list_folders_subscribed('', '*', null, null, true); // unsorted |
| | | $delimiter = $STORAGE->get_hierarchy_delimiter(); |
| | | $namespace = $STORAGE->get_namespace(); |
| | | $special_folders = array_flip(array_merge(array('inbox' => 'INBOX'), $STORAGE->get_special_folders())); |
| | | $protect_default = $RCMAIL->config->get('protect_default_folders'); |
| | | $a_js_folders = array(); |
| | | $seen = array(); |
| | | $list_folders = array(); |
| | | |
| | | // pre-process folders list |
| | | foreach ($a_unsubscribed as $i => $folder) { |
| | |
| | | $idx = $i + 1; |
| | | $sub_key = array_search($folder['id'], $a_subscribed); |
| | | $subscribed = $sub_key !== false; |
| | | $protected = $protect_default && in_array($folder['id'], $default_folders); |
| | | $protected = $protect_default && isset($special_folders[$folder['id']]); |
| | | $noselect = false; |
| | | $classes = array($i%2 ? 'even' : 'odd'); |
| | | |
| | |
| | | |
| | | $OUTPUT->add_gui_object('subscriptionlist', $attrib['id']); |
| | | $OUTPUT->set_env('subscriptionrows', $a_js_folders); |
| | | $OUTPUT->set_env('defaultfolders', $default_folders); |
| | | $OUTPUT->set_env('defaultfolders', array_keys($special_folders)); |
| | | $OUTPUT->set_env('delimiter', $delimiter); |
| | | |
| | | return $form_start . $table->show($attrib) . $form_end; |
| | |
| | | $a_threaded = (array) $RCMAIL->config->get('message_threading', array()); |
| | | $oldprefix = '/^' . preg_quote($oldname . $delimiter, '/') . '/'; |
| | | |
| | | foreach (array_keys($a_threaded) as $key) { |
| | | foreach ($a_threaded as $key => $val) { |
| | | if ($key == $oldname) { |
| | | unset($a_threaded[$key]); |
| | | $a_threaded[$newname] = true; |
| | | $a_threaded[$newname] = $val; |
| | | } |
| | | else if (preg_match($oldprefix, $key)) { |
| | | unset($a_threaded[$key]); |
| | | $a_threaded[preg_replace($oldprefix, $newname.$delimiter, $key)] = true; |
| | | $a_threaded[preg_replace($oldprefix, $newname.$delimiter, $key)] = $val; |
| | | } |
| | | } |
| | | |
| | | $RCMAIL->user->save_prefs(array('message_threading' => $a_threaded)); |
| | | |
| | | // #1488692: update session |