Example #1
0
 static function configureForUser($user = false)
 {
     $lang = Internationalization::getCurrentLanguage($user);
     $info = Internationalization::getLanguageInfo(strtolower($lang));
     if (!$info) {
         // Not a supported language
         return;
     }
     // Define locale for C-libraries
     putenv('LC_ALL=' . $info['code']);
     self::setLocale(LC_ALL, $info['code']);
 }
Example #2
0
 function client()
 {
     global $cfg;
     $lang = Internationalization::getCurrentLanguage();
     list($sl, $locale) = explode('_', $lang);
     $rtl = false;
     foreach (Internationalization::availableLanguages() as $info) {
         if (isset($info['direction'])) {
             $rtl = true;
         }
     }
     $config = array('html_thread' => (bool) $cfg->isHtmlThreadEnabled(), 'lang' => $lang, 'short_lang' => $sl, 'has_rtl' => $rtl);
     $config = $this->json_encode($config);
     Http::cacheable(md5($config), $cfg->lastModified());
     header('Content-Type: application/json; charset=UTF-8');
     return $config;
 }
Example #3
0
 function getTipsJson($namespace, $lang = false)
 {
     global $ost, $thisstaff;
     $lang = Internationalization::getCurrentLanguage();
     $i18n = new Internationalization($lang);
     $tips = $i18n->getTemplate("help/tips/{$namespace}.yaml");
     if (!$tips || !($data = $tips->getData())) {
         Http::response(404, 'Help content not available');
     }
     // Translate links to the root path of this installation
     foreach ($data as $tip => &$info) {
         if ($ost) {
             $info = $ost->replaceTemplateVariables($info, array('config' => $ost->getConfig()));
         }
         if (isset($info['links'])) {
             foreach ($info['links'] as &$l) {
                 if ($l['href'][0] == '/') {
                     $l['href'] = ROOT_PATH . substr($l['href'], 1);
                 }
             }
         }
     }
     return $this->json_encode($data);
 }
Example #4
0
<?php

$title = $cfg && is_object($cfg) && $cfg->getTitle() ? $cfg->getTitle() : 'osTicket :: ' . __('Support Ticket System');
$signin_url = ROOT_PATH . "login.php" . ($thisclient ? "?e=" . urlencode($thisclient->getEmail()) : "");
$signout_url = ROOT_PATH . "logout.php?auth=" . $ost->getLinkToken();
header("Content-Type: text/html; charset=UTF-8");
?>
<!DOCTYPE html>
<html <?php 
if (($lang = Internationalization::getCurrentLanguage()) && ($info = Internationalization::getLanguageInfo($lang)) && @$info['direction'] == 'rtl') {
    echo 'dir="rtl" class="rtl"';
}
?>
>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title><?php 
echo Format::htmlchars($title);
?>
</title>
    <meta name="description" content="customer support platform">
    <meta name="keywords" content="osTicket, Customer support system, support ticket system">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<link rel="stylesheet" href="<?php 
echo ROOT_PATH;
?>
css/osticket.css?19292ad" media="screen"/>
    <link rel="stylesheet" href="<?php 
echo ASSETS_PATH;
?>
Example #5
0
?>
</a>
    </div>
<div id="overlay"></div>
<div id="loading">
    <h4><?php 
echo __('Please Wait!');
?>
</h4>
    <p><?php 
echo __('Please wait... it will take a second!');
?>
</p>
</div>
<?php 
if (($lang = Internationalization::getCurrentLanguage()) && $lang != 'en_US') {
    ?>
    <script type="text/javascript" src="ajax.php/i18n/<?php 
    echo $lang;
    ?>
/js"></script>
<?php 
}
?>
</body>
<script>
//Tell the window to respond to the width, along with the whole middle part.
jQuery("div#container").css("width","100%");// dynamic width to fit into the screen.
jQuery("table").attr('width', "100%"); //now that that has been resized, we need to make sure the th's fit within it.
jQuery(".message th:nth-child(1)").attr('width',"20%");
Example #6
0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html <?php
if (($lang = Internationalization::getCurrentLanguage())
        && ($info = Internationalization::getLanguageInfo($lang))
        && (@$info['direction'] == 'rtl'))
    echo 'dir="rtl" class="rtl"';
?>>
<head>
    <title><?php echo $wizard['title']; ?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="css/wizard.css?c18eac4">
    <link type="text/css" rel="stylesheet" href="<?php echo ROOT_PATH; ?>css/flags.css?c18eac4">
    <script type="text/javascript" src="../js/jquery-1.8.3.min.js?c18eac4"></script>
    <script type="text/javascript" src="js/tips.js?c18eac4"></script>
    <script type="text/javascript" src="js/setup.js?c18eac4"></script>
</head>
<body>
    <div id="wizard">
        <div id="header">
            <img id="logo" src="./images/<?php echo $wizard['logo']?$wizard['logo']:'logo.png'; ?>" width="280" height="72" alt="osTicket">
            <div class="info"><?php echo $wizard['tagline']; ?></div>
            <br/>
            <ul class="links">
                <li>
                   <?php
                   foreach($wizard['menu'] as $k=>$v)
                    echo sprintf('<a target="_blank" href="%s">%s</a> &mdash; ',$v,$k);
                   ?>
                    <a target="_blank" href="http://osticket.com/contact-us"><?php echo __('Contact Us');?></a>
                </li>