PATH:
home
/
centosnipponia
/
public_html
/
ticketing.nipponia.com
/
osta
/
old
/
include
<?php /********************************************************************* ajax.i18n.php Callbacks to get internaltionalized pieces for osticket Peter Rotich <peter@osticket.com> Jared Hancock <jared@osticket.com> Copyright (c) 2006-2014 osTicket http://www.osticket.com Released under the GNU General Public License WITHOUT ANY WARRANTY. See LICENSE.TXT for details. vim: expandtab sw=4 ts=4 sts=4: **********************************************************************/ if(!defined('INCLUDE_DIR')) die('!'); class i18nAjaxAPI extends AjaxController { function getLanguageFile($lang, $key) { global $cfg; $i18n = new Internationalization($lang); switch ($key) { case 'js': $data = $i18n->getTemplate('js/redactor.js')->getRawData(); $data .= $i18n->getTemplate('js/jquery.ui.datepicker.js')->getRawData(); // Strings from various javascript files $data .= $i18n->getTemplate('js/osticket-strings.js')->getRawData(); header('Content-Type: text/javascript; charset=UTF-8'); break; default: Http::response(404, 'No such i18n data'); } Http::cacheable(md5($data), $cfg->lastModified()); echo $data; } function getTranslations($tag) { $t = CustomDataTranslation::allTranslations($tag); $phrases = array(); $lm = 0; foreach ($t as $translation) { $phrases[$translation->lang] = $translation->text; $lm = max($lm, strtotime($translation->updated)); } $json = JsonDataEncoder::encode($phrases) ?: '{}'; //Http::cacheable(md5($json), $lm); header('Content-Type: application/json; charset=UTF-8'); return $json; } function updateTranslations($tag) { global $thisstaff, $cfg; if (!$thisstaff) Http::response(403, "Agent login required"); if (!$_POST) Http::response(422, "No translations found to update"); $t = CustomDataTranslation::allTranslations($tag); $phrases = array(); foreach ($t as $translation) { $phrases[$translation->lang] = $translation; } foreach ($_POST as $lang => $phrase) { if (isset($phrases[$lang])) { $p = $phrases[$lang]; if (!$phrase) { $p->delete(); } else { // Avoid XSS injection $p->text = trim(Format::sanitize($phrase)); $p->agent_id = $thisstaff->getId(); } } elseif (in_array($lang, $cfg->getSecondaryLanguages())) { if (!$phrase) continue; $phrases[$lang] = CustomDataTranslation::create(array( 'lang' => $lang, 'text' => $phrase, 'object_hash' => $tag, 'type' => 'phrase', 'agent_id' => $thisstaff->getId(), 'updated' => new SqlFunction('NOW'), )); } else { Http::response(400, sprintf("%s: Must be a secondary language", $lang)); } } // Commit. foreach ($phrases as $p) if (!$p->save()) Http::response(500, sprintf("%s: Unable to commit language")); } function getConfiguredLanguages() { global $cfg; $primary = $cfg->getPrimaryLanguage(); $info = Internationalization::getLanguageInfo($primary); $langs = array( $primary => array( 'name' => Internationalization::getLanguageDescription($primary), 'flag' => strtolower($info['flag']), 'direction' => $info['direction'] ?: 'ltr', ), ); foreach ($cfg->getSecondaryLanguages() as $l) { $info = Internationalization::getLanguageInfo($l); $langs[$l] = array( 'name' => Internationalization::getLanguageDescription($l), 'flag' => strtolower($info['flag']), 'direction' => $info['direction'] ?: 'ltr', ); } $json = JsonDataEncoder::encode($langs); Http::cacheable(md5($json), $cfg->lastModified()); header('Content-Type: application/json; charset=UTF-8'); return $json; } function getSecondaryLanguages() { global $cfg; $langs = array(); foreach ($cfg->getSecondaryLanguages() as $l) { $info = Internationalization::getLanguageInfo($l); $langs[$l] = array( 'name' => Internationalization::getLanguageDescription($l), 'flag' => strtolower($info['flag']), 'direction' => $info['direction'] ?: 'ltr', ); } $json = JsonDataEncoder::encode($langs); Http::cacheable(md5($json), $cfg->lastModified()); header('Content-Type: application/json; charset=UTF-8'); return $json; } } ?>
[+]
..
[-] class.model.php
[edit]
[-] ajax.i18n.php
[edit]
[-] class.json.php
[edit]
[-] class.mime.php
[edit]
[-] class.orm.php
[edit]
[-] class.dept.php
[edit]
[-] ajax.filter.php
[edit]
[-] api.tickets.php
[edit]
[-] ajax.note.php
[edit]
[-] class.2fa.php
[edit]
[-] class.setup.php
[edit]
[-] ajax.orgs.php
[edit]
[-] class.format.php
[edit]
[-] class.message.php
[edit]
[-] class.xml.php
[edit]
[-] class.priority.php
[edit]
[-] class.app.php
[edit]
[-] index.php
[edit]
[-] ajax.forms.php
[edit]
[-] ajax.config.php
[edit]
[-] ajax.tickets.php
[edit]
[-] ajax.content.php
[edit]
[-] class.file.php
[edit]
[-] ajax.email.php
[edit]
[-] class.cli.php
[edit]
[-] class.company.php
[edit]
[-] class.mailer.php
[edit]
[-] class.list.php
[edit]
[-] class.canned.php
[edit]
[-] class.client.php
[edit]
[+]
upgrader
[-] class.csrf.php
[edit]
[-] ost-sampleconfig.php
[edit]
[-] class.http.php
[edit]
[-] ajax.staff.php
[edit]
[-] class.search.php
[edit]
[-] JSON.php
[edit]
[-] class.error.php
[edit]
[-] class.mail.php
[edit]
[-] class.sla.php
[edit]
[-] class.draft.php
[edit]
[-] class.dispatcher.php
[edit]
[-] class.note.php
[edit]
[-] class.mailparse.php
[edit]
[-] class.filter_action.php
[edit]
[-] class.queue.php
[edit]
[-] class.i18n.php
[edit]
[-] class.osticket.php
[edit]
[-] ajax.users.php
[edit]
[-] class.staff.php
[edit]
[+]
fpdf
[-] class.crypto.php
[edit]
[+]
laminas-mail
[-] class.misc.php
[edit]
[-] class.auth.php
[edit]
[-] html2text.php
[edit]
[-] class.translation.php
[edit]
[-] class.util.php
[edit]
[-] class.schedule.php
[edit]
[-] class.banlist.php
[edit]
[-] class.config.php
[edit]
[-] ajax.upgrader.php
[edit]
[-] class.email.php
[edit]
[-] ajax.admin.php
[edit]
[+]
config
[-] ajax.thread.php
[edit]
[-] class.user.php
[edit]
[-] class.passwd.php
[edit]
[-] class.import.php
[edit]
[+]
client
[-] ajax.tips.php
[edit]
[-] tnef_decoder.php
[edit]
[-] class.oauth2.php
[edit]
[-] class.plugin.php
[edit]
[-] class.timezone.php
[edit]
[-] class.ticket.php
[edit]
[-] class.nav.php
[edit]
[-] class.category.php
[edit]
[-] class.charset.php
[edit]
[+]
cli
[-] class.cron.php
[edit]
[-] class.captcha.php
[edit]
[-] class.dynamic_forms.php
[edit]
[-] class.faq.php
[edit]
[-] class.pdf.php
[edit]
[-] ajax.schedule.php
[edit]
[-] class.usersession.php
[edit]
[-] class.topic.php
[edit]
[-] class.base32.php
[edit]
[-] htmLawed.php
[edit]
[-] ajax.sequence.php
[edit]
[-] class.signal.php
[edit]
[-] class.mailfetch.php
[edit]
[-] UniversalClassLoader.php
[edit]
[-] class.sequence.php
[edit]
[-] class.businesshours.php
[edit]
[-] class.role.php
[edit]
[+]
pear
[-] class.yaml.php
[edit]
[-] Spyc.php
[edit]
[-] mysqli.php
[edit]
[-] class.thread_actions.php
[edit]
[-] class.export.php
[edit]
[-] ajax.plugins.php
[edit]
[-] class.collaborator.php
[edit]
[-] class.ostsession.php
[edit]
[+]
staff
[-] class.attachment.php
[edit]
[-] class.template.php
[edit]
[-] class.filter.php
[edit]
[-] class.controller.php
[edit]
[-] class.team.php
[edit]
[-] class.session.php
[edit]
[-] class.avatar.php
[edit]
[-] ajax.kbase.php
[edit]
[-] class.variable.php
[edit]
[-] class.validator.php
[edit]
[-] ajax.tasks.php
[edit]
[-] class.upgrader.php
[edit]
[-] class.page.php
[edit]
[-] ajax.export.php
[edit]
[-] ajax.search.php
[edit]
[-] PasswordHash.php
[edit]
[-] class.report.php
[edit]
[-] class.forms.php
[edit]
[-] class.task.php
[edit]
[-] class.migrater.php
[edit]
[-] class.lock.php
[edit]
[-] class.organization.php
[edit]
[-] class.pagenate.php
[edit]
[-] api.cron.php
[edit]
[-] class.api.php
[edit]
[-] class.thread.php
[edit]
[-] class.knowledgebase.php
[edit]
[-] class.log.php
[edit]
[-] ajax.draft.php
[edit]
[-] class.ajax.php
[edit]
[-] .htaccess.disabled
[edit]