X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Foptions.php;h=0d320b21030de7769925de18718df578f9761c7e;hb=24e8917ead46268f6a4264900c832b4a5c37ee84;hp=1bd019a0a07a7cfdfe571a8744f1af12128bd25b;hpb=d6bd1155a1bb6302b71729076b282a07ac1496bd;p=squirrelmail.git
diff --git a/src/options.php b/src/options.php
index 1bd019a0..0d320b21 100644
--- a/src/options.php
+++ b/src/options.php
@@ -1,171 +1,511 @@
-
-
-
-"._("Successfully saved personal information!")."
";
- } else if ($submit_display) {
- # Save display preferences
- setPref($data_dir, $username, "chosen_theme", $chosentheme);
- setPref($data_dir, $username, "show_num", $shownum);
- setPref($data_dir, $username, "wrap_at", $wrapat);
- setPref($data_dir, $username, "editor_size", $editorsize);
- setPref($data_dir, $username, "left_refresh", $leftrefresh);
- setPref($data_dir, $username, "language", $language);
- setPref($data_dir, $username, "left_size", $leftsize);
- setPref($data_dir, $username, "use_javascript_addr_book", $javascript_abook);
+/**
+ * options.php
+ *
+ * Displays the options page. Pulls from proper user preference files
+ * and config.php. Displays preferences as selected and other options.
+ *
+ * @copyright 1999-2020 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage prefs
+ */
+
+/** This is the options page */
+define('PAGE_NAME', 'options');
+
+/**
+ * Include the SquirrelMail initialization file.
+ */
+require('../include/init.php');
+
+/* SquirrelMail required files. */
+
+//include(SM_PATH . 'functions/imap_general.php');
+require_once(SM_PATH . 'functions/options.php');
+require_once(SM_PATH . 'functions/forms.php');
+
+/*********************************/
+/*** Build the resultant page. ***/
+/*********************************/
+
+define('SMOPT_MODE_DISPLAY', 'display');
+define('SMOPT_MODE_SUBMIT', 'submit');
+define('SMOPT_MODE_LINK', 'link');
+
+define('SMOPT_PAGE_MAIN', 'main');
+define('SMOPT_PAGE_PERSONAL', 'personal');
+define('SMOPT_PAGE_DISPLAY', 'display');
+define('SMOPT_PAGE_COMPOSE', 'compose');
+define('SMOPT_PAGE_ACCESSIBILITY', 'accessibility');
+define('SMOPT_PAGE_HIGHLIGHT', 'highlight');
+define('SMOPT_PAGE_FOLDER', 'folder');
+define('SMOPT_PAGE_ORDER', 'order');
+
+/**
+ * Save submitted options and calculate the most
+ * we need to refresh the page
+ *
+ * @param string $optpage The name of the page being submitted
+ * @param array $optpage_data An array of all the submitted options
+ *
+ * @return int The highest level of screen refresh needed per
+ * the options that were changed. This value will
+ * correspond to the SMOPT_REFRESH_* constants found
+ * in functions/options.php.
+ *
+ */
+function process_optionmode_submit($optpage, $optpage_data) {
+ /* Initialize the maximum option refresh level. */
+ $max_refresh = SMOPT_REFRESH_NONE;
+
+
+
+ /* Save each option in each option group. */
+ foreach ($optpage_data['options'] as $option_grp) {
+ foreach ($option_grp['options'] as $option) {
- do_hook("options_display_save");
-
- echo "";
- } else if ($submit_folder) {
- # Save folder preferences
- if ($trash != "none") {
- setPref($data_dir, $username, "move_to_trash", true);
- setPref($data_dir, $username, "trash_folder", $trash);
- } else {
- setPref($data_dir, $username, "move_to_trash", "0");
- setPref($data_dir, $username, "trash_folder", "none");
- }
- if ($sent != "none") {
- setPref($data_dir, $username, "move_to_sent", true);
- setPref($data_dir, $username, "sent_folder", $sent);
- } else {
- setPref($data_dir, $username, "move_to_sent", "0");
- setPref($data_dir, $username, "sent_folder", "none");
- }
- setPref($data_dir, $username, "folder_prefix", $folderprefix);
- setPref($data_dir, $username, "unseen_notify", $unseennotify);
- setPref($data_dir, $username, "unseen_type", $unseentype);
- do_hook("options_folders_save");
- echo "";
- } else {
- do_hook("options_save");
- }
-
-?>
-
-
-
-
-