diff options
Diffstat (limited to 'program/steps/settings')
-rw-r--r-- | program/steps/settings/edit_folder.inc | 1 | ||||
-rw-r--r-- | program/steps/settings/edit_identity.inc | 2 | ||||
-rw-r--r-- | program/steps/settings/edit_prefs.inc | 4 | ||||
-rw-r--r-- | program/steps/settings/edit_response.inc | 2 | ||||
-rw-r--r-- | program/steps/settings/folders.inc | 23 | ||||
-rw-r--r-- | program/steps/settings/func.inc | 37 | ||||
-rw-r--r-- | program/steps/settings/responses.inc | 2 | ||||
-rw-r--r-- | program/steps/settings/save_identity.inc | 4 | ||||
-rw-r--r-- | program/steps/settings/save_prefs.inc | 28 |
9 files changed, 56 insertions, 47 deletions
diff --git a/program/steps/settings/edit_folder.inc b/program/steps/settings/edit_folder.inc index fc6b2cd16..6b7bd08d2 100644 --- a/program/steps/settings/edit_folder.inc +++ b/program/steps/settings/edit_folder.inc @@ -139,6 +139,7 @@ function rcmail_folder_form($attrib) 'unsubscribed' => true, 'skip_noinferiors' => true, 'exceptions' => $exceptions, + 'additional' => strlen($selected) ? array($selected) : null, )); $form['props']['fieldsets']['location']['content']['path'] = array( diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc index f208c8a05..3f7b6a58a 100644 --- a/program/steps/settings/edit_identity.inc +++ b/program/steps/settings/edit_identity.inc @@ -71,7 +71,7 @@ function rcube_identity_form($attrib) $RCMAIL->html_editor('identity'); // add some labels to client - $OUTPUT->add_label('noemailwarning', 'nonamewarning', 'converting', 'editorwarning'); + $OUTPUT->add_label('noemailwarning', 'converting', 'editorwarning'); $i_size = !empty($attrib['size']) ? $attrib['size'] : 40; $t_rows = !empty($attrib['textarearows']) ? $attrib['textarearows'] : 6; diff --git a/program/steps/settings/edit_prefs.inc b/program/steps/settings/edit_prefs.inc index 05f4db6a6..b72c3e73f 100644 --- a/program/steps/settings/edit_prefs.inc +++ b/program/steps/settings/edit_prefs.inc @@ -51,6 +51,10 @@ function rcmail_user_prefs_form($attrib) $out = $form_start; + if(!empty($SECTIONS[$CURR_SECTION]['header'])) { + $out .= html::div(array('id' => 'preferences-header', 'class' =>'boxcontent'), $SECTIONS[$CURR_SECTION]['header']); + } + foreach ($SECTIONS[$CURR_SECTION]['blocks'] as $class => $block) { if (!empty($block['options'])) { $table = new html_table(array('cols' => 2)); diff --git a/program/steps/settings/edit_response.inc b/program/steps/settings/edit_response.inc index 760f28290..6d3c3dc41 100644 --- a/program/steps/settings/edit_response.inc +++ b/program/steps/settings/edit_response.inc @@ -35,7 +35,7 @@ if (($key = rcube_utils::get_input_value('_key', rcube_utils::INPUT_GPC))) { // save response if ($RCMAIL->action == 'save-response' && isset($_POST['_name']) && !$RESPONSE_RECORD['static']) { $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST)); - $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST)); + $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST, true)); if (!empty($name) && !empty($text)) { $dupes = 0; diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc index b09ea03ce..1bcfb4cfc 100644 --- a/program/steps/settings/folders.inc +++ b/program/steps/settings/folders.inc @@ -45,7 +45,7 @@ if ($RCMAIL->action == 'subscribe') { 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); } @@ -221,16 +221,15 @@ function rcube_subscription_form($attrib) // 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) { @@ -291,7 +290,7 @@ function rcube_subscription_form($attrib) $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'); @@ -368,7 +367,7 @@ function rcube_subscription_form($attrib) $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; diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 7c36df3b1..4b4575f10 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -346,6 +346,7 @@ function rcmail_user_prefs($current = null) $license_link = $meta['license-url'] ? html::a(array('href' => $meta['license-url'], 'target' => '_blank'), rcube::Q($meta['license'])) : rcube::Q($meta['license']); } + $skinnames[] = mb_strtolower($skinname); $blocks['skin']['options'][$skin]['content'] = html::label(array('class' => 'skinselection'), html::span('skinitem', $input->show($config['skin'], array('value' => $skin, 'id' => $field_id.$skin))) . html::span('skinitem', html::img(array('src' => $thumbnail, 'class' => 'skinthumbnail', 'alt' => $skin, 'width' => 64, 'height' => 64))) . @@ -354,6 +355,7 @@ function rcmail_user_prefs($current = null) html::span('skinlicense', $license_link ? $RCMAIL->gettext('license').': ' . $license_link : '')) ); } + array_multisort($blocks['skin']['options'], SORT_ASC, SORT_STRING, $skinnames); } } @@ -376,13 +378,16 @@ function rcmail_user_prefs($current = null) if ($current) { $product_name = $RCMAIL->config->get('product_name', 'Roundcube Webmail'); $RCMAIL->output->add_script(sprintf("%s.check_protocol_handler('%s', '#mailtoprotohandler');", - rcmail_output::JS_OBJECT_NAME, rcube::JQ($product_name)), 'foot'); + rcmail_output::JS_OBJECT_NAME, rcube::JQ($product_name)), 'docready'); } $blocks['browser']['options']['mailtoprotohandler'] = array( 'content' => html::a(array( - 'href' => '#', - 'id' => 'mailtoprotohandler'), rcube::Q($RCMAIL->gettext('mailtoprotohandler'))), + 'href' => '#', + 'id' => 'mailtoprotohandler' + ), + rcube::Q($RCMAIL->gettext('mailtoprotohandler'))) . + html::span('mailtoprotohandler-status', ''), ); break; @@ -1032,7 +1037,8 @@ function rcmail_user_prefs($current = null) } // Configure special folders - if (!isset($no_override['default_folders']) && $current) { + $set = array('drafts_mbox', 'sent_mbox', 'junk_mbox', 'trash_mbox'); + if ($current && count(array_intersect($no_override, $set)) < 4) { $select = $RCMAIL->folder_selector(array( 'noselection' => '---', 'realnames' => true, @@ -1040,10 +1046,10 @@ function rcmail_user_prefs($current = null) 'folder_filter' => 'mail', 'folder_rights' => 'w', )); - } - // #1486114, #1488279, #1489219 - $onchange = "if ($(this).val() == 'INBOX') $(this).val('')"; + // #1486114, #1488279, #1489219 + $onchange = "if ($(this).val() == 'INBOX') $(this).val('')"; + } if (!isset($no_override['drafts_mbox'])) { if (!$current) { @@ -1235,6 +1241,13 @@ function rcmail_user_prefs($current = null) $sections[$idx]['blocks'] = $data['blocks']; } + $data = $RCMAIL->plugins->exec_hook('preferences_section_header', + array('section' => $sect['id'], 'header' => '', 'current' => $current)); + + if(!empty($data['header'])) { + $sections[$idx]['header'] = $data['header']; + } + return array($sections, $plugin['cols']); } @@ -1284,13 +1297,11 @@ function rcmail_update_folder_row($name, $oldname=null, $subscribe=false, $class { global $RCMAIL, $OUTPUT; - $default_folders = (array) $RCMAIL->config->get('default_folders'); $protect_folders = $RCMAIL->config->get('protect_default_folders'); - - $storage = $RCMAIL->get_storage(); - $delimiter = $storage->get_hierarchy_delimiter(); - $name_utf8 = rcube_charset::convert($name, 'UTF7-IMAP'); - $protected = $protect_folders && in_array($name, $default_folders); + $storage = $RCMAIL->get_storage(); + $delimiter = $storage->get_hierarchy_delimiter(); + $name_utf8 = rcube_charset::convert($name, 'UTF7-IMAP'); + $protected = $protect_folders && $storage->is_special_folder($name); $foldersplit = explode($delimiter, $storage->mod_folder($name)); $level = count($foldersplit) - 1; diff --git a/program/steps/settings/responses.inc b/program/steps/settings/responses.inc index 35a2a1b64..06093b3b8 100644 --- a/program/steps/settings/responses.inc +++ b/program/steps/settings/responses.inc @@ -22,7 +22,7 @@ if (!empty($_POST['_insert'])) { $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST)); - $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST)); + $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST, true)); if (!empty($name) && !empty($text)) { $dupes = 0; diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc index 1584c5f00..77245b988 100644 --- a/program/steps/settings/save_identity.inc +++ b/program/steps/settings/save_identity.inc @@ -26,8 +26,8 @@ $a_boolean_cols = array('standard', 'html_signature'); $updated = $default_id = false; // check input -if (IDENTITIES_LEVEL != 4 && (empty($_POST['_name']) || (empty($_POST['_email']) && IDENTITIES_LEVEL != 1 && IDENTITIES_LEVEL != 3))) { - $OUTPUT->show_message('formincomplete', 'warning'); +if (empty($_POST['_email']) && (IDENTITIES_LEVEL == 0 || IDENTITIES_LEVEL == 2)) { + $OUTPUT->show_message('noemailwarning', 'warning'); $RCMAIL->overwrite_action('edit-identity'); return; } diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index f71eee39a..7a17f21f4 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -121,12 +121,12 @@ case 'server': case 'folders': $a_user_prefs = array( 'show_real_foldernames' => isset($_POST['_show_real_foldernames']) ? true : false, - 'drafts_mbox' => rcube_utils::get_input_value('_drafts_mbox', rcube_utils::INPUT_POST, true), - 'sent_mbox' => rcube_utils::get_input_value('_sent_mbox', rcube_utils::INPUT_POST, true), - 'junk_mbox' => rcube_utils::get_input_value('_junk_mbox', rcube_utils::INPUT_POST, true), - 'trash_mbox' => rcube_utils::get_input_value('_trash_mbox', rcube_utils::INPUT_POST, true), ); + foreach (rcube_storage::$folder_types as $type) { + $a_user_prefs[$type . '_mbox'] = rcube_utils::get_input_value('_' . $type . '_mbox', rcube_utils::INPUT_POST, true); + }; + break; } @@ -191,21 +191,15 @@ case 'addressbook': break; case 'folders': - // special handling for 'default_folders' - if (in_array('default_folders', (array)$CONFIG['dont_override'])) { - foreach (array('drafts_mbox','sent_mbox','junk_mbox','trash_mbox') as $p) { - $a_user_prefs[$p] = $CONFIG[$p]; - } - } - else { - $a_user_prefs['default_folders'] = array('INBOX'); - foreach (array('drafts_mbox','sent_mbox','junk_mbox','trash_mbox') as $p) { - if ($a_user_prefs[$p]) { - $a_user_prefs['default_folders'][] = $a_user_prefs[$p]; - } - } + $storage = $RCMAIL->get_storage(); + $specials = array(); + + foreach (rcube_storage::$folder_types as $type) { + $specials[$type] = $a_user_prefs[$type . '_mbox']; } + $storage->set_special_folders($specials); + break; } |