MDL-30340 blocks - add back 'any page' support to course cats

Added the * option that is not affected by the 'varying-pagetype'
problem that has been detected and issued @ MDL-30564. So now, it's
(back) possible to define coursecat blocks to be spread over children
coursecats/courses/modules (contexts).
This commit is contained in:
Eloy Lafuente (stronk7) 2011-12-03 15:36:00 +01:00
parent b2221ee59c
commit 458fdc5280

View file

@ -35,5 +35,16 @@ function admin_page_type_list($pagetype, $parentcontext, $currentcontext) {
'admin-*' => get_string('page-admin-x', 'pagetype'),
$pagetype => get_string('page-admin-current', 'pagetype')
);
// Add the missing * (any page) option for them. MDL-30340
// TODO: These pages are really 'pagetype-varying' - MDL-30564 -
// and some day we should stop behaving that way, so proper pagetypes
// can be specified for it (like course-category-* or so).
// Luckly... the option we are introducing '*' is independent
// of that varying behavior, so will work.
if ($pagetype == 'admin-course-category') {
$array += array(
'*' => get_string('page-x', 'pagetype')
);
}
return $array;
}
}