$tz = 99;
- while(($tz == '' || $tz == 99 || $tz == NULL) && $next = each($timezones)) {
+ // Loop while $tz is, empty but not zero, or 99, and there is another timezone is the array
+ while(((empty($tz) && !is_numeric($tz)) || $tz == 99) && $next = each($timezones)) {
$tz = $next['value'];
}
-
return is_numeric($tz) ? (float) $tz : $tz;
}
$status[] = array('component'=>$componentstr, 'item'=>get_string('deleteblogassociations', 'blog'), 'error'=>false);
}
- if (!empty($data->reset_course_completion)) {
- // Delete course completion information
+ if (!empty($data->reset_completion)) {
+ // Delete course and activity completion information.
$course = $DB->get_record('course', array('id'=>$data->courseid));
$cc = new completion_info($course);
- $cc->delete_course_completion_data();
- $status[] = array('component'=>$componentstr, 'item'=>get_string('deletecoursecompletiondata', 'completion'), 'error'=>false);
+ $cc->delete_all_completion_data();
+ $status[] = array('component' => $componentstr,
+ 'item' => get_string('deletecompletiondata', 'completion'), 'error' => false);
}
$componentstr = get_string('roles');