X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Foptions.php;h=facbe529f2cfebd483d3a30098e589ce4dbfc63b;hb=54156b1cfd60ef726191e2209fbd4306a980a03c;hp=f07752e25a2efcbbe8e46e682d3fc4c67873db80;hpb=457e85930298524fc08003d262c71ab621470ab4;p=squirrelmail.git diff --git a/src/options.php b/src/options.php index f07752e2..facbe529 100644 --- a/src/options.php +++ b/src/options.php @@ -6,13 +6,16 @@ * Displays the options page. Pulls from proper user preference files * and config.php. Displays preferences as selected and other options. * - * @copyright © 1999-2006 The SquirrelMail Project Team + * @copyright © 1999-2007 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. */ @@ -40,17 +43,42 @@ 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) { + + /* Special case: need to make sure emailaddress + * is saved if we use it as a test for ask_user_info */ + global $ask_user_info; + if ( $optpage = SMOPT_PAGE_PERSONAL && $ask_user_info && + $option->name == 'email_address' ) { + $option->setValue(''); + } + /* Remove Debug Mode Until Needed echo "name = '$option->name', " . "value = '$option->value', " . "new_value = '$option->new_value'\n"; +//FIXME: NO HTML IN THE CORE! echo "
"; */ if ($option->changed()) { @@ -186,6 +214,7 @@ if (isset($optpage_name) && ($optpage_name != '')) { /* DO OLD SAVING OF SUBMITTED OPTIONS. THIS WILL BE REMOVED LATER. */ /*******************************************************************/ +//FIXME: let's remove these finally in 1.5.2..... but first, are there any plugins using them? /* If in submit mode, select a save hook name and run it. */ if ($optmode == SMOPT_MODE_SUBMIT) { /* Select a save hook name. */ @@ -226,7 +255,7 @@ if ($optmode == SMOPT_MODE_SUBMIT) { /* Finally, display whatever page we are supposed to show now. */ /***************************************************************/ -displayPageHeader($color, 'None', (isset($optpage_data['xtra']) ? $optpage_data['xtra'] : '')); +displayPageHeader($color, null, (isset($optpage_data['xtra']) ? $optpage_data['xtra'] : '')); /* * The main option page has a different layout then the rest of the option @@ -243,6 +272,7 @@ if ($optpage == SMOPT_PAGE_MAIN) { } if (isset($optpage_save_error) && $optpage_save_error!=array()) { +//FIXME: REMOVE HTML FROM CORE $notice = _("Error(s) occurred while saving your options") . "
\n