X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Foptions_display.php;h=22254bbf13d7f83dc8b8784161c65f4f1a015381;hb=174a32e0b5afca8b1bae89d7e1b81fba1bfbc339;hp=0882b7ef16b9c0cac7627ac1973d21cf5050ddba;hpb=a13cf2438e11aca61e111ee4ef7715a45ba2069f;p=squirrelmail.git diff --git a/src/options_display.php b/src/options_display.php index 0882b7ef..22254bbf 100644 --- a/src/options_display.php +++ b/src/options_display.php @@ -10,251 +10,215 @@ ** $Id$ **/ - include('../src/validate.php'); - include('../functions/display_messages.php'); - include('../functions/imap.php'); - include('../functions/array.php'); - include('../functions/plugin.php'); - + require_once('../src/validate.php'); + require_once('../functions/display_messages.php'); + require_once('../functions/imap.php'); + require_once('../functions/array.php'); + require_once('../functions/plugin.php'); + require_once('../functions/options.php'); + displayPageHeader($color, 'None'); - $chosen_language = getPref($data_dir, $username, 'language'); + $language = getPref($data_dir, $username, 'language'); ?>
-
+
- -
+ +

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \n"; + + OptionSubmit( 'submit_display' ); ?> - >    - >
- - - - - - - - - - - - - - +
: - -'; -?> -
: - -'; - if (! $use_gettext) - echo '
This system doesn\'t support multiple languages'; - -?> -
  - '; - if ($use_javascript_addr_book == true) { - echo ' ' . _("JavaScript") . '    '; - echo ' ' . _("HTML"); - } else { - echo ' ' . _("JavaScript") . '    '; - echo ' ' . _("HTML"); - } - ?> -
: - -
'; - else - echo '
'; -?> -
: - -
'; - else - echo '
'; -?> -
: - -= 10 && $editor_size <= 255) - echo '
'; - else - echo '
'; -?> -
: -
: -
: - ' . "\n"; - for ($i = 100; $i <= 300; $i += 10) - { - if ($left_size >= $i && $left_size < $i + 10) - echo "
: - -'; - - if ($left_refresh == '') - $left_refresh = 'None'; - if ($left_refresh > 600) - $left_refresh = 600; - RefreshOption($left_refresh, '', 'None', _("None")); - RefreshOption($left_refresh, 30); - RefreshOption($left_refresh, 60); - RefreshOption($left_refresh, 120); - RefreshOption($left_refresh, 180); - RefreshOption($left_refresh, 300); - RefreshOption($left_refresh, 600); - // Refreshes after the session auto-timeout (default 15 min) is pointless - -function RefreshOption(&$current, $val, $str = '') { - static $lastVal = 0; - - if (is_int($val) && is_int($current)) { - if ($current > $lastVal && $current <= $val) - $current = $val; - } - - if ($str == '') { - if ($val > 60) { - $str = ($val / 60) . ' ' . _("Minutes"); - } elseif ($val == 60) { - $str = '1 ' . _("Minute"); - } else { - $str = $val . ' ' . _("Seconds"); - } - } - - echo '
- - - $theme_attributes) { + $theme_values[$theme_attributes['PATH']] = $theme_attributes['NAME']; } + $optvals[SMOPT_GRP_GENERAL][] = array( + 'name' => 'chosen_theme', + 'caption' => _("Theme"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_ALL, + 'posvals' => $theme_values + ); + + $language_values = array(); + foreach ($languages as $lang_key => $lang_attributes) { + if (isset($lang_attributes['NAME'])) { + $language_values[$lang_key] = $lang_attributes['NAME']; + } + } + $optvals[SMOPT_GRP_GENERAL][] = array( + 'name' => 'language', + 'caption' => _("Language"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_ALL, + 'posvals' => $language_values + ); + + /* Set values for the "use javascript" option. */ + $optvals[SMOPT_GRP_GENERAL][] = array( + 'name' => 'javascript_setting', + 'caption' => _("Use Javascript"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_ALL, + 'posvals' => array(SMPREF_JS_AUTODETECT => _("Autodetect"), + SMPREF_JS_ON => _("Always"), + SMPREF_JS_OFF => _("Never")) + ); + + $js_autodetect_results = SMPREF_JS_OFF; + $optvals[SMOPT_GRP_GENERAL][] = array( + 'name' => 'js_autodetect_results', + 'caption' => '', + 'type' => SMOPT_TYPE_HIDDEN, + 'refresh' => SMOPT_REFRESH_NONE + ); + + /*** Load the General Options into the array ***/ + $optgrps[SMOPT_GRP_MAILBOX] = _("Mailbox Display Options"); + $optvals[SMOPT_GRP_MAILBOX] = array(); + + $optvals[SMOPT_GRP_MAILBOX][] = array( + 'name' => 'show_num', + 'caption' => _("Number of Messages to Index"), + 'type' => SMOPT_TYPE_INTEGER, + 'refresh' => SMOPT_REFRESH_NONE, + 'size' => SMOPT_SIZE_TINY + ); + + $optvals[SMOPT_GRP_MAILBOX][] = array( + 'name' => 'alt_index_colors', + 'caption' => _("Enable Alternating Row Colors"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); + + $optvals[SMOPT_GRP_MAILBOX][] = array( + 'name' => 'page_selector', + 'caption' => _("Enable Page Selector"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); + + $optvals[SMOPT_GRP_MAILBOX][] = array( + 'name' => 'page_selector_max', + 'caption' => _("Maximum Number of Pages to Show"), + 'type' => SMOPT_TYPE_INTEGER, + 'refresh' => SMOPT_REFRESH_NONE, + 'size' => SMOPT_SIZE_TINY + ); + + /*** Load the General Options into the array ***/ + $optgrps[SMOPT_GRP_MESSAGE] = _("Message Display and Composition"); + $optvals[SMOPT_GRP_MESSAGE] = array(); + + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'wrap_at', + 'caption' => _("Wrap Incoming Text At"), + 'type' => SMOPT_TYPE_INTEGER, + 'refresh' => SMOPT_REFRESH_NONE, + 'size' => SMOPT_SIZE_TINY + ); + + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'editor_size', + 'caption' => _("Size of Editor Window"), + 'type' => SMOPT_TYPE_INTEGER, + 'refresh' => SMOPT_REFRESH_NONE, + 'size' => SMOPT_SIZE_TINY + ); + + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'location_of_buttons', + 'caption' => _("Location of Buttons when Composing"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => array(SMPREF_LOC_TOP => _("Before headers"), + SMPREF_LOC_BETWEEN => _("Between headers and message body"), + SMPREF_LOC_BOTTOM => _("After message body")) + ); + + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'use_javascript_addr_book', + 'caption' => _("Addressbook Display Format"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => array('1' => _("Javascript"), + '0' => _("HTML")) + ); + + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'show_html_default', + 'caption' => _("Show HTML Version by Default"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); + + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'include_self_reply_all', + 'caption' => _("Include Me in CC when I Reply All"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); + + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'show_xmailer_default', + 'caption' => _("Enable Mailer Display"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); + + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'attachment_common_show_images', + 'caption' => _("Enable display of images with email, below attachment box"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); + + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'pf_subtle_link', + 'caption' => _("Printer Friendly: Subtle Link"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); + + $optvals[SMOPT_GRP_MESSAGE][] = array( + 'name' => 'pf_cleandisplay', + 'caption' => _("Printer Friendly: Clean Display"), + '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 "
 
- : - - > - -
- : - - > - -
  - - "name="submit_display"> -
@@ -263,6 +227,10 @@ echo _("Don't remove me from the CC addresses when I use \"Reply All\"");
+ +