From ac53fb5645d47313e6efe3327b57f0e2a30327c1 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Sat, 21 Apr 2001 20:33:57 +0000 Subject: [PATCH] added option to enable/disable alternating row colors git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1281 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mailbox_display.php | 27 +++++++++++++++++---------- src/load_prefs.php | 8 ++++++++ src/options.php | 6 +++++- src/options_display.php | 21 +++++++++++++++++++-- 4 files changed, 49 insertions(+), 13 deletions(-) diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 750edfdb..a4823676 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -20,15 +20,16 @@ global $message_highlight_list; global $index_order; - if (!isset($GLOBALS["row_count"])) { - $GLOBALS["row_count"] = 0; - } - $GLOBALS["row_count"]++; - if ($GLOBALS["row_count"] % 2) { - if (!isset($color[12])) $color[12] = "#EAEAEA"; - $color_string = $color[12]; - } else { - $color_string = $color[4]; + $color_string = $color[4]; + if ($GLOBALS['alt_index_colors']) { + if (!isset($GLOBALS["row_count"])) { + $GLOBALS["row_count"] = 0; + } + $GLOBALS["row_count"]++; + if ($GLOBALS["row_count"] % 2) { + if (!isset($color[12])) $color[12] = "#EAEAEA"; + $color_string = $color[12]; + } } $msg = $msgs[$key]; @@ -545,7 +546,13 @@ echo ''; echo ""; - echo ""; + echo "
"; echo ""; $urlMailbox=urlencode($mailbox); diff --git a/src/load_prefs.php b/src/load_prefs.php index cc46e8a9..9716a90b 100644 --- a/src/load_prefs.php +++ b/src/load_prefs.php @@ -204,6 +204,14 @@ $index_order[5] = 4; } + global $alt_index_colors; + $alt_index_colors = getPref($data_dir, $username, 'alt_index_colors'); + if ($alt_index_colors === 0) { + $alt_index_colors = false; + } else { + $alt_index_colors = true; + } + global $location_of_bar, $location_of_buttons; $location_of_bar = getPref($data_dir, $username, 'location_of_bar'); diff --git a/src/options.php b/src/options.php index b85c2456..4a29dd90 100644 --- a/src/options.php +++ b/src/options.php @@ -78,6 +78,10 @@ setPref($data_dir, $username, 'location_of_buttons', $button_new_location); setPref($data_dir, $username, 'left_size', $leftsize); setPref($data_dir, $username, 'use_javascript_addr_book', $javascript_abook); + if (isset($altIndexColors) && $altIndexColors == 1) + setPref($data_dir, $username, 'alt_index_colors', 1); + else + setPref($data_dir, $username, 'alt_index_colors', 0); if (isset($showhtmldefault)) setPref($data_dir, $username, 'show_html_default', 1); else @@ -86,7 +90,7 @@ do_hook('options_display_save'); echo '
'._("Successfully saved display preferences!").'
'; - echo '' . _("Refresh Page") . '

'; + echo '' . _("Refresh Page") . '
'; } else if (isset($submit_folder)) { # Save folder preferences if ($trash != 'none') { diff --git a/src/options_display.php b/src/options_display.php index b79c930d..4580e8df 100644 --- a/src/options_display.php +++ b/src/options_display.php @@ -47,7 +47,7 @@ - - + + +
: + :
+ + + + + >    + >
+
: -- 2.25.1