From 0160a028c2d08e042c6b420c731737f8e508de07 Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 11 Oct 2006 09:21:30 +0000 Subject: [PATCH] fixed wrong } in hotpot_restore_dates() --- mod/hotpot/restorelib.php | 43 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/mod/hotpot/restorelib.php b/mod/hotpot/restorelib.php index 44a5bddf5e..1b1b6713f6 100644 --- a/mod/hotpot/restorelib.php +++ b/mod/hotpot/restorelib.php @@ -482,34 +482,33 @@ function hotpot_restore_logs($restore, $log) { function hotpot_restore_dates($recordtype, &$restore, &$xml, $TAGS, $NAMETAG='NAME') { if (!empty($restore->course_startdateoffset)) { - // check course backup data directory exists - $course_dir = $CFG->dataroot."/".$restore->course_id."/backupdata"; - check_dir_exists($course_dir, true); + // check course backup data directory exists + $course_dir = $CFG->dataroot."/".$restore->course_id."/backupdata"; + check_dir_exists($course_dir, true); - // open $restorelog and start output for this HotPot - $restorelog = fopen("$course_dir/restorelog.html", "a"); - fwrite ($restorelog, "
Hotpot - ".$xml['NAME'][0]['#']."
"); + // open $restorelog and start output for this HotPot + $restorelog = fopen("$course_dir/restorelog.html", "a"); + fwrite ($restorelog, "
Hotpot - ".$xml['NAME'][0]['#']."
"); - // loop through time fields - $TAGS = array('TIMEOPEN', 'TIMECLOSE', 'TIMECREATED', 'TIMEMODIFIED'); - foreach ($TAGS as $TAG) { + // loop through time fields + $TAGS = array('TIMEOPEN', 'TIMECLOSE', 'TIMECREATED', 'TIMEMODIFIED'); + foreach ($TAGS as $TAG) { - // check $TAG has a sensible value - if (!empty($xml[$TAG][0]['#']) && is_string($xml[$TAG][0]['#'])) { + // check $TAG has a sensible value + if (!empty($xml[$TAG][0]['#']) && is_string($xml[$TAG][0]['#'])) { - // write old date to $restorelog - $value = $xml[$TAG][0]['#']; - $date = usergetdate($value); - fwrite ($restorelog, "$TAG was ". $date['weekday'].", ".$date['mday']." ".$date['month']." ".$date['year']); + // write old date to $restorelog + $value = $xml[$TAG][0]['#']; + $date = usergetdate($value); + fwrite ($restorelog, "$TAG was ". $date['weekday'].", ".$date['mday']." ".$date['month']." ".$date['year']); - // write new date to $restorelog - $value += $restore->course_startdateoffset; - $date = usergetdate($value); - fwrite ($restorelog, "   $TAG is now ". $date['weekday'].", ".$date['mday']." ".$date['month']." ".$date['year']."
"); + // write new date to $restorelog + $value += $restore->course_startdateoffset; + $date = usergetdate($value); + fwrite ($restorelog, "   $TAG is now ". $date['weekday'].", ".$date['mday']." ".$date['month']." ".$date['year']."
"); - // update $value in $xml tree (as a string) - $xml[$TAG][0]['#'] = "$value"; - } + // update $value in $xml tree (as a string) + $xml[$TAG][0]['#'] = "$value"; } } } -- 2.39.5