Browse files

MDL-27812 blocks: fixed the ability to add a block and have it displa…

…y on all pages
  • Loading branch information...
1 parent 7fde489 commit d863aecb926ca1a88cd4b29b7143ba95a74214a4 @andyjdavis andyjdavis committed Jun 28, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/blocklib.php
View
5 lib/blocklib.php
@@ -1217,13 +1217,14 @@ public function process_url_edit() {
// If the block wants to be system-wide, then explicitly set that
if ($data->bui_contexts == BUI_CONTEXTS_ENTIRE_SITE) { // Only possible on a frontpage or system page
$bi->parentcontextid = $systemcontext->id;
- $bi->showinsubcontexts = 1;
+ $bi->showinsubcontexts = BUI_CONTEXTS_CURRENT_SUBS; //show in current and sub contexts
+ $bi->pagetypepattern = '*';
} else { // The block doesn't want to be system-wide, so let's ensure that
if ($parentcontext->id == $systemcontext->id) { // We need to move it to the front page
$frontpagecontext = get_context_instance(CONTEXT_COURSE, SITEID);
$bi->parentcontextid = $frontpagecontext->id;
- $bi->pagetypepattern = '*'; // Just in case
+ $bi->pagetypepattern = 'site-index';
}
}
}

0 comments on commit d863aec

Please sign in to comment.