diff --git a/grade/report.php b/grade/report.php index 7448c15c739d1..c9dc916dd6220 100644 --- a/grade/report.php +++ b/grade/report.php @@ -81,7 +81,7 @@ $strgrades = get_string('grades'); - $crumbs[] = array('name' => $strgrades, 'link' => '', 'type' => 'misc'); + $crumbs[] = array('name' => $strgrades, 'link' => $CFG->wwwroot . '/grade/index.php?id='.$courseid, 'type' => 'misc'); $crumbs[] = array('name' => $reportnames[$report], 'link' => '', 'type' => 'misc'); $navigation = build_navigation($crumbs); diff --git a/grade/report/grader/category.php b/grade/report/grader/category.php index 2c8e9e1b253b1..bd90ee11b7c01 100644 --- a/grade/report/grader/category.php +++ b/grade/report/grader/category.php @@ -27,6 +27,220 @@ require_once $CFG->libdir . '/grade/grade_tree.php'; require_once $CFG->libdir . '/gradelib.php'; +/** + * Returns a HTML list with sorting arrows and insert boxes. This is a recursive method. + * @param int $level The level of recursion + * @param array $elements The elements to display in a list. Defaults to this->tree_array + * @param int $source_sortorder A source sortorder, given when an element needs to be moved or inserted. + * @param string $action 'move' or 'insert' + * @param string $source_type 'topcat', 'subcat' or 'item' + * @return string HTML code + */ +function get_edit_tree($tree, $level=1, $elements=NULL, $source_sortorder=NULL, $action=NULL, $source_type=NULL) { + if (empty($tree->tree_array)) { + return null; + } else { + global $CFG; + global $USER; + + $strmove = get_string("move"); + $strmoveup = get_string("moveup"); + $strmovedown = get_string("movedown"); + $strmovehere = get_string("movehere"); + $strcancel = get_string("cancel"); + $stredit = get_string("edit"); + $strdelete = get_string("delete"); + $strhide = get_string("hide"); + $strshow = get_string("show"); + $strlock = get_string("lock", 'grades'); + $strunlock = get_string("unlock", 'grades'); + $strnewcategory = get_string("newcategory", 'grades'); + $strcategoryname = get_string("categoryname", 'grades'); + $strcreatecategory = get_string("createcategory", 'grades'); + $strsubcategory = get_string("subcategory", 'grades'); + $stritems = get_string("items", 'grades'); + $strcategories = get_string("categories", 'grades'); + + $list = ''; + $closing_form_tags = ''; + + if (empty($elements)) { + $list .= '
' . "\n"; + $list .= '