Commit 0dbf35ea authored by Ben Bradshaw's avatar Ben Bradshaw
Browse files

[2994] Better internationalisation support for this fix

parent 714e9791
......@@ -449,20 +449,14 @@ class BlockInstance {
$content = '';
}
$blocktitle = $this->get('title');
if (trim($blocktitle) == "") {
$blocktitle = "this";
}
else {
$blocktitle = "'".$blocktitle."'";
}
if (!defined('JSON') && !$jsreply) {
if ($this->get('canmoveleft')) {
$movecontrols[] = array(
'column' => $this->get('column') - 1,
'order' => $this->get('order'),
'title' => get_string('moveblockleft', 'view', $blocktitle),
'title' => trim($this->get('title')) == '' ?
get_string('movethisblockleft', 'view') :
get_string('moveblockleft', 'view', "'".$this->get('title')."'"),
'arrow' => '←',
'dir' => 'left',
);
......@@ -471,7 +465,9 @@ class BlockInstance {
$movecontrols[] = array(
'column' => $this->get('column'),
'order' => $this->get('order') + 1,
'title' => get_string('moveblockdown', 'view', $blocktitle),
'title' => trim($this->get('title')) == '' ?
get_string('movethisblockdown', 'view') :
get_string('moveblockdown', 'view', "'".$this->get('title')."'"),
'arrow' => '↓',
'dir' => 'down',
);
......@@ -480,7 +476,9 @@ class BlockInstance {
$movecontrols[] = array(
'column' => $this->get('column'),
'order' => $this->get('order') - 1,
'title' => get_string('moveblockup', 'view', $blocktitle),
'title' => trim($this->get('title')) == '' ?
get_string('movethisblockup', 'view') :
get_string('moveblockup', 'view', "'".$this->get('title')."'"),
'arrow' => '↑',
'dir' => 'up',
);
......@@ -489,7 +487,9 @@ class BlockInstance {
$movecontrols[] = array(
'column' => $this->get('column') + 1,
'order' => $this->get('order'),
'title' => get_string('moveblockright', 'view', $blocktitle),
'title' => trim($this->get('title')) == '' ?
get_string('movethisblockright', 'view') :
get_string('moveblockright', 'view', "'".$this->get('title')."'"),
'arrow' => '→',
'dir' => 'right',
);
......@@ -511,7 +511,8 @@ class BlockInstance {
$smarty->assign('content', $content);
$smarty->assign('javascript', defined('JSON'));
$smarty->assign('strnotitle', get_string('notitle', 'view'));
$smarty->assign('blocktitle', array($blocktitle));
$smarty->assign('strconfigtitletext', trim($this->get('title')) == '' ? get_string('configurethisblock', 'view') : get_string('configureblock', 'view', "'".$this->get('title')."'"));
$smarty->assign('strremovetitletext', trim($this->get('title')) == '' ? get_string('removethisblock', 'view') : get_string('removeblock', 'view', "'".$this->get('title')."'"));
return array('html' => $smarty->fetch('view/blocktypecontainerediting.tpl'), 'javascript' => $js);
}
......
......@@ -203,12 +203,18 @@ $string['add'] = 'Add';
$string['addcolumn'] = 'Add Column';
$string['removecolumn'] = 'Remove this column';
$string['moveblockleft'] = "Move %s block left";
$string['movethisblockleft'] = "Move this block left";
$string['moveblockdown'] = "Move %s block down";
$string['movethisblockdown'] = "Move this block down";
$string['moveblockup'] = "Move %s block up";
$string['movethisblockup'] = "Move this block up";
$string['moveblockright'] = "Move %s block right";
$string['movethisblockright'] = "Move this block right";
$string['Configure'] = 'Configure';
$string['configureblock'] = 'Configure %s block';
$string['configurethisblock'] = 'Configure this block';
$string['removeblock'] = 'Remove %s block';
$string['removethisblock'] = 'Remove this block';
$string['blocktitle'] = 'Block Title';
$string['changemyviewlayout'] = 'Change My View Layout';
......
......@@ -7,8 +7,8 @@
{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}">
{/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='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' args=$blocktitle}">
{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="{$strconfigtitletext|escape}">{/if}
<input type="image" src="{theme_url filename=images/remove-block.png}" class="cancel deletebutton" name="action_removeblockinstance_id_{$id}" alt="X" title="{$strremovetitletext|escape}">
</div>
<div class="blockinstance-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