id)); $strreset = get_string('reset'); $strresetcourse = get_string('resetcourse'); $strremove = get_string('remove'); print_header($course->fullname.': '.$strresetcourse, $course->fullname.': '.$strresetcourse, ''.$course->shortname.' -> '.$strresetcourse); print_simple_box_start(); print_heading($strresetcourse); /// If we have data, then process it. if ($data = data_submitted() and confirm_sesskey()) { $data->courseid = $course->id; reset_course_userdata($data, true); if (!empty($data->reset_start_date)) { if (set_field('course', 'startdate', make_timestamp($data->startyear, $data->startmonth, $data->startday), 'id', $course->id)) { notify(get_string('datechanged'), 'notifysuccess'); } } print_continue('view.php?id='.$course->id); // Back to course page print_simple_box_end(); print_footer($course); exit; } /// Print forms so the user can make choices about what to delete print_simple_box(get_string('resetinfo'), 'center', '60%'); echo '
'; print_heading(get_string('course'), 'left', 3); echo '
'; echo $strremove.':
'; print_checkbox('reset_students', 1, true, get_string('students'), '', ''); echo '
'; print_checkbox('reset_teachers', 1, true, get_string('teachers'), '', ''); echo '
'; print_checkbox('reset_events', 1, true, get_string('courseevents', 'calendar'), '', ''); echo '
'; print_checkbox('reset_logs', 1, true, get_string('logs'), '', ''); echo '
'; print_checkbox('reset_groups', 1, true, get_string('groups'), '', ''); echo '
'; print_checkbox('reset_start_date', 1, true, get_string('startdate'), '', ''); print_date_selector('startday', 'startmonth', 'startyear'); helpbutton('coursestartdate', get_string('startdate')); echo '
'; // Check each module and see if there is specific data to be removed if ($allmods = get_records('modules') ) { foreach ($allmods as $mod) { $modname = $mod->name; $modfile = $CFG->dirroot .'/mod/'. $modname .'/lib.php'; $mod_reset_course_form = $modname .'_reset_course_form'; if (file_exists($modfile)) { @include_once($modfile); if (function_exists($mod_reset_course_form)) { print_heading(get_string('modulenameplural', $modname), 'left', 3); echo '
'; $mod_reset_course_form($course); echo '
'; } } } } else { error('No modules are installed!'); } echo ''; echo ''; echo '

'; echo '
'; print_simple_box_end(); print_footer($course); ?>