#20 Fixed multi-language support

merge-requests/2/head v1.2.2
Mike Koch 10 years ago
parent 136d991b3a
commit dc57fceab3

@ -903,54 +903,49 @@ function hesk_msgToPlain($msg, $specialchars=0, $strip=1)
function hesk_showTopBar($page_title) function hesk_showTopBar($page_title)
{ {
global $hesk_settings, $hesklang; echo $page_title;
} // END hesk_showTopBar()
if ($hesk_settings['can_sel_lang']) function hesk_getLanguagesAsFormIfNecessary()
{ {
global $hesk_settings, $hesklang;
if ($hesk_settings['can_sel_lang'])
{
$str = '<form method="get" action="" style="margin:0;padding:0;border:0;white-space:nowrap;">'; $str = '<form method="get" action="" role="form" style="margin:0;padding:0;border:0;white-space:nowrap;">';
if ( ! isset($_GET) ) if ( ! isset($_GET) )
{ {
$_GET = array(); $_GET = array();
} }
foreach ($_GET as $k => $v) foreach ($_GET as $k => $v)
{ {
if ($k == 'language') if ($k == 'language')
{ {
continue; continue;
} }
$str .= '<input type="hidden" name="'.hesk_htmlentities($k).'" value="'.hesk_htmlentities($v).'" />'; $str .= '<input type="hidden" name="'.hesk_htmlentities($k).'" value="'.hesk_htmlentities($v).'" />';
} }
$str .= '<select name="language" onchange="this.form.submit()">'; $str .= '<select name="language" class="form-control" onchange="this.form.submit()">';
$str .= hesk_listLanguages(0); $str .= hesk_listLanguages(0);
$str .= '</select>'; $str .= '</select><br/>';
?> ?>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="headersm" style="padding-left: 0px;"><?php echo $page_title; ?></td>
<td class="headersm" style="padding-left: 0px;text-align: right">
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
document.write('<?php echo str_replace(array('"','<','=','>'),array('\42','\74','\75','\76'),$str . '</form>'); ?>'); document.write('<?php echo str_replace(array('"','<','=','>'),array('\42','\74','\75','\76'),$str . '</form>'); ?>');
</script> </script>
<noscript> <noscript>
<?php <?php
echo $str . '<input type="submit" value="'.$hesklang['go'].'" /></form>'; echo $str . '<input type="submit" value="'.$hesklang['go'].'" /></form>';
?> ?>
</noscript> </noscript>
</td> <?php
</tr> }
</table> }
<?php
}
else
{
echo $page_title;
}
} // END hesk_showTopBar()
function hesk_listLanguages($doecho = 1) { function hesk_listLanguages($doecho = 1) {

@ -110,6 +110,14 @@ function print_add_ticket()
</ul> </ul>
<div class="summaryList"> <div class="summaryList">
<div class="viewTicketSidebar"> <div class="viewTicketSidebar">
<div class="row">
<div class="col-md-6 col-xs-12">
<label class="control-label" style="margin-top:8px;"><?php echo $hesklang['changeLanguage']; ?></label>
</div>
<div class="col-md-6 col-xs-12">
<?php echo hesk_getLanguagesAsFormIfNecessary(); ?>
</div>
</div>
<p><?php echo $hesklang['quick_help_submit_ticket']; ?></p> <p><?php echo $hesklang['quick_help_submit_ticket']; ?></p>
</div> </div>
</div> </div>

@ -21,6 +21,9 @@ $hesklang['_COLLATE']='utf8_unicode_ci';
// This is the email break line that will be used in email piping // This is the email break line that will be used in email piping
$hesklang['EMAIL_HR']='------ Reply above this line ------'; $hesklang['EMAIL_HR']='------ Reply above this line ------';
// ADDED OR MODIFIED IN NuMods 1.2.2
$hesklang['changeLanguage'] = 'Change language to';
// ADDED OR MODIFIED IN NuMods 1.2 // ADDED OR MODIFIED IN NuMods 1.2
$hesklang['statuses'] = 'Statuses'; $hesklang['statuses'] = 'Statuses';
$hesklang['basicProperties'] = 'Basic Properties'; $hesklang['basicProperties'] = 'Basic Properties';

@ -14,6 +14,6 @@ $nuMods_settings['dropdownItemTextHoverBackgroundColor'] = '#f5f5f5';
$nuMods_settings['questionMarkColor'] = '#000000'; $nuMods_settings['questionMarkColor'] = '#000000';
/* DO NOT EDIT ANYTHING BELOW THIS LINE */ /* DO NOT EDIT ANYTHING BELOW THIS LINE */
$nuMods_settings['version']='1.2.1'; $nuMods_settings['version']='1.2.2';
?> ?>

@ -216,6 +216,14 @@ require_once(HESK_PATH . 'inc/header.inc.php');
</ul> </ul>
<div class="summaryList"> <div class="summaryList">
<div class="viewTicketSidebar"> <div class="viewTicketSidebar">
<div class="row">
<div class="col-md-6 col-xs-12">
<label class="control-label" style="margin-top:8px;"><?php echo $hesklang['changeLanguage']; ?></label>
</div>
<div class="col-md-6 col-xs-12">
<?php echo hesk_getLanguagesAsFormIfNecessary(); ?>
</div>
</div>
<p><?php echo $hesklang['quick_help_ticket']; ?></p> <p><?php echo $hesklang['quick_help_ticket']; ?></p>
</div> </div>
</div> </div>

Loading…
Cancel
Save