diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index 9c58f63d3d4..c912d51ae23 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -429,13 +429,13 @@ class block_base { function html_attributes() { $attributes = array( 'id' => 'inst' . $this->instance->id, - 'class' => 'block_' . $this->name(). ' block', + 'class' => 'block_' . $this->name() . ' block', 'role' => $this->get_aria_role() ); if ($this->hide_header()) { $attributes['class'] .= ' no-header'; } - if ($this->instance_can_be_docked() && get_user_preferences('docked_block_instance_'.$this->instance->id, 0)) { + if ($this->instance_can_be_docked() && get_user_preferences('docked_block_instance_' . $this->instance->id, 0)) { $attributes['class'] .= ' dock_on_load'; } return $attributes; diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 1c1e45e5266..3901907b466 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -1747,6 +1747,7 @@ class core_renderer extends renderer_base { $context->showskiplink = !empty($context->skiptitle); $context->arialabel = $bc->arialabel; $context->ariarole = !empty($bc->attributes['role']) ? $bc->attributes['role'] : 'complementary'; + $context->class = $bc->attributes['class']; $context->type = $bc->attributes['data-block']; $context->title = $bc->title; $context->content = $bc->content; diff --git a/lib/templates/block.mustache b/lib/templates/block.mustache index 09560bc8915..a08aeed7166 100644 --- a/lib/templates/block.mustache +++ b/lib/templates/block.mustache @@ -4,6 +4,7 @@ Example context (json): { "id": "block0", + "class": "block block_html", "showskiplink": true, "type": "html", "ariarole": "complementary", @@ -20,7 +21,7 @@ {{! Start Block Container }}