Fixed capability soring on course and coursecat override MDL-6780

This commit is contained in:
moodler 2006-10-02 08:57:00 +00:00
parent 8020a0162f
commit e9c82dca8f

View File

@ -2124,7 +2124,7 @@ function fetch_context_capabilities($context) {
/// the rest of code is a bit hacky, think twice before modifying it :-(
// special sorting of core system capabiltites and enrollments
if ($context->contextlevel == CONTEXT_SYSTEM) {
if (in_array($context->contextlevel, array(CONTEXT_SYSTEM, CONTEXT_COURSECAT, CONTEXT_COURSE))) {
$first = array();
foreach ($records as $key=>$record) {
if (preg_match('|^moodle/|', $record->name) and $record->contextlevel == CONTEXT_SYSTEM) {