Update of /cvsroot/phpicalendar/phpicalendar/functions
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1143/functions
Modified Files:
calendar_functions.php
Log Message:
Fix default selections in display_ical_list()
Index: calendar_functions.php
===================================================================
RCS file: /cvsroot/phpicalendar/phpicalendar/functions/calendar_functions.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** calendar_functions.php 26 Jan 2009 03:27:30 -0000 1.36
--- calendar_functions.php 5 Jun 2009 14:20:40 -0000 1.37
***************
*** 188,191 ****
--- 188,192 ----
// Print each calendar option.
$return = '';
+ $all_cals = true;
foreach ($cals as $cal_tmp) {
// Format the calendar path for display.
***************
*** 245,248 ****
--- 246,253 ----
$cal_encoded_tmp = md5($phpiCal_config->salt.$cal_tmp);;
}
+
+ // Try to detect unselected calendars
+ if (!in_array($cal_encoded_tmp, explode(",", $cal))) $all_cals = false;
+
// Display the option.
//
***************
*** 257,272 ****
}
} else {
! $cal_httpPrefix_tmp = str_replace('webcal://', 'http://', $cal_tmp);
! if ($cal_encoded_tmp == urldecode($cal)) {
! $return .= "<option value=\"$current_view.php?cal=$cal_encoded_tmp&getdate=$getdate\" selected=\"selected\">$cal_displayname_tmp</option>";
! } else {
! $return .= "<option value=\"$current_view.php?cal=$cal_encoded_tmp&getdate=$getdate\">$cal_displayname_tmp</option>";
}
- }
}
// option to open all (non-web) calenders together
if (!$pick) {
! if ($cal == $phpiCal_config->ALL_CALENDARS_COMBINED) {
$return .= "<option value=\"$current_view.php?cal=$phpiCal_config->ALL_CALENDARS_COMBINED&getdate=$getdate\" selected=\"selected\">$all_cal_comb_lang</option>";
} else {
--- 262,277 ----
}
} else {
! $cal_httpPrefix_tmp = str_replace('webcal://', 'http://', $cal_tmp);
! if ($cal_encoded_tmp == $cal || $cal_encoded_tmp == urldecode($cal)) {
! $return .= "<option value=\"$current_view.php?cal=$cal_encoded_tmp&getdate=$getdate\" selected=\"selected\">$cal_displayname_tmp</option>";
! } else {
! $return .= "<option value=\"$current_view.php?cal=$cal_encoded_tmp&getdate=$getdate\">$cal_displayname_tmp</option>";
! }
}
}
// option to open all (non-web) calenders together
if (!$pick) {
! if ($all_cals || $cal == $phpiCal_config->ALL_CALENDARS_COMBINED) {
$return .= "<option value=\"$current_view.php?cal=$phpiCal_config->ALL_CALENDARS_COMBINED&getdate=$getdate\" selected=\"selected\">$all_cal_comb_lang</option>";
} else {
***************
*** 274,277 ****
--- 279,283 ----
}
}
+
return $return;
}
\ No newline at end of file
|