]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-9628 Refactoring the building of navigation array for gradebook pages
authornicolasconnault <nicolasconnault>
Wed, 1 Aug 2007 06:47:35 +0000 (06:47 +0000)
committernicolasconnault <nicolasconnault>
Wed, 1 Aug 2007 06:47:35 +0000 (06:47 +0000)
31 files changed:
grade/edit/outcome/course.php
grade/edit/outcome/edit.php
grade/edit/outcome/index.php
grade/edit/outcome/tabs.php
grade/edit/scale/edit.php
grade/edit/scale/index.php
grade/edit/tree/calculation.php
grade/edit/tree/category.php
grade/edit/tree/grade.php
grade/edit/tree/index.php
grade/edit/tree/item.php
grade/edit/tree/outcomeitem.php
grade/export/ods/index.php
grade/export/txt/index.php
grade/export/xls/index.php
grade/export/xml/index.php
grade/import/csv/index.php
grade/import/xml/index.php
grade/lib.php
grade/report/grader/index.php
grade/report/grader/preferences.php
grade/report/outcomes/index.php
grade/report/user/index.php
lang/en_utf8/gradeexport_csv.php
lang/en_utf8/gradeexport_ods.php
lang/en_utf8/gradeexport_txt.php
lang/en_utf8/gradeexport_xls.php
lang/en_utf8/gradeexport_xml.php
lang/en_utf8/gradeimport_csv.php
lang/en_utf8/gradeimport_xml.php
lang/en_utf8/grades.php

index b8ccb2985cbcdb2d9deecc7e8919221b2986e559..93d175a685fb620e868f9c79bd01db08d68c9f55 100644 (file)
@@ -109,10 +109,15 @@ if ($data = data_submitted()) {
 $strgrades = get_string('grades');
 $pagename  = get_string('outcomescourse', 'grades');
 
-$navlinks = array(array('name'=>$strgrades, 'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-                  array('name'=>$pagename, 'link'=>'', 'type'=>'misc'));
+$navlinks = array(array('name'=>$strgrades,
+                        'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid,
+                        'type'=>'misc'),
+                  array('name'=>$pagename,
+                        'link'=>'',
+                        'type'=>'misc')
+                 );
 $navigation = build_navigation($navlinks);
-
+$navigation = grade_build_nav(__FILE__, $pagename, $courseid);
 /// Print header
 print_header_simple($strgrades.': '.$pagename, ': '.$strgrades, $navigation, '', '', true, '', navmenu($course));
 
@@ -126,4 +131,4 @@ check_theme_arrows();
 require('course_form.html');
 
 print_footer($course);
-?>
\ No newline at end of file
+?>
index ca4c4db8f5472c608e0de2dd56253ca2ef7c158c..b5692d20c86801369e402761982e345f62dc0692 100644 (file)
@@ -101,9 +101,7 @@ $strgraderreport = get_string('graderreport', 'grades');
 $stroutcomeedit  = get_string('outcome', 'grades');
 
 if ($courseid) {
-    $nav = array(array('name'=>$strgrades,'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-                 array('name'=>$stroutcomeedit, 'link'=>'', 'type'=>'misc'));
-    $navigation = build_navigation($nav);
+    $navigation = grade_build_nav(__FILE__, $stroutcomeedit, array('courseid' => $courseid));
     print_header_simple($strgrades.': '.$strgraderreport, ': '.$stroutcomeedit, $navigation, '', '', true, '', navmenu($course));
 
 } else {
index c9dc8df04d28494be50c2ca0105822ad0dd89fe7..cfa432953f92b41ee6931029f7df431d95e4dd3a 100644 (file)
@@ -33,9 +33,7 @@ $gpr = new grade_plugin_return(array('type'=>'edit', 'plugin'=>'outcome', 'cours
 $strgrades = get_string('grades');
 $pagename  = get_string('outcomes', 'grades');
 
-$navlinks = array(array('name'=>$strgrades, 'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-                  array('name'=>$pagename, 'link'=>'', 'type'=>'misc'));
-$navigation = build_navigation($navlinks);
+$navigation = grade_build_nav(__FILE__, $pagename, $courseid);
 
 $strshortname        = get_string('shortname');
 $strfullname         = get_string('fullname');
index 66bdccff451ac0a9c48747cc9fd9c9941e7df94d..9d9774e877040857c2afb92ee59f768b05b257e6 100644 (file)
@@ -3,14 +3,15 @@
 
     $coursecontext = get_context_instance(CONTEXT_COURSE, $courseid);
 
+    $row[] = new tabobject('courseoutcomes',
+                           $CFG->wwwroot.'/grade/edit/outcome/course.php?id='.$courseid,
+                           get_string('outcomescourse', 'grades'));
+
     if (has_capability('moodle/grade:manage', $context)) {
         $row[] = new tabobject('outcomes',
                                $CFG->wwwroot.'/grade/edit/outcome/index.php?id='.$courseid,
-                               get_string('outcomes', 'grades'));
+                               get_string('editoutcomes', 'grades'));
     }
-    $row[] = new tabobject('courseoutcomes',
-                           $CFG->wwwroot.'/grade/edit/outcome/course.php?id='.$courseid,
-                           get_string('outcomescourse', 'grades'));
 
     $tabs[] = $row;
 
index 25380cb5a33f930f9dc6eded672651aa4e141534..eb2b5b30f865df25d14de48bfa1c40407ea2c344 100644 (file)
@@ -98,9 +98,7 @@ $strgraderreport = get_string('graderreport', 'grades');
 $strscaleedit    = get_string('scale');
 
 if ($courseid) {
-    $nav = array(array('name'=>$strgrades,'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-                 array('name'=>$strscaleedit, 'link'=>'', 'type'=>'misc'));
-    $navigation = build_navigation($nav);
+    $navigation = grade_build_nav(__FILE__, $strscaleedit, $courseid);
     print_header_simple($strgrades.': '.$strgraderreport, ': '.$strscaleedit, $navigation, '', '', true, '', navmenu($course));
 
 } else {
index aad193d7565a502e8263799940481a6803542628..300857884b032b3a725a7bf115a46d568d24326a 100644 (file)
@@ -28,9 +28,7 @@ $gpr = new grade_plugin_return(array('type'=>'edit', 'plugin'=>'scale', 'coursei
 $strgrades = get_string('grades');
 $pagename  = get_string('scales');
 
-$navlinks = array(array('name'=>$strgrades, 'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-                  array('name'=>$pagename, 'link'=>'', 'type'=>'misc'));
-$navigation = build_navigation($navlinks);
+$navigation = grade_build_nav(__FILE__, $pagename, array('courseid' => $courseid));
 
 $strscale          = get_string('scale');
 $strstandardscale  = get_string('scalesstandard');
index ccc66660f59345b7b5058ea92c6dc4c9bbee69cf..6474ea86e5949b1cc72444a54e144878a949c74b 100644 (file)
@@ -46,11 +46,7 @@ $strgrades          = get_string('grades');
 $strgraderreport    = get_string('graderreport', 'grades');
 $strcalculationedit = get_string('editcalculation', 'grades');
 
-$nav = array(array('name'=>$strgrades,'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-             array('name'=>$strcalculationedit, 'link'=>'', 'type'=>'misc'));
-
-$navigation = build_navigation($nav);
-
+$navigation = grade_build_nav(__FILE__, $strcalculationedit, array('courseid' => $courseid));
 
 print_header_simple($strgrades . ': ' . $strgraderreport, ': ' . $strcalculationedit, $navigation, '', '', true, '', navmenu($course));
 
index f110f8590628e1db4aca2926661ce47f4e2ff6b8..fd832ac04de316c188bd05954382a2f6afc44252 100644 (file)
@@ -58,13 +58,10 @@ if ($mform->is_cancelled()) {
 
 $strgrades         = get_string('grades');
 $strgraderreport   = get_string('graderreport', 'grades');
-$strcategoriesedit = get_string('categoriesedit', 'grades');
-
-$nav = array(array('name'=>$strgrades,'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-             array('name'=>$strcategoriesedit, 'link'=>'', 'type'=>'misc'));
-
-$navigation = build_navigation($nav);
+$strcategoriesedit = get_string('categoryedit', 'grades');
+$strcategory       = get_string('category', 'grades');
 
+$navigation = grade_build_nav(__FILE__, $strcategory, array('courseid' => $courseid));
 
 print_header_simple($strgrades . ': ' . $strgraderreport, ': ' . $strcategoriesedit, $navigation, '', '', true, '', navmenu($course));
 
index f1e1cfe3dcb10b46c09918654fa825ba1d76ce9b..09cdfed6005e880c44780d9f2c8b62cacb4a0303 100644 (file)
@@ -114,10 +114,7 @@ $strgraderreport = get_string('graderreport', 'grades');
 $strgradeedit    = get_string('editgrade', 'grades');
 $struser         = get_string('user');
 
-$nav = array(array('name'=>$strgrades,'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-             array('name'=>$strgradeedit, 'link'=>'', 'type'=>'misc'));
-
-$navigation = build_navigation($nav);
+$navigation = grade_build_nav(__FILE__, $strgradeedit, array('courseid' => $courseid));
 
 /*********** BEGIN OUTPUT *************/
 
index da3ed1fc76e29bea9191918d3f9fb98069e2de8d..d4ab40c7df70d12d44c2e480d5b373f706d21229 100644 (file)
@@ -64,14 +64,12 @@ if (empty($eid)) {
 }
 
 
-$strgrades         = get_string('grades');
-$strgraderreport   = get_string('graderreport', 'grades');
-$strcategoriesedit = get_string('categoriesedit', 'grades');
+$strgrades             = get_string('grades');
+$strgraderreport       = get_string('graderreport', 'grades');
+$strcategoriesedit     = get_string('categoriesedit', 'grades');
+$strcategoriesanditems = get_string('categoriesanditems', 'grades');
 
-$nav = array(array('name'=>$strgrades,'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-             array('name'=>$strcategoriesedit, 'link'=>'', 'type'=>'misc'));
-
-$navigation = build_navigation($nav);
+$navigation = grade_build_nav(__FILE__, $strcategoriesanditems, array('courseid' => $courseid));
 $moving = false;
 
 switch ($action) {
index 24675d9b9b1972161ae45b165bd9ad3a2056355e..e32af6f64fbaeb322ff2252a7fd45930df41e134 100644 (file)
@@ -78,11 +78,9 @@ if ($data = $mform->get_data()) {
 $strgrades       = get_string('grades');
 $strgraderreport = get_string('graderreport', 'grades');
 $stritemsedit    = get_string('itemsedit', 'grades');
+$stritem         = get_string('item', 'grades');
 
-$nav = array(array('name'=>$strgrades,'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-             array('name'=>$stritemsedit, 'link'=>'', 'type'=>'misc'));
-
-$navigation = build_navigation($nav);
+$navigation = grade_build_nav(__FILE__, $stritem, array('courseid' => $courseid));
 
 
 print_header_simple($strgrades . ': ' . $strgraderreport, ': ' . $stritemsedit, $navigation, '', '', true, '', navmenu($course));
index e53eeaa0b0a3ca86899764af3a92c6e8ed28ced2..32020be9d5de0797a6061142ad65cc16f2984257 100644 (file)
@@ -117,12 +117,9 @@ if ($data = $mform->get_data(false)) {
 $strgrades       = get_string('grades');
 $strgraderreport = get_string('graderreport', 'grades');
 $stroutcomesedit = get_string('outcomeitemsedit', 'grades');
+$stroutcome      = get_string('outcomeitem', 'grades');
 
-$nav = array(array('name'=>$strgrades,'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-             array('name'=>$stroutcomesedit, 'link'=>'', 'type'=>'misc'));
-
-$navigation = build_navigation($nav);
-
+$navigation = grade_build_nav(__FILE__, $stroutcome, array('courseid' => $courseid));
 
 print_header_simple($strgrades . ': ' . $strgraderreport, ': ' . $stroutcomesedit, $navigation, '', '', true, '', navmenu($course));
 
index ca828f8f7ad944b8f41c5049892aa1d155d65749..9f5d6095ee196525ec5575f2dba0d1543bbe0f28 100755 (executable)
@@ -43,12 +43,9 @@ require_capability('gradeexport/ods:view', $context);
 
 $strgrades = get_string('grades', 'grades');
 $actionstr = get_string('modulename', 'gradeexport_ods');
+$navigation = grade_build_nav(__FILE__, $actionstr, array('courseid' => $course->id));
 
-$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
-$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
-$gradenav .= " -> $actionstr";
-
-print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
+print_header($course->shortname.': '.get_string('grades'), $course->fullname, $navigation);
 print_grade_plugin_selector($id, 'export', 'ods');
 // process post information
 if (($data = data_submitted()) && confirm_sesskey()) {
index f364c24872a8a316726f9e357edb905ca233b52c..71da3bced86093874ae22c00abea9bf28ba74d7f 100755 (executable)
@@ -43,12 +43,9 @@ require_capability('gradeexport/txt:view', $context);
 
 $strgrades = get_string('grades', 'grades');
 $actionstr = get_string('modulename', 'gradeexport_txt');
+$navigation = grade_build_nav(__FILE__, $actionstr, array('courseid' => $course->id));
 
-$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
-$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
-$gradenav .= " -> $actionstr";
-
-print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
+print_header($course->shortname.': '.get_string('grades'), $course->fullname, $navigation);
 print_grade_plugin_selector($id, 'export', 'txt');
 // process post information
 if (($data = data_submitted()) && confirm_sesskey()) {
index ebb6c3596d059dd9d8bb514d4ba6824c37b9e727..ee29dc67733835d0863d866e8f32bf166803334e 100755 (executable)
@@ -43,10 +43,9 @@ require_capability('gradeexport/xls:view', $context);
 
 $strgrades = get_string('grades', 'grades');
 $actionstr = get_string('modulename', 'gradeexport_xls');
-$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
-$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
-$gradenav .= " -> $actionstr";
-print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
+$navigation = grade_build_nav(__FILE__, $actionstr, array('courseid' => $course->id));
+
+print_header($course->shortname.': '.get_string('grades'), $course->fullname, $navigation);
 print_grade_plugin_selector($id, 'export', 'xls');
 // process post information
 if (($data = data_submitted()) && confirm_sesskey()) {
index 03601e9cf35bed65924ab3844651fd148f060761..991ffc9c905b39a43edc9e662352e32ec1e697d1 100755 (executable)
@@ -43,10 +43,9 @@ require_capability('gradeexport/xml:view', $context);
 
 $strgrades = get_string('grades', 'grades');
 $actionstr = get_string('modulename', 'gradeexport_xml');
-$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
-$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
-$gradenav .= " -> $actionstr";
-print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
+$navigation = grade_build_nav(__FILE__, $actionstr, array('courseid' => $course->id));
+
+print_header($course->shortname.': '.get_string('grades'), $course->fullname, $navigation);
 print_grade_plugin_selector($id, 'export', 'xml');
 // process post information
 if (($data = data_submitted()) && confirm_sesskey()) {
index 1b495a38e15ae71827c2433f95073e9a7c2df797..552193af3da6fce6a8c173234cb4ac3204498b5b 100755 (executable)
@@ -31,11 +31,10 @@ if (isset($CFG->CSV_DELIMITER)) {
 }
 
 $strgrades = get_string('grades', 'grades');
-$actionstr = get_string('importcsv', 'grades');
-$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
-$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
-$gradenav .= " -> $actionstr";
-print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
+$actionstr = get_string('csv', 'grades');
+$navigation = grade_build_nav(__FILE__, $actionstr, array('courseid' => $course->id));
+
+print_header($course->shortname.': '.get_string('grades'), $course->fullname, $navigation);
 print_grade_plugin_selector($id, 'import', 'csv');
 $mform = new grade_import_form();
 //$mform2 = new grade_import_mapping_form();
@@ -396,4 +395,4 @@ if (($formdata = data_submitted()) && !empty($formdata->map)) {
 }
 
 print_footer();
-?>
\ No newline at end of file
+?>
index d6e017c4fc37450671c5ae7cdf2ce455b2b54f4d..ef7cb9a5e7f0fef937f8f3218b28cc526b40f297 100755 (executable)
@@ -24,11 +24,10 @@ require_capability('gradeimport/xml:view', $context);
 
 // print header
 $strgrades = get_string('grades', 'grades');
-$actionstr = get_string('importxml', 'grades');
-$gradenav = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>";
-$gradenav .= " -> <a href=\"$CFG->wwwroot/grade/index.php?id=$course->id\">$strgrades</a>";
-$gradenav .= " -> $actionstr";
-print_header($course->shortname.': '.get_string('grades'), $course->fullname, $gradenav);
+$actionstr = get_string('xml', 'grades');
+$navigation = grade_build_nav(__FILE__, $actionstr, array('courseid' => $course->id));
+
+print_header($course->shortname.': '.get_string('grades'), $course->fullname, $navigation);
 print_grade_plugin_selector($id, 'import', 'xml');
 $mform = new grade_import_form();
 
@@ -170,4 +169,4 @@ if ( $formdata = $mform->get_data()) {
 }
 
 print_footer();
-?>
\ No newline at end of file
+?>
index d44a65442b2fa17276bac360fa6e765bf50cc9eb..0d939e189012e62eb6ef3d9bb23e3c662b5d50bb 100644 (file)
@@ -330,6 +330,105 @@ class grade_plugin_return {
     }
 }
 
+/**
+ * Function central to gradebook for building and printing the navigation (breadcrumb trail).
+ * @param string $path The path of the calling script (using __FILE__?)
+ * @param string $pagename The language string to use as the last part of the navigation (non-link)
+ * @param mixed  $id Either a plain integer (assuming the key is 'id') or an array of keys and values (e.g courseid => $courseid, itemid...)
+ * @return string
+ */
+function grade_build_nav($path, $pagename=null, $id=null) {
+    global $CFG, $COURSE;
+
+    $strgrades = get_string('grades', 'grades');
+
+    // Parse the path and build navlinks from its elements
+    $dirroot_length = strlen($CFG->dirroot) + 1; // Add 1 for the first slash
+    $path = substr($path, $dirroot_length);
+    $path = str_replace('\\', '/', $path);
+
+    $path_elements = explode('/', $path);
+
+    $path_elements_count = count($path_elements);
+
+    $last_element = $path_elements[$path_elements_count-1]; // Should be the filename (including extension)
+
+    // First link is always 'grade'
+    $navlinks = array();
+    $navlinks[] = array('name' => $strgrades,
+                        'link' => $CFG->wwwroot.'/grade/index.php?id='.$COURSE->id,
+                        'type' => 'misc');
+
+    $link = '';
+    $numberofelements = 3;
+
+    // Prepare URL params string
+    $id_string = '?';
+    if (!is_null($id)) {
+        if (is_array($id)) {
+            foreach ($id as $idkey => $idvalue) {
+                $id_string .= "$idkey=$idvalue&amp;";
+            }
+        } else {
+            $id_string .= "id=$id";
+        }
+    }
+
+    $navlink4 = null;
+
+    // Second level links
+    switch ($path_elements[1]) {
+        case 'edit': // No link
+            if ($path_elements[3] != 'index.php') {
+                $numberofelements = 4;
+            }
+            break;
+        case 'import': // No link
+            break;
+        case 'export': // No link
+            break;
+        case 'report':
+            // $id is required for this link. Do not print it if $id isn't given
+            if (!is_null($id)) {
+                $link = $CFG->wwwroot . '/grade/report/index.php' . $id_string;
+            }
+
+            if ($path_elements[2] == 'grader') {
+                $numberofelements = 4;
+            }
+            break;
+
+        default:
+            // If this element isn't among the ones already listed above, it isn't supported, throw an error.
+            debugging("grade_build_nav() doesn't support ". $path_elements[1] . " as the second path element after 'grade'.");
+            return false;
+    }
+
+    $navlinks[] = array('name' => get_string($path_elements[1], 'grades'), 'link' => $link, 'type' => 'misc');
+
+    // Third level links
+    if (empty($pagename)) {
+        $pagename = get_string($path_elements[2], 'grades');
+    }
+
+    switch ($numberofelements) {
+        case 3:
+            $navlinks[] = array('name' => $pagename, 'link' => $link, 'type' => 'misc');
+            break;
+        case 4:
+
+            if ($path_elements[2] == 'grader' AND $path_elements[3] != 'index.php') {
+                $navlinks[] = array('name' => get_string('grader', 'grades'),
+                                    'link' => "$CFG->wwwroot/grade/report/grader/index.php$id_string",
+                                    'type' => 'misc');
+            }
+            $navlinks[] = array('name' => $pagename, 'link' => '', 'type' => 'misc');
+            break;
+    }
+    $navigation = build_navigation($navlinks);
+
+    return $navigation;
+  }
 
 /**
  * This class represents a complete tree of categories, grade_items and final grades,
index 342cc782a46caaa642d607681ab5cfce687a0a96..bf4cf2ad260a9653f85ffd2db70e64b718c249cf 100644 (file)
@@ -65,10 +65,7 @@ $USER->grade_last_report[$course->id] = 'grader';
 $strgrades  = get_string('grades');
 $reportname = get_string('modulename', 'gradereport_grader');
 
-$navlinks = array(array('name'=>$strgrades, 'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-                  array('name'=>$reportname, 'link'=>'', 'type'=>'misc'));
-$navigation = build_navigation($navlinks);
-
+$navigation = grade_build_nav(__FILE__, get_string('grader', 'grades'), $courseid);
 
 /// Build editing on/off buttons
 
index 611eade4c48f74e95d0614c3ff6040e68d920701..0ee4e413300c1c496df8fb6511b455c06d656dd5 100644 (file)
@@ -65,13 +65,7 @@ $strgrades = get_string('grades');
 $strgraderreport = get_string('modulename', 'gradereport_grader');
 $strgradepreferences = get_string('gradepreferences', 'grades');
 
-$navlinks = array();
-$navlinks[] = array('name' => $strgrades, 'link' => $CFG->wwwroot . '/grade/index.php?id='.$courseid, 'type' => 'misc');
-$navlinks[] = array('name' => $strgraderreport,
-    'link' => $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $courseid, 'type' => 'misc');
-$navlinks[] = array('name' => $strgradepreferences, 'link' => '', 'type' => 'misc');
-
-$navigation = build_navigation($navlinks);
+$navigation = grade_build_nav(__FILE__, $strgradepreferences, $courseid);
 
 print_header_simple($strgrades.': '.$strgraderreport . ': ' . $strgradepreferences,': '.$strgradepreferences, $navigation,
                     '', '', true, '', navmenu($course));
index 24d65f6885587a687cdcb363cd1bc445c64500ce..2bf58ac098754e66a9de5ed9f2bbb20b900aae68 100644 (file)
@@ -18,11 +18,8 @@ require_capability('gradereport/outcomes:view', $context);
 // Build navigation
 $strgrades = get_string('grades');
 $stroutcomes = get_string('outcomes', 'grades');
-$navlinks = array();
-$navlinks[] = array('name' => $strgrades, 'link' => $CFG->wwwroot . '/grade/index.php?id='.$courseid, 'type' => 'misc');
-$navlinks[] = array('name' => $stroutcomes, 'link' => '', 'type' => 'misc');
 
-$navigation = build_navigation($navlinks);
+$navigation = grade_build_nav(__FILE__, $stroutcomes, $course->id);
 
 /// Print header
 print_header_simple($strgrades.':'.$stroutcomes, ':'.$strgrades, $navigation, '', '', true);
index 859de8a89e126d5eae31a7f344103c910167a40c..e4a9371459c98c7a7bca1601740dc379a399e098 100644 (file)
@@ -71,10 +71,7 @@ $USER->grade_last_report[$course->id] = 'user';
 $strgrades  = get_string('grades');
 $reportname = get_string('modulename', 'gradereport_user');
 
-$navlinks = array(array('name'=>$strgrades, 'link'=>$CFG->wwwroot.'/grade/index.php?id='.$courseid, 'type'=>'misc'),
-                  array('name'=>$reportname, 'link'=>'', 'type'=>'misc'));
-$navigation = build_navigation($navlinks);
-
+$navigation = grade_build_nav(__FILE__, get_string('user', 'grades'), $courseid);
 
 /// Print header
 print_header_simple($strgrades.': '.$reportname, ': '.$strgrades, $navigation,
index dda6977caae7d0430fe9aa6d6b70bac205d458a3..50fe7626572d3ae2dfc371cc158d70def3757528 100644 (file)
@@ -1,5 +1,5 @@
-<?PHP // $Id$ 
+<?PHP // $Id$
 
-$string['modulename'] = 'Export to CSV file';
+$string['modulename'] = 'CSV file';
 
 ?>
index 3762706bf73b37f3a739afd4d2d6b0d2f9e31a52..f212c8937912cb0df1556ef572d51e28d97412e9 100644 (file)
@@ -1,5 +1,5 @@
-<?PHP // $Id$ 
+<?PHP // $Id$
 
-$string['modulename'] = 'Export to OpenOffice spreadsheet';
+$string['modulename'] = 'OpenOffice spreadsheet';
 
 ?>
index 397e6e71626973937ac7307125fbf85fee7f7d20..e972dbfa95ead8be47f2ff2a253e887007ed7d24 100644 (file)
@@ -1,5 +1,5 @@
-<?PHP // $Id$ 
+<?PHP // $Id$
 
-$string['modulename'] = 'Export to plain text file';
+$string['modulename'] = 'Plain text file';
 
 ?>
index 1c463a526e0dc0d82e313682de586244cb39b15e..cd7e86a8433d083447cda9feaef5d8628959cb18 100644 (file)
@@ -1,5 +1,5 @@
-<?PHP // $Id$ 
+<?PHP // $Id$
 
-$string['modulename'] = 'Export to Excel spreadsheet';
+$string['modulename'] = 'Excel spreadsheet';
 
 ?>
index b9c27d6bec03a9c6c0c7f7beb63b3e99e7dcf59c..3ed224e89c7cdd0350878f5db84a34c17dfc4edb 100644 (file)
@@ -1,5 +1,5 @@
-<?PHP // $Id$ 
+<?PHP // $Id$
 
-$string['modulename'] = 'Export to XML file';
+$string['modulename'] = 'XML file';
 
 ?>
index 5c8b9e0fa544210125f4d7b28f0a54ce65d94a95..50fe7626572d3ae2dfc371cc158d70def3757528 100644 (file)
@@ -1,5 +1,5 @@
-<?PHP // $Id$ 
+<?PHP // $Id$
 
-$string['modulename'] = 'Import CSV file';
+$string['modulename'] = 'CSV file';
 
 ?>
index 5718fd76f30c0659dc4eeac252b218a9c84353c4..3ed224e89c7cdd0350878f5db84a34c17dfc4edb 100644 (file)
@@ -1,5 +1,5 @@
-<?PHP // $Id$ 
+<?PHP // $Id$
 
-$string['modulename'] = 'Import XML file';
+$string['modulename'] = 'XML file';
 
 ?>
index ae43b7405c32a5dfbe4c4eac4c1ec4675644899b..afe9f8152d6e9e522d06911360ed3d4bd4420d15 100644 (file)
@@ -42,8 +42,10 @@ $string['calculationedit'] = 'Edit calculation';
 $string['calculationview'] = 'View calculation';
 $string['calculationsaved'] = 'Calculation saved';
 $string['categories'] = 'Categories';
+$string['categoriesanditems'] = 'Categories and Items';
+$string['categoriesedit'] = 'Edit Categories and Items';
 $string['category'] = 'Category';
-$string['categoriesedit'] = 'Edit Categories';
+$string['categoryedit'] = 'Edit Category';
 $string['categoryname'] = 'Category name';
 $string['changesitedefaults'] = 'Change site defaults';
 $string['choosecategory'] = 'Select Category';
@@ -79,6 +81,7 @@ $string['contract'] = 'Contract Category';
 $string['createcategory'] = 'Create Category';
 $string['createcategoryerror'] = 'Could not create a new category';
 $string['creatinggradebooksettings'] = 'Creating Gradebook settings';
+$string['csv'] = 'CSV';
 $string['curveto'] = 'Curve To';
 $string['decimalpoints'] = 'Overall decimal points';
 $string['default'] = 'Default';
@@ -91,6 +94,7 @@ $string['droplow'] = 'Drop the lowest';
 $string['dropped'] = 'Dropped';
 $string['dropxlowest'] = 'Drop X Lowest';
 $string['dropxlowestwarning'] = 'Note: If you use drop x lowest the grading assumes that all items in the category have the same point value. If point values differ results will be unpredictable';
+$string['edit'] = 'Edit';
 $string['editcalculation'] = 'Edit Calculation';
 $string['editfeedback'] = 'Edit Feedback';
 $string['editgrade'] = 'Edit Grade';
@@ -107,6 +111,7 @@ $string['errorreprintheadersnonnumeric'] = 'Received non-numeric value for repri
 $string['exceptions'] = 'Exceptions';
 $string['excluded'] = 'Excluded';
 $string['expand'] = 'Expand Category';
+$string['export'] = 'Export';
 $string['exportplugins'] = 'Export plugins';
 $string['extracredit'] = 'Extra Credit';
 $string['extracreditwarning'] = 'Note: Setting all items for a category to extra credit will effectively remove them from the grade calculation. Since there will be no point total';
@@ -169,6 +174,7 @@ $string['highgradeascending'] = 'Sort by high grade ascending';
 $string['highgradedescending'] = 'Sort by high grade descending';
 $string['highgradeletter'] = 'High';
 $string['identifier'] = 'Identify user by';
+$string['import'] = 'Import';
 $string['importcsv'] = 'Import CSV';
 $string['importfailed'] = 'Import failed';
 $string['importfile'] = 'Import file';
@@ -225,6 +231,7 @@ $string['onascaleof'] = ' on a scale of $a->grademin to $a->grademax';
 $string['operations'] = 'Operations';
 $string['outcome'] = 'Outcome';
 $string['outcomecreate'] = 'Add a new outcome';
+$string['outcomeitem'] = 'Outcome item';
 $string['outcomeitemsedit'] = 'Edit outcome item';
 $string['outcomes'] = 'Outcomes';
 $string['outcomescustom'] = 'Custom outcomes';
@@ -262,8 +269,9 @@ $string['range'] = 'Range';
 $string['rangesdecimalpoints'] = 'Decimals shown in ranges';
 $string['rangesdisplaytype'] = 'Range display type';
 $string['rank'] = 'Rank';
-$string['real'] = 'Real';
 $string['rawpct'] = 'Raw %%';
+$string['real'] = 'Real';
+$string['report'] = 'Report';
 $string['reportplugins'] = 'Report plugins';
 $string['reportsettings'] = 'Report settings';
 $string['reprintheaders'] = 'Reprint Headers';
@@ -326,6 +334,7 @@ $string['usedgradeitem'] = 'Used grade item';
 $string['usenooutcome'] = 'Use no outcome';
 $string['usenoscale'] = 'Use no scale';
 $string['usepercent'] = 'Use Percent';
+$string['user'] = 'User';
 $string['userpreferences'] = 'User preferences';
 $string['useweighted'] = 'Use Weighted';
 $string['viewbygroup'] = 'Group';
@@ -336,6 +345,7 @@ $string['weighteddescending'] = 'Sort by weighted percent descending';
 $string['weightedpct'] = 'weighted %%';
 $string['weightedpctcontribution'] = 'weighted %% contribution';
 $string['writinggradebookinfo'] = 'Writing Gradebook settings';
+$string['xml'] = 'XML';
 $string['yes'] = 'Yes';
 $string['yourgrade'] = 'Your grade';
 ?>