From: nicolasconnault Date: Wed, 1 Aug 2007 06:47:35 +0000 (+0000) Subject: MDL-9628 Refactoring the building of navigation array for gradebook pages X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=826c5f8635d4584516ea494d433b5895aa466de7;p=moodle.git MDL-9628 Refactoring the building of navigation array for gradebook pages --- diff --git a/grade/edit/outcome/course.php b/grade/edit/outcome/course.php index b8ccb2985c..93d175a685 100644 --- a/grade/edit/outcome/course.php +++ b/grade/edit/outcome/course.php @@ -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 +?> diff --git a/grade/edit/outcome/edit.php b/grade/edit/outcome/edit.php index ca4c4db8f5..b5692d20c8 100644 --- a/grade/edit/outcome/edit.php +++ b/grade/edit/outcome/edit.php @@ -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 { diff --git a/grade/edit/outcome/index.php b/grade/edit/outcome/index.php index c9dc8df04d..cfa432953f 100644 --- a/grade/edit/outcome/index.php +++ b/grade/edit/outcome/index.php @@ -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'); diff --git a/grade/edit/outcome/tabs.php b/grade/edit/outcome/tabs.php index 66bdccff45..9d9774e877 100644 --- a/grade/edit/outcome/tabs.php +++ b/grade/edit/outcome/tabs.php @@ -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; diff --git a/grade/edit/scale/edit.php b/grade/edit/scale/edit.php index 25380cb5a3..eb2b5b30f8 100644 --- a/grade/edit/scale/edit.php +++ b/grade/edit/scale/edit.php @@ -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 { diff --git a/grade/edit/scale/index.php b/grade/edit/scale/index.php index aad193d756..300857884b 100644 --- a/grade/edit/scale/index.php +++ b/grade/edit/scale/index.php @@ -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'); diff --git a/grade/edit/tree/calculation.php b/grade/edit/tree/calculation.php index ccc66660f5..6474ea86e5 100644 --- a/grade/edit/tree/calculation.php +++ b/grade/edit/tree/calculation.php @@ -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)); diff --git a/grade/edit/tree/category.php b/grade/edit/tree/category.php index f110f85906..fd832ac04d 100644 --- a/grade/edit/tree/category.php +++ b/grade/edit/tree/category.php @@ -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)); diff --git a/grade/edit/tree/grade.php b/grade/edit/tree/grade.php index f1e1cfe3dc..09cdfed600 100644 --- a/grade/edit/tree/grade.php +++ b/grade/edit/tree/grade.php @@ -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 *************/ diff --git a/grade/edit/tree/index.php b/grade/edit/tree/index.php index da3ed1fc76..d4ab40c7df 100644 --- a/grade/edit/tree/index.php +++ b/grade/edit/tree/index.php @@ -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) { diff --git a/grade/edit/tree/item.php b/grade/edit/tree/item.php index 24675d9b9b..e32af6f64f 100644 --- a/grade/edit/tree/item.php +++ b/grade/edit/tree/item.php @@ -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)); diff --git a/grade/edit/tree/outcomeitem.php b/grade/edit/tree/outcomeitem.php index e53eeaa0b0..32020be9d5 100644 --- a/grade/edit/tree/outcomeitem.php +++ b/grade/edit/tree/outcomeitem.php @@ -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)); diff --git a/grade/export/ods/index.php b/grade/export/ods/index.php index ca828f8f7a..9f5d6095ee 100755 --- a/grade/export/ods/index.php +++ b/grade/export/ods/index.php @@ -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 = "wwwroot/course/view.php?id=$course->id\">$course->shortname"; -$gradenav .= " -> wwwroot/grade/index.php?id=$course->id\">$strgrades"; -$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()) { diff --git a/grade/export/txt/index.php b/grade/export/txt/index.php index f364c24872..71da3bced8 100755 --- a/grade/export/txt/index.php +++ b/grade/export/txt/index.php @@ -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 = "wwwroot/course/view.php?id=$course->id\">$course->shortname"; -$gradenav .= " -> wwwroot/grade/index.php?id=$course->id\">$strgrades"; -$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()) { diff --git a/grade/export/xls/index.php b/grade/export/xls/index.php index ebb6c3596d..ee29dc6773 100755 --- a/grade/export/xls/index.php +++ b/grade/export/xls/index.php @@ -43,10 +43,9 @@ require_capability('gradeexport/xls:view', $context); $strgrades = get_string('grades', 'grades'); $actionstr = get_string('modulename', 'gradeexport_xls'); -$gradenav = "wwwroot/course/view.php?id=$course->id\">$course->shortname"; -$gradenav .= " -> wwwroot/grade/index.php?id=$course->id\">$strgrades"; -$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()) { diff --git a/grade/export/xml/index.php b/grade/export/xml/index.php index 03601e9cf3..991ffc9c90 100755 --- a/grade/export/xml/index.php +++ b/grade/export/xml/index.php @@ -43,10 +43,9 @@ require_capability('gradeexport/xml:view', $context); $strgrades = get_string('grades', 'grades'); $actionstr = get_string('modulename', 'gradeexport_xml'); -$gradenav = "wwwroot/course/view.php?id=$course->id\">$course->shortname"; -$gradenav .= " -> wwwroot/grade/index.php?id=$course->id\">$strgrades"; -$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()) { diff --git a/grade/import/csv/index.php b/grade/import/csv/index.php index 1b495a38e1..552193af3d 100755 --- a/grade/import/csv/index.php +++ b/grade/import/csv/index.php @@ -31,11 +31,10 @@ if (isset($CFG->CSV_DELIMITER)) { } $strgrades = get_string('grades', 'grades'); -$actionstr = get_string('importcsv', 'grades'); -$gradenav = "wwwroot/course/view.php?id=$course->id\">$course->shortname"; -$gradenav .= " -> wwwroot/grade/index.php?id=$course->id\">$strgrades"; -$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 +?> diff --git a/grade/import/xml/index.php b/grade/import/xml/index.php index d6e017c4fc..ef7cb9a5e7 100755 --- a/grade/import/xml/index.php +++ b/grade/import/xml/index.php @@ -24,11 +24,10 @@ require_capability('gradeimport/xml:view', $context); // print header $strgrades = get_string('grades', 'grades'); -$actionstr = get_string('importxml', 'grades'); -$gradenav = "wwwroot/course/view.php?id=$course->id\">$course->shortname"; -$gradenav .= " -> wwwroot/grade/index.php?id=$course->id\">$strgrades"; -$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 +?> diff --git a/grade/lib.php b/grade/lib.php index d44a65442b..0d939e1890 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -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&"; + } + } 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, diff --git a/grade/report/grader/index.php b/grade/report/grader/index.php index 342cc782a4..bf4cf2ad26 100644 --- a/grade/report/grader/index.php +++ b/grade/report/grader/index.php @@ -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 diff --git a/grade/report/grader/preferences.php b/grade/report/grader/preferences.php index 611eade4c4..0ee4e41330 100644 --- a/grade/report/grader/preferences.php +++ b/grade/report/grader/preferences.php @@ -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)); diff --git a/grade/report/outcomes/index.php b/grade/report/outcomes/index.php index 24d65f6885..2bf58ac098 100644 --- a/grade/report/outcomes/index.php +++ b/grade/report/outcomes/index.php @@ -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); diff --git a/grade/report/user/index.php b/grade/report/user/index.php index 859de8a89e..e4a9371459 100644 --- a/grade/report/user/index.php +++ b/grade/report/user/index.php @@ -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, diff --git a/lang/en_utf8/gradeexport_csv.php b/lang/en_utf8/gradeexport_csv.php index dda6977caa..50fe762657 100644 --- a/lang/en_utf8/gradeexport_csv.php +++ b/lang/en_utf8/gradeexport_csv.php @@ -1,5 +1,5 @@ - diff --git a/lang/en_utf8/gradeexport_ods.php b/lang/en_utf8/gradeexport_ods.php index 3762706bf7..f212c89379 100644 --- a/lang/en_utf8/gradeexport_ods.php +++ b/lang/en_utf8/gradeexport_ods.php @@ -1,5 +1,5 @@ - diff --git a/lang/en_utf8/gradeexport_txt.php b/lang/en_utf8/gradeexport_txt.php index 397e6e7162..e972dbfa95 100644 --- a/lang/en_utf8/gradeexport_txt.php +++ b/lang/en_utf8/gradeexport_txt.php @@ -1,5 +1,5 @@ - diff --git a/lang/en_utf8/gradeexport_xls.php b/lang/en_utf8/gradeexport_xls.php index 1c463a526e..cd7e86a843 100644 --- a/lang/en_utf8/gradeexport_xls.php +++ b/lang/en_utf8/gradeexport_xls.php @@ -1,5 +1,5 @@ - diff --git a/lang/en_utf8/gradeexport_xml.php b/lang/en_utf8/gradeexport_xml.php index b9c27d6bec..3ed224e89c 100644 --- a/lang/en_utf8/gradeexport_xml.php +++ b/lang/en_utf8/gradeexport_xml.php @@ -1,5 +1,5 @@ - diff --git a/lang/en_utf8/gradeimport_csv.php b/lang/en_utf8/gradeimport_csv.php index 5c8b9e0fa5..50fe762657 100644 --- a/lang/en_utf8/gradeimport_csv.php +++ b/lang/en_utf8/gradeimport_csv.php @@ -1,5 +1,5 @@ - diff --git a/lang/en_utf8/gradeimport_xml.php b/lang/en_utf8/gradeimport_xml.php index 5718fd76f3..3ed224e89c 100644 --- a/lang/en_utf8/gradeimport_xml.php +++ b/lang/en_utf8/gradeimport_xml.php @@ -1,5 +1,5 @@ - diff --git a/lang/en_utf8/grades.php b/lang/en_utf8/grades.php index ae43b7405c..afe9f8152d 100644 --- a/lang/en_utf8/grades.php +++ b/lang/en_utf8/grades.php @@ -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'; ?>