]> git.mjollnir.org Git - moodle.git/commitdiff
Cleaned up the display of the export pages
authormoodler <moodler>
Tue, 18 Sep 2007 03:36:47 +0000 (03:36 +0000)
committermoodler <moodler>
Tue, 18 Sep 2007 03:36:47 +0000 (03:36 +0000)
grade/export/grade_export_form.php
grade/export/lib.php
grade/export/ods/index.php
grade/export/txt/index.php
grade/export/xls/index.php
grade/export/xml/index.php

index 922f58c2ff014ad48a49e5a2f29f2649f3bb1a20..4386be3c08524cb4d2f918852ad082a1bac93978 100755 (executable)
@@ -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();
index 08c087ddc2768e51f32a5ba11a9dd33785bb8422..f58231e0ebc1c8f02cc86d5bf35e8afad59ab436 100755 (executable)
@@ -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.'&amp;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>';
     }
 }
 
index 8eb17b5a789c913a296ee51ead44781ab995c20f..c3d01ccba997b40bea8d4ccc4f5f0ccef51e3c47 100755 (executable)
@@ -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);
index 39c71e214f54032e30cdb3670108584394b80045..56e287cdad2f9440ba158be8d777b58f85306a47 100755 (executable)
@@ -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);
index 1c0af0eeaca1af98cdc18cc2d5003a6cb675e188..edf8e1b704373e7637a6916abc236bc06cb79cc9 100755 (executable)
@@ -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);
index 1036f97d3c8f497c44fb7112952752223548ac38..245601fbb01524c6705d029c9199485a9a38b8ac 100755 (executable)
@@ -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);