From b8e244056c990c65a859c1252785ffa7f62fc4a8 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Sat, 20 Dec 2008 04:24:42 +0000 Subject: misc error warnings and notices --- preferences.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'preferences.php') diff --git a/preferences.php b/preferences.php index 5d1b114..5bfaad3 100644 --- a/preferences.php +++ b/preferences.php @@ -1,16 +1,16 @@ allow_preferences != 'yes') { exit(error('Preferences are not available for this installation.', $cal)); } $current_view = "preferences"; -$back_page = BASE.$default_view.'.php?cal='.$cal.'&getdate='.$getdate.'&cpath='.$cpath; +$back_page = BASE.$phpiCal_config->default_view.'.php?cal='.$cal.'&getdate='.$getdate.'&cpath='.$cpath; if ($phpiCal_config->allow_preferences == 'no') header("Location: $back_page"); if (isset($_GET['action'])) { @@ -20,7 +20,6 @@ if (isset($_GET['action'])) { } $startdays = array ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); -$cpath = $_REQUEST['cpath']; if ($action == 'setcookie') { $cookie_language = $_POST['cookie_language']; @@ -30,7 +29,7 @@ if ($action == 'setcookie') { $cookie_style = $_POST['cookie_style']; $cookie_startday = $_POST['cookie_startday']; $cookie_time = $_POST['cookie_time']; - $cookie_unset = $_POST['unset']; + $cookie_unset = @$_POST['unset']; $the_cookie = array ("cookie_language" => "$cookie_language", "cookie_calendar" => "$cookie_calendar", "cookie_view" => "$cookie_view", "cookie_startday" => "$cookie_startday", "cookie_style" => "$cookie_style", "cookie_time" => "$cookie_time", "cookie_cpath"=>"$cookie_cpath"); $the_cookie = serialize($the_cookie); if ($cookie_unset) { @@ -85,6 +84,7 @@ if ($action == 'setcookie') { // select for languages $dir_handle = @opendir(BASE.'languages/'); $tmp_pref_language = urlencode(ucfirst($language)); +$language_select = ''; while ($file = readdir($dir_handle)) { if (substr($file, -8) == ".inc.php") { $language_tmp = urlencode(ucfirst(substr($file, 0, -8))); @@ -98,15 +98,16 @@ while ($file = readdir($dir_handle)) { closedir($dir_handle); // select for calendars -$calendar_select = display_ical_list(availableCalendars($username, $password, $ALL_CALENDARS_COMBINED),TRUE); +$calendar_select = display_ical_list(availableCalendars($username, $password, $phpiCal_config->ALL_CALENDARS_COMBINED),TRUE); $calendar_select .=""; $calendar_select = str_replace("' : ''; -$view_select .= ($default_view == 'week') ? '' : ''; -$view_select .= ($default_view == 'month') ? '' : ''; +$view_select = ($phpiCal_config->default_view == 'day') ? '' : ''; +$view_select .= ($phpiCal_config->default_view == 'week') ? '' : ''; +$view_select .= ($phpiCal_config->default_view == 'month') ? '' : ''; // select for time +$time_select = ''; for ($i = 000; $i <= 1200; $i += 100) { $s = sprintf("%04d", $i); $time_select .= ''; @@ -128,6 +130,7 @@ foreach ($daysofweek_lang as $daysofweek) { } $dir_handle = @opendir(BASE.'templates/'); +$style_select = ''; while ($file = readdir($dir_handle)) { if (($file != ".") && ($file != "..") && ($file != "CVS")) { if (is_dir(BASE.'templates/'.$file)) { @@ -152,7 +155,7 @@ $page->replace_tags(array( 'version' => $phpiCal_config->phpicalendar_version, 'charset' => $phpiCal_config->charset, 'template' => $phpiCal_config->template, - 'default_path' => '', + 'default_path' => $phpiCal_config->default_path, 'cpath' => $cpath, 'cal' => $cal, 'getdate' => $getdate, -- cgit v1.2.3