Commit 4e0e7bee authored by Ben Bradshaw's avatar Ben Bradshaw
Browse files

[2994] Adding more descriptive ALT tags to block control images

parent d537594d
...@@ -449,12 +449,20 @@ class BlockInstance { ...@@ -449,12 +449,20 @@ class BlockInstance {
$content = ''; $content = '';
} }
$blocktitle = $this->get('title');
if (trim($blocktitle) == "") {
$blocktitle = "this";
}
else {
$blocktitle = "'".$blocktitle."'";
}
if (!defined('JSON') && !$jsreply) { if (!defined('JSON') && !$jsreply) {
if ($this->get('canmoveleft')) { if ($this->get('canmoveleft')) {
$movecontrols[] = array( $movecontrols[] = array(
'column' => $this->get('column') - 1, 'column' => $this->get('column') - 1,
'order' => $this->get('order'), 'order' => $this->get('order'),
'title' => get_string('moveblockleft', 'view'), 'title' => get_string('moveblockleft', 'view', $blocktitle),
'arrow' => '←', 'arrow' => '←',
'dir' => 'left', 'dir' => 'left',
); );
...@@ -463,7 +471,7 @@ class BlockInstance { ...@@ -463,7 +471,7 @@ class BlockInstance {
$movecontrols[] = array( $movecontrols[] = array(
'column' => $this->get('column'), 'column' => $this->get('column'),
'order' => $this->get('order') + 1, 'order' => $this->get('order') + 1,
'title' => get_string('moveblockdown', 'view'), 'title' => get_string('moveblockdown', 'view', $blocktitle),
'arrow' => '↓', 'arrow' => '↓',
'dir' => 'down', 'dir' => 'down',
); );
...@@ -472,7 +480,7 @@ class BlockInstance { ...@@ -472,7 +480,7 @@ class BlockInstance {
$movecontrols[] = array( $movecontrols[] = array(
'column' => $this->get('column'), 'column' => $this->get('column'),
'order' => $this->get('order') - 1, 'order' => $this->get('order') - 1,
'title' => get_string('moveblockup', 'view'), 'title' => get_string('moveblockup', 'view', $blocktitle),
'arrow' => '↑', 'arrow' => '↑',
'dir' => 'up', 'dir' => 'up',
); );
...@@ -481,7 +489,7 @@ class BlockInstance { ...@@ -481,7 +489,7 @@ class BlockInstance {
$movecontrols[] = array( $movecontrols[] = array(
'column' => $this->get('column') + 1, 'column' => $this->get('column') + 1,
'order' => $this->get('order'), 'order' => $this->get('order'),
'title' => get_string('moveblockright', 'view'), 'title' => get_string('moveblockright', 'view', $blocktitle),
'arrow' => '→', 'arrow' => '→',
'dir' => 'right', 'dir' => 'right',
); );
...@@ -503,6 +511,7 @@ class BlockInstance { ...@@ -503,6 +511,7 @@ class BlockInstance {
$smarty->assign('content', $content); $smarty->assign('content', $content);
$smarty->assign('javascript', defined('JSON')); $smarty->assign('javascript', defined('JSON'));
$smarty->assign('strnotitle', get_string('notitle', 'view')); $smarty->assign('strnotitle', get_string('notitle', 'view'));
$smarty->assign('blocktitle', array($blocktitle));
return array('html' => $smarty->fetch('view/blocktypecontainerediting.tpl'), 'javascript' => $js); return array('html' => $smarty->fetch('view/blocktypecontainerediting.tpl'), 'javascript' => $js);
} }
......
...@@ -202,14 +202,13 @@ $string['addnewblockhere'] = 'Add new block here'; ...@@ -202,14 +202,13 @@ $string['addnewblockhere'] = 'Add new block here';
$string['add'] = 'Add'; $string['add'] = 'Add';
$string['addcolumn'] = 'Add Column'; $string['addcolumn'] = 'Add Column';
$string['removecolumn'] = 'Remove this column'; $string['removecolumn'] = 'Remove this column';
$string['moveblockleft'] = 'Move this block left'; $string['moveblockleft'] = "Move %s block left";
$string['moveblockdown'] = 'Move this block down'; $string['moveblockdown'] = "Move %s block down";
$string['moveblockup'] = 'Move this block up'; $string['moveblockup'] = "Move %s block up";
$string['moveblockright'] = 'Move this block right'; $string['moveblockright'] = "Move %s block right";
$string['Configure'] = 'Configure'; $string['Configure'] = 'Configure';
$string['configureblock'] = 'Configure block'; $string['configureblock'] = 'Configure %s block';
$string['configurethisblock'] = 'Configure this block'; $string['removeblock'] = 'Remove %s block';
$string['removeblock'] = 'Remove this block';
$string['blocktitle'] = 'Block Title'; $string['blocktitle'] = 'Block Title';
$string['changemyviewlayout'] = 'Change My View Layout'; $string['changemyviewlayout'] = 'Change My View Layout';
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
{assign var=direction value=$item.dir} {assign var=direction value=$item.dir}
<input type="image" src="{theme_url filename=images/move-block-$direction.png}" class="submit movebutton" name="action_moveblockinstance_id_{$id}_column_{$item.column}_order_{$item.order}" alt="{$item.arrow}" title="{$item.title}"> <input type="image" src="{theme_url filename=images/move-block-$direction.png}" class="submit movebutton" name="action_moveblockinstance_id_{$id}_column_{$item.column}_order_{$item.order}" alt="{$item.arrow}" title="{$item.title}">
{/foreach} {/foreach}
{if $configurable && !$configure} <input type="image" src="{theme_url filename=images/configure-block.png}" class="submit configurebutton" name="action_configureblockinstance_id_{$id}" alt="&bull;" title="{str tag='configurethisblock' section='view'}">{/if} {if $configurable && !$configure} <input type="image" src="{theme_url filename=images/configure-block.png}" class="submit configurebutton" name="action_configureblockinstance_id_{$id}" alt="&bull;" title="{str tag='configureblock' section='view' args=$blocktitle}">{/if}
<input type="image" src="{theme_url filename=images/remove-block.png}" class="cancel deletebutton" name="action_removeblockinstance_id_{$id}" alt="X" title="{str tag='removeblock' section='view'}"> <input type="image" src="{theme_url filename=images/remove-block.png}" class="cancel deletebutton" name="action_removeblockinstance_id_{$id}" alt="X" title="{str tag='removeblock' section='view' args=$blocktitle}">
</div> </div>
<div class="blockinstance-content"> <div class="blockinstance-content">
{$content} {$content}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment