mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
Merge branch 'wip-MDL-30921-m24' of git://github.com/samhemelryk/moodle
This commit is contained in:
commit
e830d6f98e
11 changed files with 119 additions and 6 deletions
|
@ -240,6 +240,9 @@ class block_base {
|
|||
if (!$this->hide_header()) {
|
||||
$bc->title = $this->title;
|
||||
}
|
||||
if (empty($bc->title)) {
|
||||
$bc->arialabel = new lang_string('pluginname', get_class($this));
|
||||
}
|
||||
|
||||
if ($this->page->user_is_editing()) {
|
||||
$bc->controls = $this->page->blocks->edit_controls($this);
|
||||
|
@ -398,7 +401,8 @@ 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->instance_can_be_docked() && get_user_preferences('docked_block_instance_'.$this->instance->id, 0)) {
|
||||
$attributes['class'] .= ' dock_on_load';
|
||||
|
@ -700,6 +704,29 @@ EOD;
|
|||
public static function comment_add(&$comments, $options) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the aria role attribute that best describes this block.
|
||||
*
|
||||
* Region is the default, but this should be overridden by a block is there is a region child, or even better
|
||||
* a landmark child.
|
||||
*
|
||||
* Options are as follows:
|
||||
* - landmark
|
||||
* - application
|
||||
* - banner
|
||||
* - complementary
|
||||
* - contentinfo
|
||||
* - form
|
||||
* - main
|
||||
* - navigation
|
||||
* - search
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_aria_role() {
|
||||
return 'complementary';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue