Cleaned up the display of the export pages
This commit is contained in:
@@ -23,7 +23,7 @@ class grade_export_form extends moodleform {
|
||||
$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();
|
||||
|
||||
+12
-9
@@ -220,6 +220,9 @@ class grade_export {
|
||||
* 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>".
|
||||
@@ -284,7 +287,6 @@ class grade_export {
|
||||
/**
|
||||
* 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() {
|
||||
@@ -292,9 +294,13 @@ class grade_export {
|
||||
|
||||
$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 = '';
|
||||
@@ -306,12 +312,9 @@ class grade_export {
|
||||
|
||||
$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>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,9 +55,10 @@ if ($data = $mform->get_data()) {
|
||||
|
||||
// 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);
|
||||
|
||||
@@ -53,11 +53,13 @@ $mform = new grade_export_form(null, array('includeseparator'=>true, 'publishing
|
||||
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);
|
||||
|
||||
@@ -55,9 +55,10 @@ if ($data = $mform->get_data()) {
|
||||
|
||||
// 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);
|
||||
|
||||
@@ -55,9 +55,10 @@ if ($data = $mform->get_data()) {
|
||||
|
||||
// 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);
|
||||
|
||||
Reference in New Issue
Block a user