X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Foptions_display.php;h=ccb337dedbdf15e216fea93d75c5298bd0f601e9;hb=cbe5423b30fd1c50b7dd9546778cbebf48804953;hp=edaaf3c4ea123e33cdd26ab7b8dca75d2910de48;hpb=7baf86a911ddc0ef8b2c3f9b9dbaa579f31ab4bc;p=squirrelmail.git diff --git a/src/options_display.php b/src/options_display.php index edaaf3c4..ccb337de 100644 --- a/src/options_display.php +++ b/src/options_display.php @@ -1,37 +1,24 @@ -
- - -
- -
- - -
- -

- - _("Theme"), 'type' => SMOPT_TYPE_STRLIST, 'refresh' => SMOPT_REFRESH_ALL, - 'posvals' => $theme_values + 'posvals' => $theme_values, + 'save' => 'save_option_theme' ); $language_values = array(); @@ -86,12 +71,19 @@ SMPREF_JS_OFF => _("Never")) ); + $js_autodetect_script = " + + "; $js_autodetect_results = SMPREF_JS_OFF; $optvals[SMOPT_GRP_GENERAL][] = array( 'name' => 'js_autodetect_results', 'caption' => '', 'type' => SMOPT_TYPE_HIDDEN, - 'refresh' => SMOPT_REFRESH_NONE + 'refresh' => SMOPT_REFRESH_NONE, + 'script' => $js_autodetect_script, + 'save' => 'save_option_javascript_autodetect' ); /*** Load the General Options into the array ***/ @@ -190,33 +182,70 @@ $optvals[SMOPT_GRP_MESSAGE][] = array( 'name' => 'attachment_common_show_images', - 'caption' => _("Enable display of images with email, below attachment box"), + 'caption' => _("Display Attached Images with Message"), 'type' => SMOPT_TYPE_BOOLEAN, 'refresh' => SMOPT_REFRESH_NONE ); - /* Build and output the option groups. */ - $option_groups = createOptionGroups($optgrps, $optvals); - printOptionGroups($option_groups); - - do_hook('options_display_inside'); - echo "\n"; + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'pf_subtle_link', + 'caption' => _("Enable Subtle Printer Friendly Link"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); - OptionSubmit( 'submit_display' ); -?> + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'pf_cleandisplay', + 'caption' => _("Enable Printer Friendly Clean Display"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); -
 
-
+ /* Assemble all this together and return it as our result. */ + $result = array( + 'grps' => $optgrps, + 'vals' => $optvals + ); + return ($result); +} - +/******************************************************************/ +/** Define any specialized save functions for this option page. ***/ +/******************************************************************/ -
+function save_option_theme($option) { + global $theme; - + /* Do checking to make sure $new_theme is in the array. */ + $theme_in_array = false; + for ($i = 0; $i < count($theme); ++$i) { + if ($theme[$i]['PATH'] == $option->new_value) { + $theme_in_array = true; + break; + } + } + + if (!$theme_in_array) { + $option->new_value = ''; + } -
- + /* Save the option like normal. */ + save_option($option); +} + +function save_option_javascript_autodetect($option) { + global $data_dir, $username, $new_javascript_setting; + + /* Set javascript either on or off. */ + if ($new_javascript_setting == SMPREF_JS_AUTODETECT) { + if ($option->new_value == SMPREF_JS_ON) { + setPref($data_dir, $username, 'javascript_on', SMPREF_JS_ON); + } else { + setPref($data_dir, $username, 'javascript_on', SMPREF_JS_OFF); + } + } else { + setPref($data_dir, $username, 'javascript_on', $new_javascript_setting); + } +} + +?>