updated contrib modules

This commit is contained in:
2019-07-09 12:22:32 +02:00
parent cc3b64a193
commit 438237e852
469 changed files with 17307 additions and 8396 deletions

View File

@@ -400,13 +400,17 @@ class context_reaction_block extends context_reaction {
unset($_context_blocks);
foreach ($context_blocks as $r => $blocks) {
//only render blocks in an active region
// Only render blocks in an active region.
if (array_key_exists($r, $active_regions)) {
$context_blocks[$r] = _block_render_blocks($blocks);
// Make blocks editable if allowed.
if ($this->is_editable_region($r)) {
foreach ($context_blocks[$r] as $key => $block) {
$editable = $this->is_editable_region($r);
foreach ($context_blocks[$r] as $key => $block) {
// Add the region property to each block.
$context_blocks[$r][$key]->region = $r;
// Make blocks editable if allowed.
if ($editable) {
$context_blocks[$r][$key] = $this->editable_block($block);
}
}
@@ -450,12 +454,9 @@ class context_reaction_block extends context_reaction {
*/
protected function max_block_weight() {
$blocks = $this->get_blocks();
$block_count = 0;
foreach ($blocks as $region => $block_list) {
$block_count += count($block_list);
}
// Add 2 to make sure there's space at either end of the block list
return round(($block_count + 2) / 2);
// Add 2 to make sure there's space at either end of the block list.
return round((count($blocks) + 2) / 2);
}
/**