Merge branch 'MDL-27952' of git://github.com/stronk7/moodle

This commit is contained in:
Sam Hemelryk 2011-06-22 17:20:49 +08:00
commit a0977339b0

View File

@ -1571,13 +1571,12 @@ function quiz_extend_settings_navigation($settings, $quiznode) {
// We want to add these new nodes after the Edit settings node, and before the // We want to add these new nodes after the Edit settings node, and before the
// Locally assigned roles node. Of course, both of those are controlled by capabilities. // Locally assigned roles node. Of course, both of those are controlled by capabilities.
$keys = $quiznode->get_children_key_list(); $keys = $quiznode->get_children_key_list();
$beforekey = null;
$i = array_search('modedit', $keys); $i = array_search('modedit', $keys);
if ($i === false) { if ($i === false and array_key_exists(0, $keys)) {
$beforekey = $keys[0]; $beforekey = $keys[0];
} else if (array_key_exists($i + 1, $keys)) { } else if (array_key_exists($i + 1, $keys)) {
$beforekey = $keys[$i + 1]; $beforekey = $keys[$i + 1];
} else {
$beforekey = null;
} }
if (has_capability('mod/quiz:manageoverrides', $PAGE->cm->context)) { if (has_capability('mod/quiz:manageoverrides', $PAGE->cm->context)) {