diff options
author | Chad Little <clittle@users.sourceforge.net> | 2002-11-18 00:52:04 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2002-11-18 00:52:04 +0000 |
commit | b90c1acfc85a5b7f6c544967063d911f3e34ea6b (patch) | |
tree | c37d9c3dff3f2aa9bde1066bbc156d6187520899 | |
parent | a497e2c7646bd65201184a61a8eab40789c328e8 (diff) | |
download | phpicalendar-b90c1acfc85a5b7f6c544967063d911f3e34ea6b.tar.gz phpicalendar-b90c1acfc85a5b7f6c544967063d911f3e34ea6b.tar.bz2 phpicalendar-b90c1acfc85a5b7f6c544967063d911f3e34ea6b.zip |
Added choosing your start day of week.
-rw-r--r-- | functions/init.inc.php | 3 | ||||
-rw-r--r-- | preferences.php | 10 |
2 files changed, 7 insertions, 6 deletions
diff --git a/functions/init.inc.php b/functions/init.inc.php index 5f2c0a8..00d903b 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -17,8 +17,7 @@ if ($HTTP_COOKIE_VARS['phpicalendar']) { $default_cal = $phpicalendar['cookie_calendar']; $default_view = $phpicalendar['cookie_view']; $style_sheet = $phpicalendar['cookie_style']; - // Need to fix this below - #$week_start_day = $phpicalendar['cookie_startday']; + $week_start_day = $phpicalendar['cookie_startday']; } diff --git a/preferences.php b/preferences.php index f2bccc4..d004de6 100644 --- a/preferences.php +++ b/preferences.php @@ -5,6 +5,8 @@ $current_view = "preferences"; $default_view = "$default_view" . ".php"; if ($allow_preferences == 'no') header("Location: $default_view"); $action = $HTTP_GET_VARS['action']; +$startdays = array ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); + if ($action == 'setcookie') { $cookie_language = $HTTP_POST_VARS['cookie_language']; $cookie_calendar = $HTTP_POST_VARS['cookie_calendar']; @@ -164,12 +166,12 @@ include(BASE.'functions/ical_parser.php'); // echo 'Select your start day of week:<br><br>'; print "<select name=\"cookie_startday\" class=\"query_style\">\n"; - $i=1; + $i=0; foreach ($daysofweek_lang as $daysofweek) { - if ($i == "$cookie_startday") { - print "<option value=\"$i\" selected>$daysofweek</option>\n"; + if ($startdays[$i] == "$cookie_startday") { + print "<option value=\"$startdays[$i]\" selected>$daysofweek</option>\n"; } else { - print "<option value=\"$i\">$daysofweek</option>\n"; + print "<option value=\"$startdays[$i]\">$daysofweek</option>\n"; } $i++; } |