diff options
author | Jim Hu <jimhu@users.sourceforge.net> | 2006-03-18 01:27:30 +0000 |
---|---|---|
committer | Jim Hu <jimhu@users.sourceforge.net> | 2006-03-18 01:27:30 +0000 |
commit | 15d8a32270cdbd6ae9add40649de47fabfe8f65c (patch) | |
tree | 80e52e05813a0a95e9f0799d2c9a08606740815d | |
parent | 823e3a72f60962da591ef54b4bf93f4168884177 (diff) | |
download | phpicalendar-15d8a32270cdbd6ae9add40649de47fabfe8f65c.tar.gz phpicalendar-15d8a32270cdbd6ae9add40649de47fabfe8f65c.tar.bz2 phpicalendar-15d8a32270cdbd6ae9add40649de47fabfe8f65c.zip |
fix display_calendarnames to use names from ics files instead of filenames
-rw-r--r-- | functions/ical_parser.php | 5 | ||||
-rw-r--r-- | functions/init.inc.php | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php index 8b26468..cd31b72 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -96,7 +96,7 @@ if ($parse_file) { } $calnumber = 1; -foreach ($cal_filelist as $filename) { +foreach ($cal_filelist as $cal_key=>$filename) { // Find the real name of the calendar. $actual_calname = getCalendarName($filename); @@ -1030,6 +1030,7 @@ foreach ($cal_filelist as $filename) { case 'X-WR-CALNAME': $actual_calname = $data; $master_array['calendar_name'] = $actual_calname; + $cal_displaynames[$cal_key] = $actual_calname; #correct the default calname based on filename break; case 'X-WR-TIMEZONE': $calendar_tz = $data; @@ -1127,7 +1128,7 @@ if ($parse_file) { if ($cal == $ALL_CALENDARS_COMBINED) { $calendar_name = $all_cal_comb_lang; } - +$cal_displayname = implode(', ', $cal_displaynames); #reset this with the correct names $template_started = getmicrotime(); ?> diff --git a/functions/init.inc.php b/functions/init.inc.php index 9392115..3cc3890 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -30,11 +30,11 @@ if ($calendar_path == '') { $calendar_path = BASE.'calendars'; } $cpath = ''; #initialize cpath to prevent later undef warnings. -if(isset($_REQUEST['cpath'])){ +if(isset($_REQUEST['cpath'])&& $_REQUEST['cpath'] !=''){ $cpath = str_replace('..','',$_REQUEST['cpath']); $calendar_path .= "/$cpath"; $tmp_dir .= "/$cpath"; -}elseif(isset($default_cpath_check)){ +}elseif(isset($default_cpath_check) && $default_cpath_check !='' ){ $cpath = str_replace('..','',$default_cpath_check); $calendar_path .= "/$cpath"; $tmp_dir .= "/$cpath"; |