$mform->setDefault('export_feedback', 0);
$options = array('10'=>10, '20'=>20, '100'=>100, '1000'=>1000, '100000'=>100000);
- $mform->addElement('select', 'previewrows', 'Preview rows', $options); // TODO: localize
+ $mform->addElement('select', 'previewrows', get_string('previewrows', 'grades'), $options);
if (!empty($features['includeseparator'])) {
$radio = array();
* Prints preview of exported grades on screen as a feedback mechanism
*/
function display_preview() {
+
+ print_heading(get_string('previewrows', 'grades'));
+
echo '<table>';
echo '<tr>';
echo '<th>'.get_string("firstname")."</th>".
/**
* Either prints a "Export" box, which will redirect the user to the download page,
* or prints the URL for the published data.
- * @note exit() at the end of the method
* @return void
*/
function print_continue() {
$params = $this->get_export_params();
- // this button should trigger a download prompt
- if (!$this->userkey) {
- print_single_button($CFG->wwwroot.'/grade/export/'.$this->plugin.'/export.php', $params, get_string('export', 'grades'));
+
+ print_heading(get_string('export', 'grades'));
+
+ echo '<div class="gradeexportlink">';
+ if (!$this->userkey) { // this button should trigger a download prompt
+ print_single_button($CFG->wwwroot.'/grade/export/'.$this->plugin.'/export.php',
+ $params, get_string('download', 'admin'));
} else {
$paramstr = '';
$link = $CFG->wwwroot.'/grade/export/'.$this->plugin.'/dump.php'.$paramstr.'&key='.$this->userkey;
- echo '<p>';
- echo '<a href="'.$link.'">'.$link.'</a>';
- echo '</p>';
- print_footer();
+ echo get_string('download', 'admin').': <a href="'.$link.'">'.$link.'</a>';
}
- exit();
+ echo '</div>';
}
}
// print the grades on screen for feedbacks
$export->process_form($data);
- $export->display_preview();
$export->print_continue();
- die;
+ $export->display_preview();
+ print_footer($course);
+ exit;
}
groups_print_course_menu($course, 'index.php?id='.$id);
if ($data = $mform->get_data()) {
$export = new grade_export_txt($course, groups_get_course_group($course));
- // print the grades on screen for feedbacks
+ // print the grades on screen for feedback
+
$export->process_form($data);
- $export->display_preview();
$export->print_continue();
- die;
+ $export->display_preview();
+ print_footer($course);
+ exit;
}
groups_print_course_menu($course, 'index.php?id='.$id);
// print the grades on screen for feedbacks
$export->process_form($data);
- $export->display_preview();
$export->print_continue();
- die;
+ $export->display_preview();
+ print_footer($course);
+ exit;
}
groups_print_course_menu($course, 'index.php?id='.$id);
// print the grades on screen for feedbacks
$export->process_form($data);
- $export->display_preview();
$export->print_continue();
- die;
+ $export->display_preview();
+ print_footer($course);
+ exit;
}
groups_print_course_menu($course, 'index.php?id='.$id);