MDL-48366 blocks: always display custom regions in dropdown
authorMarina Glancy <marina@moodle.com>
Tue, 25 Nov 2014 06:35:37 +0000 (14:35 +0800)
committerMarina Glancy <marina@moodle.com>
Thu, 4 Dec 2014 08:07:56 +0000 (16:07 +0800)
blocks/edit_form.php

index 19624eb..ad32113 100644 (file)
@@ -84,6 +84,12 @@ class block_edit_form extends moodleform {
         $weightoptions[$last] = get_string('bracketlast', 'block', $last);
 
         $regionoptions = $this->page->theme->get_all_block_regions();
+        foreach ($this->page->blocks->get_regions() as $region) {
+            // Make sure to add all custom regions of this particular page too.
+            if (!isset($regionoptions[$region])) {
+                $regionoptions[$region] = $region;
+            }
+        }
 
         $parentcontext = context::instance_by_id($this->block->instance->parentcontextid);
         $mform->addElement('hidden', 'bui_parentcontextid', $parentcontext->id);