diff options
author | Wesley Miaw <josuah@users.sourceforge.net> | 2005-11-24 04:28:34 +0000 |
---|---|---|
committer | Wesley Miaw <josuah@users.sourceforge.net> | 2005-11-24 04:28:34 +0000 |
commit | f327c0bbc3252553eea7f66db88e031554a3fe11 (patch) | |
tree | 46429b537a40d1cdae77f144374de5236860bbe7 /functions/calendar_functions.php | |
parent | e2ef86112facc0b3988308397ce6c70b76f9786a (diff) | |
download | phpicalendar-f327c0bbc3252553eea7f66db88e031554a3fe11.tar.gz phpicalendar-f327c0bbc3252553eea7f66db88e031554a3fe11.tar.bz2 phpicalendar-f327c0bbc3252553eea7f66db88e031554a3fe11.zip |
Fixed support for multiple selection web calendars. You can now select
multiple local and web calendars, in any number and combination. The
calendar name will also be displayed correctly, instead of only
displaying a single calendar name when multiple calendars are chosen.
Diffstat (limited to 'functions/calendar_functions.php')
-rw-r--r-- | functions/calendar_functions.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/functions/calendar_functions.php b/functions/calendar_functions.php index 1281f95..a587d2c 100644 --- a/functions/calendar_functions.php +++ b/functions/calendar_functions.php @@ -30,6 +30,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) if (isset($locked_map["$username:$password"])) { $unlocked_cals = $locked_map["$username:$password"]; } + // Make a local copy of the requested calendars. if (!is_array($cal_filename)) $cal_filename_local = array($cal_filename); @@ -43,7 +44,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) $search_paths = array($calendar_path); // Add web calendars. - if ($cal_filename == $ALL_CALENDARS_COMBINED || $admin) { + if ($cal_filename_local[0] == $ALL_CALENDARS_COMBINED || $admin) { if (!isset($http_user) && !$admin) { foreach ($list_webcals as $file) { // Make sure the URL ends with .ics. @@ -56,7 +57,7 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) } // Set some booleans that will dictate our search. - $find_all = ($cal_filename == $ALL_CALENDARS_COMBINED || $admin); + $find_all = ($cal_filename_local[0] == $ALL_CALENDARS_COMBINED || $admin); // Process all search paths. while (!empty($search_paths)) { @@ -76,9 +77,9 @@ function availableCalendars($username, $password, $cal_filename, $admin = false) if ($find_all || $recursive_path == 'yes' || $support_ical == 'yes') { // Open the directory. $dir_handle = @opendir($search_path) - or die(error(sprintf($lang['l_error_path'], $search_path), $cal_filename)); + or die(error(sprintf($lang['l_error_path'], $search_path), implode(',', $cal_filename))); if ($dir_handle === false) - die(error(sprintf($lang['l_error_path'], $search_path), $cal_filename)); + die(error(sprintf($lang['l_error_path'], $search_path), implode(',', $cal_filename))); // Add each file in the directory that does not begin with a dot. while (false !== ($file = readdir($dir_handle))) { |