From d863aecb926ca1a88cd4b29b7143ba95a74214a4 Mon Sep 17 00:00:00 2001 From: "Andrew Davis (andyjdavis)" Date: Tue, 28 Jun 2011 18:50:03 +0800 Subject: [PATCH] MDL-27812 blocks: fixed the ability to add a block and have it display on all pages --- lib/blocklib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/blocklib.php b/lib/blocklib.php index 608a3d5be40..6c4fa38787b 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -1217,13 +1217,14 @@ class block_manager { // 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'; } } }