PATH:
home
/
centosnipponia
/
public_html
/
ticketing.nipponia.com
/
ticketing-old
/
include
<?php /********************************************************************* ajax.content.php AJAX interface for content fetching...allowed methods. Peter Rotich <peter@osticket.com> Copyright (c) 2006-2013 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: **********************************************************************/ require_once INCLUDE_DIR . 'class.ajax.php'; if(!defined('INCLUDE_DIR')) die('!'); class ConfigAjaxAPI extends AjaxController { //config info UI might need. function scp() { global $cfg, $thisstaff; $lang = Internationalization::getCurrentLanguage(); $info = Internationalization::getLanguageInfo($lang); list($sl, $locale) = explode('_', $lang); $rtl = false; foreach (Internationalization::getConfiguredSystemLanguages() as $info) { if (isset($info['direction'])) $rtl = true; } $primary = $cfg->getPrimaryLanguage(); $primary_info = Internationalization::getLanguageInfo($primary); list($primary_sl, $primary_locale) = explode('_', $primary); $config=array( 'lock_time' => $cfg->getTicketLockMode() == Lock::MODE_DISABLED ? 0 : ($cfg->getLockTime()*60), 'html_thread' => (bool) $cfg->isRichTextEnabled(), 'date_format' => Format::dtfmt_php2js($cfg->getDateFormat(true)), 'lang' => $lang, 'short_lang' => $sl, 'has_rtl' => $rtl, 'lang_flag' => strtolower($info['flag'] ?: $locale ?: $sl), 'primary_lang_flag' => strtolower($primary_info['flag'] ?: $primary_locale ?: $primary_sl), 'primary_language' => Internationalization::rfc1766($primary), 'secondary_languages' => $cfg->getSecondaryLanguages(), 'page_size' => $thisstaff->getPageLimit() ?: PAGE_LIMIT, 'path' => ROOT_PATH, 'editor_spacing' => $thisstaff->editorSpacing(), ); return $this->json_encode($config); } function client($headers=true) { 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->isRichTextEnabled(), 'lang' => $lang, 'short_lang' => $sl, 'has_rtl' => $rtl, 'primary_language' => Internationalization::rfc1766($cfg->getPrimaryLanguage()), 'secondary_languages' => $cfg->getSecondaryLanguages(), 'path' => ROOT_PATH, ); $config = $this->json_encode($config); if ($headers) { Http::cacheable(md5($config), $cfg->lastModified()); header('Content-Type: application/json; charset=UTF-8'); } return $config; } function templateLinks() { $links = $this->json_encode(array( array('name'=>'Select ...', 'url'=> false), array('name'=>'Agent Ticket Link', 'url'=> '%{ticket.staff_link}'), array('name'=>'Agent Login Page', 'url'=> '%{url}/scp'), array('name'=>'End-User Ticket Link', 'url'=> '%{recipient.ticket_link}'), array('name'=>'End-User Login Page', 'url'=> '%{url}/login.php'), )); Http::cacheable(md5($links)); header('Content-Type: application/json; charset=UTF-8'); return $links; } /** * Ajax: GET /config/date-format?format=<format> * * Formats the user's current date and time according to the given * format in INTL codes. * * Get-Arguments: * format - (string) format string used to format the current date and * time (from the user's perspective) * * Returns: * (string) Current sequence number, optionally formatted * * Throws: * 403 - Not logged in * 400 - ?format missing */ function dateFormat() { global $thisstaff; if (!$thisstaff) Http::response(403, 'Login required'); elseif (!isset($_GET['format'])) Http::response(400, '?format is required'); return Format::htmlchars(Format::__formatDate( Misc::gmtime(), $_GET['format'], false, null, null, '', 'UTC' )); } } ?>
[+]
..
[-] .MANIFEST
[edit]
[-] ajax.admin.php
[edit]
[-] ajax.config.php
[edit]
[-] ajax.content.php
[edit]
[-] ajax.draft.php
[edit]
[-] ajax.email.php
[edit]
[-] ajax.export.php
[edit]
[-] ajax.filter.php
[edit]
[-] ajax.forms.php
[edit]
[-] ajax.i18n.php
[edit]
[-] ajax.kbase.php
[edit]
[-] ajax.note.php
[edit]
[-] ajax.orgs.php
[edit]
[-] ajax.plugins.php
[edit]
[-] ajax.schedule.php
[edit]
[-] ajax.search.php
[edit]
[-] ajax.sequence.php
[edit]
[-] ajax.staff.php
[edit]
[-] ajax.tasks.php
[edit]
[-] ajax.thread.php
[edit]
[-] ajax.tickets.php
[edit]
[-] ajax.tips.php
[edit]
[-] ajax.upgrader.php
[edit]
[-] ajax.users.php
[edit]
[-] api.cron.php
[edit]
[-] api.tickets.php
[edit]
[-] class.2fa.php
[edit]
[-] class.ajax.php
[edit]
[-] class.api.php
[edit]
[-] class.app.php
[edit]
[-] class.attachment.php
[edit]
[-] class.auth.php
[edit]
[-] class.avatar.php
[edit]
[-] class.banlist.php
[edit]
[-] class.base32.php
[edit]
[-] class.businesshours.php
[edit]
[-] class.canned.php
[edit]
[-] class.captcha.php
[edit]
[-] class.category.php
[edit]
[-] class.charset.php
[edit]
[-] class.cli.php
[edit]
[-] class.client.php
[edit]
[-] class.collaborator.php
[edit]
[-] class.company.php
[edit]
[-] class.config.php
[edit]
[-] class.controller.php
[edit]
[-] class.cron.php
[edit]
[-] class.crypto.php
[edit]
[-] class.csrf.php
[edit]
[-] class.dept.php
[edit]
[-] class.dispatcher.php
[edit]
[-] class.draft.php
[edit]
[-] class.dynamic_forms.php
[edit]
[-] class.email.php
[edit]
[-] class.error.php
[edit]
[-] class.export.php
[edit]
[-] class.faq.php
[edit]
[-] class.file.php
[edit]
[-] class.filter.php
[edit]
[-] class.filter_action.php
[edit]
[-] class.format.php
[edit]
[-] class.forms.php
[edit]
[-] class.http.php
[edit]
[-] class.i18n.php
[edit]
[-] class.import.php
[edit]
[-] class.json.php
[edit]
[-] class.knowledgebase.php
[edit]
[-] class.list.php
[edit]
[-] class.lock.php
[edit]
[-] class.log.php
[edit]
[-] class.mail.php
[edit]
[-] class.mailer.php
[edit]
[-] class.mailfetch.php
[edit]
[-] class.mailparse.php
[edit]
[-] class.message.php
[edit]
[-] class.migrater.php
[edit]
[-] class.mime.php
[edit]
[-] class.misc.php
[edit]
[-] class.model.php
[edit]
[-] class.nav.php
[edit]
[-] class.note.php
[edit]
[-] class.oauth2.php
[edit]
[-] class.organization.php
[edit]
[-] class.orm.php
[edit]
[-] class.osticket.php
[edit]
[-] class.ostsession.php
[edit]
[-] class.page.php
[edit]
[-] class.pagenate.php
[edit]
[-] class.passwd.php
[edit]
[-] class.pdf.php
[edit]
[-] class.plugin.php
[edit]
[-] class.priority.php
[edit]
[-] class.queue.php
[edit]
[-] class.report.php
[edit]
[-] class.role.php
[edit]
[-] class.schedule.php
[edit]
[-] class.search.php
[edit]
[-] class.sequence.php
[edit]
[-] class.session.php
[edit]
[-] class.setup.php
[edit]
[-] class.signal.php
[edit]
[-] class.sla.php
[edit]
[-] class.staff.php
[edit]
[-] class.task.php
[edit]
[-] class.team.php
[edit]
[-] class.template.php
[edit]
[-] class.thread.php
[edit]
[-] class.thread_actions.php
[edit]
[-] class.ticket.php
[edit]
[-] class.timezone.php
[edit]
[-] class.topic.php
[edit]
[-] class.translation.php
[edit]
[-] class.upgrader.php
[edit]
[-] class.user.php
[edit]
[-] class.usersession.php
[edit]
[-] class.util.php
[edit]
[-] class.validator.php
[edit]
[-] class.variable.php
[edit]
[-] class.xml.php
[edit]
[-] class.yaml.php
[edit]
[+]
cli
[+]
client
[+]
config
[+]
fpdf
[-] html2text.php
[edit]
[-] htmLawed.php
[edit]
[+]
i18n
[-] index.php
[edit]
[-] JSON.php
[edit]
[+]
laminas-mail
[+]
mpdf
[-] mysqli.php
[edit]
[-] ost-sampleconfig.php
[edit]
[-] PasswordHash.php
[edit]
[+]
pear
[+]
plugins
[-] Spyc.php
[edit]
[+]
staff
[-] tnef_decoder.php
[edit]
[-] UniversalClassLoader.php
[edit]
[+]
upgrader
[-] ost-config.php
[edit]
[-] .htaccess.disabled
[edit]