Skip to content

Commit

Permalink
Merge 3a03e43 into 8814533
Browse files Browse the repository at this point in the history
  • Loading branch information
yaras committed Mar 31, 2016
2 parents 8814533 + 3a03e43 commit 3c33808
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/View/Elements/issues/edit.ctp
Expand Up @@ -45,7 +45,10 @@

<fieldset><legend><?php echo __('Notes') ?></legend>
<?php echo $this->Form->input('notes', array('div'=>false, 'label'=>false, 'cols'=>60, 'rows'=>'10', 'type'=>'textarea', 'class'=>'wiki-edit', 'id'=>'notes')); ?>
<?php echo $this->Html->script(array('jstoolbar/jstoolbar', 'jstoolbar/textile', 'jstoolbar/lang/jstoolbar-ja')); ?>
<?php
$toolbarLang = $this->Issues->get_toolbar_lang($currentuser);
echo $this->Html->script(array('jstoolbar/jstoolbar','jstoolbar/textile','jstoolbar/lang/jstoolbar-'.$toolbarLang));
?>
<script type="text/javascript">
//<![CDATA[
var toolbar = new jsToolBar($('notes')); toolbar.setHelpLink('<?php echo __("Text formatting");?>: <a href="/help/wiki_syntax.html?1236399200" onclick="window.open(&quot;/help/wiki_syntax.html?1236399200&quot;, &quot;&quot;, &quot;resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes&quot;); return false;"><?php echo __("Help"); ?></a>'); toolbar.draw();
Expand Down
5 changes: 4 additions & 1 deletion app/View/Elements/issues/form.ctp
Expand Up @@ -60,7 +60,10 @@
?>
</p>
<?php endif; ?>
<?php echo $this->Html->script(array('jstoolbar/jstoolbar','jstoolbar/textile','jstoolbar/lang/jstoolbar-ja')); ?>
<?php
$toolbarLang = $this->Issues->get_toolbar_lang($currentuser);
echo $this->Html->script(array('jstoolbar/jstoolbar','jstoolbar/textile','jstoolbar/lang/jstoolbar-'.$toolbarLang));
?>

<script type="text/javascript">
//<![CDATA[
Expand Down
22 changes: 22 additions & 0 deletions app/View/Helper/IssuesHelper.php
Expand Up @@ -235,4 +235,26 @@ function spent_hours($issue)
}
return $spent_hours;
}

function get_toolbar_lang($user) {
if ($user != NULL && isset($user['language'])) {
switch ($user['language']) {
//case 'bra': return '';
//case 'cat': return '';
//case 'chi': return '';
case 'deu': return 'de';
case 'eng': return 'en';
case 'esp': return 'es';
case 'fra': return 'fr';
case 'jpn': return 'ja';
//case 'kor': return '';
//case 'ron': return '';
case 'rus': return 'ru';
case 'tha': return 'th';
//case 'ukr': return '';
}
}

return 'en';
}
}

0 comments on commit 3c33808

Please sign in to comment.