From: nicolasconnault Date: Thu, 28 Jun 2007 12:40:11 +0000 (+0000) Subject: MDL-10211 Added all icons. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8ace7bf75fbd6ea7f5fcbbe594da2209a75c9fc7;p=moodle.git MDL-10211 Added all icons. --- diff --git a/lang/en_utf8/grades.php b/lang/en_utf8/grades.php index f5d11f7c1b..9ef73aaa9e 100644 --- a/lang/en_utf8/grades.php +++ b/lang/en_utf8/grades.php @@ -17,6 +17,7 @@ $string['category'] = 'Category'; $string['categoriesedit'] = 'Edit Categories'; $string['categoryname'] = 'Category name'; $string['choosecategory'] = 'Select Category'; +$string['contract'] = 'Contract Category'; $string['createcategory'] = 'Create Category'; $string['createcategoryerror'] = 'Could not create a new category'; $string['creatinggradebooksettings'] = 'Creating Gradebook settings'; @@ -37,6 +38,7 @@ $string['errornocourse'] = 'Could not get course information'; $string['errorreprintheadersnonnumeric'] = 'Received non-numeric value for reprint-headers'; $string['exceptions'] = 'Exceptions'; $string['excluded'] = 'Excluded'; +$string['expand'] = 'Expand Category'; $string['exportods'] = 'Export ODS'; $string['exporttxt'] = 'Export TXT'; $string['exportxml'] = 'Export XML'; diff --git a/lib/gradelib.php b/lib/gradelib.php index b8cc8b4578..14625a7eea 100644 --- a/lib/gradelib.php +++ b/lib/gradelib.php @@ -45,6 +45,9 @@ define('GRADE_CHILDTYPE_CAT', 1); define('GRADE_ITEM', 0); // Used to compare class names with CHILDTYPE values define('GRADE_CATEGORY', 1); // Used to compare class names with CHILDTYPE values +define('GRADE_CATEGORY_CONTRACTED', 0); // The state of a category header in the grader report +define('GRADE_CATEGORY_EXPANDED', 1); // The state of a category header in the grader report + define('GRADE_TYPE_NONE', 0); define('GRADE_TYPE_VALUE', 1); define('GRADE_TYPE_SCALE', 2); @@ -704,6 +707,8 @@ function grade_get_icons($object, $tree) { $strhide = get_string("hide"); $strshow = get_string("show"); $strlock = get_string("lock", 'grades'); + $strswitch_minus = get_string("contract", 'grades'); + $strswitch_plus = get_string("expand", 'grades'); $strunlock = get_string("unlock", 'grades'); $html = '
'; @@ -764,9 +769,21 @@ function grade_get_icons($object, $tree) { . "&action=$lock_unlock$tree->commonvars\">\n"; $html .= ''
               .${'str' . $lock_unlock}.''. "\n"; + + // If object is a category, display expand/contract icon + if (get_class($object) == 'grade_category') { + $expand_contract = 'switch_minus'; // Default: expanded - if ($grade) { + $state = get_user_preferences('grade_category_' . $object->id, GRADE_CATEGORY_EXPANDED); + if ($state == GRADE_CATEGORY_CONTRACTED) { + $expand_contract = 'switch_plus'; + } + + $html .= 'commonvars\">\n"; + $html .= ''
+                  .${'str' . $expand_contract}.''. "\n"; } } else { if ($USER->gradefeedback) {