MDL-32946 - Blocks - Improving image alts for accessibility.

This commit is contained in:
Jason Fowler
2013-04-24 13:06:22 +08:00
parent 3a8c4380c0
commit 473327030e
5 changed files with 28 additions and 10 deletions
+10 -6
View File
@@ -1025,25 +1025,29 @@ class block_manager {
$controls = array();
$actionurl = $this->page->url->out(false, array('sesskey'=> sesskey()));
$blocktitle = $block->title;
if (empty($blocktitle)) {
$blocktitle = $block->arialabel;
}
if ($this->page->user_can_edit_blocks()) {
// Move icon.
$controls[] = array('url' => $actionurl . '&bui_moveid=' . $block->instance->id,
'icon' => 't/move', 'caption' => get_string('moveblock', 'block', $block->title),
'icon' => 't/move', 'caption' => get_string('moveblock', 'block', $blocktitle),
'class' => 'editing_move');
}
if ($this->page->user_can_edit_blocks() || $block->user_can_edit()) {
// Edit config icon - always show - needed for positioning UI.
$controls[] = array('url' => $actionurl . '&bui_editid=' . $block->instance->id,
'icon' => 't/edit', 'caption' => get_string('configureblock', 'block', $block->title),
'icon' => 't/edit', 'caption' => get_string('configureblock', 'block', $blocktitle),
'class' => 'editing_edit');
}
if ($this->user_can_delete_block($block)) {
// Delete icon.
$controls[] = array('url' => $actionurl . '&bui_deleteid=' . $block->instance->id,
'icon' => 't/delete', 'caption' => get_string('deleteblock', 'block', $block->title),
'icon' => 't/delete', 'caption' => get_string('deleteblock', 'block', $blocktitle),
'class' => 'editing_delete');
}
@@ -1051,11 +1055,11 @@ class block_manager {
// Show/hide icon.
if ($block->instance->visible) {
$controls[] = array('url' => $actionurl . '&bui_hideid=' . $block->instance->id,
'icon' => 't/hide', 'caption' => get_string('hideblock', 'block', $block->title),
'icon' => 't/hide', 'caption' => get_string('hideblock', 'block', $blocktitle),
'class' => 'editing_hide');
} else {
$controls[] = array('url' => $actionurl . '&bui_showid=' . $block->instance->id,
'icon' => 't/show', 'caption' => get_string('showblock', 'block', $block->title),
'icon' => 't/show', 'caption' => get_string('showblock', 'block', $blocktitle),
'class' => 'editing_show');
}
}
@@ -1070,7 +1074,7 @@ class block_manager {
$controls[] = array('url' => $CFG->wwwroot . '/' . $CFG->admin .
'/roles/assign.php?contextid=' . $block->context->id . '&returnurl=' . urlencode($return),
'icon' => 't/assignroles', 'caption' => get_string('assignrolesinblock', 'block', $block->title),
'icon' => 't/assignroles', 'caption' => get_string('assignrolesinblock', 'block', $blocktitle),
'class' => 'editing_roles');
}