From 710abd276f9720e6e5b049c64d0aac5a2cc198d5 Mon Sep 17 00:00:00 2001 From: Jason Oster Date: Mon, 22 Jun 2009 22:09:27 +0000 Subject: Fix for "All Calendars Combined" in dropdown menu with only one calendar available --- functions/calendar_functions.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'functions') diff --git a/functions/calendar_functions.php b/functions/calendar_functions.php index 2c5cd69..80bab71 100644 --- a/functions/calendar_functions.php +++ b/functions/calendar_functions.php @@ -187,7 +187,10 @@ function display_ical_list($cals, $pick=FALSE) { global $cal, $current_view, $getdate, $lang, $calendar_lang, $all_cal_comb_lang, $cal_filelist, $cal_displaynames, $list_webcals, $phpiCal_config; // Print each calendar option. $return = ''; - $all_cals = true; + + $all_cals = false; + if (count($cals) > 1) $all_cals = true; + foreach ($cals as $cal_tmp) { // Format the calendar path for display. // @@ -256,9 +259,9 @@ function display_ical_list($cals, $pick=FALSE) { // trying to figure out if this is the selected calendar. if($pick) { if (in_array($cal_encoded_tmp, explode(",", $cal)) || count($cals) == count(explode(",", $cal))) { - $return .= "\n"; + $return .= "\n"; } else { - $return .= "\n"; + $return .= "\n"; } } else { $cal_httpPrefix_tmp = str_replace('webcal://', 'http://', $cal_tmp); -- cgit v1.2.3