aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorJason Oster <parasytic@users.sourceforge.net>2009-06-22 22:09:27 +0000
committerJason Oster <parasytic@users.sourceforge.net>2009-06-22 22:09:27 +0000
commit710abd276f9720e6e5b049c64d0aac5a2cc198d5 (patch)
treeabfdcdd875130ebb0cac00c0997fa281db8a3313 /functions
parente7f5b8949811e7f6497083204e050dab98f8b782 (diff)
downloadphpicalendar-710abd276f9720e6e5b049c64d0aac5a2cc198d5.tar.gz
phpicalendar-710abd276f9720e6e5b049c64d0aac5a2cc198d5.tar.bz2
phpicalendar-710abd276f9720e6e5b049c64d0aac5a2cc198d5.zip
Fix for "All Calendars Combined" in dropdown menu with only one calendar available
Diffstat (limited to 'functions')
-rw-r--r--functions/calendar_functions.php9
1 files changed, 6 insertions, 3 deletions
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 .= "<option value=\"$cal_encoded_tmp\" selected=\"selected\">$cal_displayname_tmp</option>\n";
+ $return .= "<option value=\"$cal_encoded_tmp\" selected=\"selected\">$cal_displayname_tmp</option>\n";
} else {
- $return .= "<option value=\"$cal_encoded_tmp\">$cal_displayname_tmp</option>\n";
+ $return .= "<option value=\"$cal_encoded_tmp\">$cal_displayname_tmp</option>\n";
}
} else {
$cal_httpPrefix_tmp = str_replace('webcal://', 'http://', $cal_tmp);

© 2014-2022 Faster IT GmbH | imprint | privacy policy