Skip to content

Commit 710abd2

Browse files
author
Jason Oster
committed
Fix for "All Calendars Combined" in dropdown menu with only one calendar available
1 parent e7f5b89 commit 710abd2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

functions/calendar_functions.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ function display_ical_list($cals, $pick=FALSE) {
187187
global $cal, $current_view, $getdate, $lang, $calendar_lang, $all_cal_comb_lang, $cal_filelist, $cal_displaynames, $list_webcals, $phpiCal_config;
188188
// Print each calendar option.
189189
$return = '';
190-
$all_cals = true;
190+
191+
$all_cals = false;
192+
if (count($cals) > 1) $all_cals = true;
193+
191194
foreach ($cals as $cal_tmp) {
192195
// Format the calendar path for display.
193196
//
@@ -256,9 +259,9 @@ function display_ical_list($cals, $pick=FALSE) {
256259
// trying to figure out if this is the selected calendar.
257260
if($pick) {
258261
if (in_array($cal_encoded_tmp, explode(",", $cal)) || count($cals) == count(explode(",", $cal))) {
259-
$return .= "<option value=\"$cal_encoded_tmp\" selected=\"selected\">$cal_displayname_tmp</option>\n";
262+
$return .= "<option value=\"$cal_encoded_tmp\" selected=\"selected\">$cal_displayname_tmp</option>\n";
260263
} else {
261-
$return .= "<option value=\"$cal_encoded_tmp\">$cal_displayname_tmp</option>\n";
264+
$return .= "<option value=\"$cal_encoded_tmp\">$cal_displayname_tmp</option>\n";
262265
}
263266
} else {
264267
$cal_httpPrefix_tmp = str_replace('webcal://', 'http://', $cal_tmp);

0 commit comments

Comments
 (0)