fsf changes, meant to be rebased on upstream
[squirrelmail.git] / include / load_prefs.php
index d23bcf989a75669c2a5cbc377b9ccb852d0723de..38ba78d3a6e7041407d4b027a3b84db511467bfd 100644 (file)
@@ -6,7 +6,7 @@
  * Loads preferences from the $username.pref file used by almost
  * every other script in the source directory and alswhere.
  *
- * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @copyright 1999-2022 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -78,6 +78,9 @@ $move_to_trash =
 $save_as_draft =
     getPref($data_dir, $username, 'save_as_draft', $default_save_as_draft);
 
+$mark_as_read_upon_delete =
+    getPref($data_dir, $username, 'mark_as_read_upon_delete', FALSE);
+
 if ($default_unseen_type == '') {
     $default_unseen_type = 1;
 }
@@ -275,9 +278,15 @@ $attachment_common_show_images = getPref($data_dir, $username, 'attachment_commo
 /* message disposition notification support setting */
 $mdn_user_support = getPref($data_dir, $username, 'mdn_user_support', SMPREF_ON);
 
+$do_not_reply_to_self =
+    getPref($data_dir, $username, 'do_not_reply_to_self', SMPREF_OFF);
+
 $include_self_reply_all =
     getPref($data_dir, $username, 'include_self_reply_all', SMPREF_ON);
 
+$return_to_message_after_reply =
+    getPref($data_dir, $username, 'return_to_message_after_reply', SMPREF_OFF);
+
 /* Page selector options */
 $page_selector = getPref($data_dir, $username, 'page_selector', SMPREF_ON);
 $compact_paginator = getPref($data_dir, $username, 'compact_paginator', SMPREF_OFF);
@@ -348,6 +357,7 @@ $truncate_subject = getPref($data_dir, $username, 'truncate_subject', 50);
 $show_recipient_instead = getPref($data_dir, $username, 'show_recipient_instead', SMPREF_OFF);
 
 $delete_prev_next_display = getPref($data_dir, $username, 'delete_prev_next_display', SMPREF_ON);
+$return_to_message_list_after_move = getPref($data_dir, $username, 'return_to_message_list_after_move', SMPREF_ON);
 
 /**
  * Access keys
@@ -396,6 +406,34 @@ $accesskey_folders_purge_trash = getPref($data_dir, $username, 'accesskey_folder
 $accesskey_folders_inbox = getPref($data_dir, $username, 'accesskey_folders_inbox', 'i');
 
 
+$accesskey_options_personal = getPref($data_dir, $username, 'accesskey_options_personal', 'p');
+$accesskey_options_display = getPref($data_dir, $username, 'accesskey_options_display', 'd');
+$accesskey_options_highlighting = getPref($data_dir, $username, 'accesskey_options_highlighting', 'h');
+$accesskey_options_folders = getPref($data_dir, $username, 'accesskey_options_folders', 'f');
+$accesskey_options_index_order = getPref($data_dir, $username, 'accesskey_options_index_order', 'x');
+$accesskey_options_compose = getPref($data_dir, $username, 'accesskey_options_compose', 'e');
+$accesskey_options_accessibility = getPref($data_dir, $username, 'accesskey_options_accessibility', 'a');
+
+
+$accesskey_mailbox_previous = getPref($data_dir, $username, 'accesskey_mailbox_previous', 'p');
+$accesskey_mailbox_next = getPref($data_dir, $username, 'accesskey_mailbox_next', 'n');
+$accesskey_mailbox_all_paginate = getPref($data_dir, $username, 'accesskey_mailbox_all_paginate', 'a');
+$accesskey_mailbox_thread = getPref($data_dir, $username, 'accesskey_mailbox_thread', 'h');
+$accesskey_mailbox_flag = getPref($data_dir, $username, 'accesskey_mailbox_flag', 'l');
+$accesskey_mailbox_unflag = getPref($data_dir, $username, 'accesskey_mailbox_unflag', 'g');
+$accesskey_mailbox_read = getPref($data_dir, $username, 'accesskey_mailbox_read', 'r');
+$accesskey_mailbox_unread = getPref($data_dir, $username, 'accesskey_mailbox_unread', 'u');
+$accesskey_mailbox_forward = getPref($data_dir, $username, 'accesskey_mailbox_forward', 'f');
+$accesskey_mailbox_delete = getPref($data_dir, $username, 'accesskey_mailbox_delete', 'd');
+$accesskey_mailbox_expunge = getPref($data_dir, $username, 'accesskey_mailbox_expunge', 'x');
+$accesskey_mailbox_undelete = getPref($data_dir, $username, 'accesskey_mailbox_undelete', 'e');
+$accesskey_mailbox_bypass_trash = getPref($data_dir, $username, 'accesskey_mailbox_bypass_trash', 'b');
+$accesskey_mailbox_move_to = getPref($data_dir, $username, 'accesskey_mailbox_move_to', 't');
+$accesskey_mailbox_move = getPref($data_dir, $username, 'accesskey_mailbox_move', 'm');
+$accesskey_mailbox_copy = getPref($data_dir, $username, 'accesskey_mailbox_copy', 'y');
+$accesskey_mailbox_toggle_selected = getPref($data_dir, $username, 'accesskey_mailbox_toggle_selected', 's');
+
+
 /**
  * Height of iframe that displays html formated emails
  * @since 1.5.1
@@ -476,16 +514,20 @@ $oTemplate = Template::construct_template($sTemplateID);
 // need to adjust $chosen_theme path with SM_PATH 
 $chosen_theme_path = preg_replace("/(\.\.\/){1,}/", SM_PATH, $chosen_theme_path);
 $found_theme = false;
-while (!$found_theme && (list($index, $data) = each($user_themes))) {
-    if ($data['PATH'] == $chosen_theme_path)
+foreach ($user_themes as $data) {
+    if ($data['PATH'] == $chosen_theme_path) {
         $found_theme = true;
+        break;
+    }
 }
 
 if (!$found_theme) {
     $template_themes = $oTemplate->get_alternative_stylesheets(true);
-    while (!$found_theme && (list($path, $name) = each($template_themes))) {
-        if ($path == $chosen_theme_path)
+    foreach ($template_themes as $path => $name) {
+        if ($path == $chosen_theme_path) {
             $found_theme = true;
+            break;
+        }
     }
 }