Permalink
Browse files

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).
  • Loading branch information...
1 parent 4e1e5c8 commit 0a6326625bea995f1978c5f5b300755851828dd4 @stronk7 stronk7 committed Dec 3, 2011
Showing with 12 additions and 1 deletion.
  1. +12 −1 admin/lib.php
View
@@ -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;
-}
+}

0 comments on commit 0a63266

Please sign in to comment.