mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
Merge branch 'MDL-58315_master_boost_block_classes' of https://github.com/zpottie/moodle
This commit is contained in:
commit
6ab4df423d
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 }}
|
||||
<section id="{{id}}"
|
||||
class="{{#hidden}}hidden{{/hidden}} block block_{{type}} {{#hascontrols}}block_with_controls{{/hascontrols}} card mb-3"
|
||||
class="{{#hidden}}hidden{{/hidden}} {{class}} {{#hascontrols}}block_with_controls{{/hascontrols}} card mb-3"
|
||||
role="{{ariarole}}"
|
||||
data-block="{{type}}"
|
||||
{{#arialabel}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user