Browse Source

For not error Undefined property: stdClass::$MAIN_AGENDA_EXPORT_CACHE

tysauron 9 years ago
parent
commit
f8f50b3071
1 changed files with 6 additions and 4 deletions
  1. 6 4
      htdocs/core/lib/xcal.lib.php

+ 6 - 4
htdocs/core/lib/xcal.lib.php

@@ -59,12 +59,14 @@ function build_calfile($format,$title,$desc,$events_array,$outputfile)
 		fwrite($calfileh,"CALSCALE:GREGORIAN\n");
 		fwrite($calfileh,"X-WR-CALNAME:".$encoding.format_cal($format,$title)."\n");
         fwrite($calfileh,"X-WR-CALDESC:".$encoding.format_cal($format,$desc)."\n");
-        $hh=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'hour');
-        $mm=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'min');
-        $ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec');
         //fwrite($calfileh,"X-WR-TIMEZONE:Europe/Paris\n");
         if (! empty($conf->global->MAIN_AGENDA_EXPORT_CACHE)
-        && $conf->global->MAIN_AGENDA_EXPORT_CACHE > 60) fwrite($calfileh,"X-PUBLISHED-TTL: P".$hh."H".$mm."M".$ss."S\n");
+        && $conf->global->MAIN_AGENDA_EXPORT_CACHE > 60){
+	        $hh=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'hour');
+	        $mm=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'min');
+	        $ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec'); 
+	        fwrite($calfileh,"X-PUBLISHED-TTL: P".$hh."H".$mm."M".$ss."S\n");
+        }
 
 		foreach ($events_array as $date => $event)
 		{