Skip to content

Commit

Permalink
gradebook MDL-22931 made some of the setting labels more specific and…
Browse files Browse the repository at this point in the history
… made blocks show on category setting screen
  • Loading branch information
Andrew Davis committed Jul 8, 2010
1 parent 36c3fbe commit 2821c49
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
7 changes: 5 additions & 2 deletions grade/edit/tree/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
$url->param('id', $id);
}
$PAGE->set_url($url);
$PAGE->set_pagelayout('admin');

if (!$course = $DB->get_record('course', array('id' => $courseid))) {
print_error('nocourseid');
Expand Down Expand Up @@ -209,8 +210,10 @@
redirect($returnurl);
}


print_grade_page_head($courseid, 'edittree', null, $heading);
$return = false;
$buttons = false;
$shownavigation = false;
print_grade_page_head($courseid, 'edittree', null, $heading, $return, $buttons, $shownavigation);

$mform->display();

Expand Down
7 changes: 5 additions & 2 deletions grade/edit/tree/category_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@ function definition() {
$mform->disabledIf('droplow', 'keephigh', 'noteq', 0);

// Grade item settings
$mform->addElement('header', 'general', get_string('gradeitem', 'grades'));
// Displayed as Category total to avoid confusion between grade items requiring marking and category totals
$mform->addElement('header', 'general', get_string('categorytotal', 'grades'));

$mform->addElement('text', 'grade_item_itemname', get_string('categorytotalname', 'grades'));
$mform->setAdvanced('grade_item_itemname');

$mform->addElement('text', 'grade_item_itemname', get_string('itemname', 'grades'));
$mform->addElement('text', 'grade_item_iteminfo', get_string('iteminfo', 'grades'));
$mform->addHelpButton('grade_item_iteminfo', 'iteminfo', 'grades');

Expand Down
6 changes: 5 additions & 1 deletion grade/edit/tree/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
$url->param('id', $id);
}
$PAGE->set_url($url);
$PAGE->set_pagelayout('admin');

if (!$course = $DB->get_record('course', array('id' => $courseid))) {
print_error('nocourseid');
Expand Down Expand Up @@ -164,7 +165,10 @@
redirect($returnurl);
}

print_grade_page_head($courseid, 'edittree', null, $heading);
$return = false;
$buttons = false;
$shownavigation = false;
print_grade_page_head($courseid, 'edittree', null, $heading, $return, $buttons, $shownavigation);

$mform->display();

Expand Down
16 changes: 9 additions & 7 deletions grade/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ public function __construct($id, $link, $string, $parent=null) {
*/
function print_grade_page_head($courseid, $active_type, $active_plugin=null,
$heading = false, $return=false,
$buttons=false) {
$buttons=false, $shownavigation=true) {
global $CFG, $OUTPUT, $PAGE;

$plugin_info = grade_get_plugin_info($courseid, $active_type, $active_plugin);
Expand Down Expand Up @@ -644,12 +644,14 @@ function print_grade_page_head($courseid, $active_type, $active_plugin=null,
$heading = $stractive_plugin;
}

if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_DROPDOWN) {
$returnval .= print_grade_plugin_selector($plugin_info, $active_type, $active_plugin, $return);
}
$returnval .= $OUTPUT->heading($heading);
if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_TABS) {
$returnval .= grade_print_tabs($active_type, $active_plugin, $plugin_info, $return);
if ($shownavigation) {
if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_DROPDOWN) {
$returnval .= print_grade_plugin_selector($plugin_info, $active_type, $active_plugin, $return);
}
$returnval .= $OUTPUT->heading($heading);
if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_TABS) {
$returnval .= grade_print_tabs($active_type, $active_plugin, $plugin_info, $return);
}
}

if ($return) {
Expand Down
1 change: 1 addition & 0 deletions lang/en/grades.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
$string['categoryedit'] = 'Edit category';
$string['categoryname'] = 'Category name';
$string['categorytotal'] = 'Category total';
$string['categorytotalname'] = 'Category total name';
$string['categorytotalfull'] = '{$a->category} total';
$string['combo'] = 'Tabs and Dropdown menu';
$string['compact'] = 'Compact';
Expand Down

0 comments on commit 2821c49

Please sign in to comment.