/usr/share/php/xajax/xajax_core/xajaxLanguageManager.inc.php is in php-xajax 0.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | <?php
/*
File: xajaxLanguageManager.inc.php
Contains the code that manages the inclusion of alternate language support
files; so debug and error messages can be shown in a language other than
the default (english) language.
Title: xajaxLanguageManager class
Please see <copyright.inc.php> for a detailed description, copyright
and license information.
*/
/*
@package xajax
@version $Id: xajaxLanguageManager.inc.php 362 2007-05-29 15:32:24Z calltoconstruct $
@copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson
@copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson
@license http://www.xajaxproject.org/bsd_license.txt BSD License
*/
/*
Class: xajaxLanguageManager
This class contains the default language (english) and the code used to supply
debug and error messages upon request; as well as the code used to load alternate
language text as requested via the <xajax::configure> function.
*/
class xajaxLanguageManager
{
/*
Array: aMessages
An array of the currently registered languages.
*/
var $aMessages;
/*
String: sLanguage
The currently configured language.
*/
var $sLanguage;
/*
Function: xajaxLanguageManager
Construct and initialize the one and only xajax language manager object.
*/
function xajaxLanguageManager()
{
$this->aMessages = array();
$this->aMessages['en'] = array(
'LOGHDR:01' => '** xajax Error Log - ',
'LOGHDR:02' => " **\n",
'LOGHDR:03' => "\n\n\n",
'LOGERR:01' => "** Logging Error **\n\nxajax was unable to write to the error log file:\n",
'LOGMSG:01' => "** PHP Error Messages: **",
'CMPRSJS:RDERR:01' => 'The xajax uncompressed Javascript file could not be found in the <b>',
'CMPRSJS:RDERR:02' => '</b> folder. Error ',
'CMPRSJS:WTERR:01' => 'The xajax compressed javascript file could not be written in the <b>',
'CMPRSJS:WTERR:02' => '</b> folder. Error ',
'CMPRSPHP:WTERR:01' => 'The xajax compressed file <b>',
'CMPRSPHP:WTERR:02' => '</b> could not be written to. Error ',
'CMPRSAIO:WTERR:01' => 'The xajax compressed file <b>',
'CMPRSAIO:WTERR:02' => '/xajaxAIO.inc.php</b> could not be written to. Error ',
'DTCTURI:01' => 'xajax Error: xajax failed to automatically identify your Request URI.',
'DTCTURI:02' => 'Please set the Request URI explicitly when you instantiate the xajax object.',
'ARGMGR:ERR:01' => 'Malformed object argument received: ',
'ARGMGR:ERR:02' => ' <==> ',
'ARGMGR:ERR:03' => 'The incoming xajax data could not be converted from UTF-8',
'XJXCTL:IAERR:01' => 'Invalid attribute [',
'XJXCTL:IAERR:02' => '] for element [',
'XJXCTL:IAERR:03' => '].',
'XJXCTL:IRERR:01' => 'Invalid request object passed to xajaxControl::setEvent',
'XJXCTL:IEERR:01' => 'Invalid attribute (event name) [',
'XJXCTL:IEERR:02' => '] for element [',
'XJXCTL:IEERR:03' => '].',
'XJXCTL:MAERR:01' => 'Missing required attribute [',
'XJXCTL:MAERR:02' => '] for element [',
'XJXCTL:MAERR:03' => '].',
'XJXCTL:IETERR:01' => "Invalid end tag designation; should be forbidden or optional.\n",
'XJXCTL:ICERR:01' => "Invalid class specified for html control; should be %inline, %block or %flow.\n",
'XJXCTL:ICLERR:01' => 'Invalid control passed to addChild; should be derived from xajaxControl.',
'XJXCTL:ICLERR:02' => 'Invalid control passed to addChild [',
'XJXCTL:ICLERR:03' => '] for element [',
'XJXCTL:ICLERR:04' => "].\n",
'XJXCTL:ICHERR:01' => 'Invalid parameter passed to xajaxControl::addChildren; should be array of xajaxControl objects',
'XJXCTL:MRAERR:01' => 'Missing required attribute [',
'XJXCTL:MRAERR:02' => '] for element [',
'XJXCTL:MRAERR:03' => '].',
'XJXPLG:GNERR:01' => 'Response plugin should override the getName function.',
'XJXPLG:PERR:01' => 'Response plugin should override the process function.',
'XJXPM:IPLGERR:01' => 'Attempt to register invalid plugin: ',
'XJXPM:IPLGERR:02' => ' should be derived from xajaxRequestPlugin or xajaxResponsePlugin.',
'XJXPM:MRMERR:01' => 'Failed to locate registration method for the following: ',
'XJXRSP:EDERR:01' => 'Passing character encoding to the xajaxResponse constructor is deprecated, instead use $xajax->configure("characterEncoding", ...);',
'XJXRSP:MPERR:01' => 'Invalid or missing plugin name detected in call to xajaxResponse::plugin',
'XJXRSP:CPERR:01' => "The \$sType parameter of addCreate has been deprecated. Use the addCreateInput() method instead.",
'XJXRSP:LCERR:01' => "The xajax response object could not load commands as the data provided was not a valid array.",
'XJXRSP:AKERR:01' => 'Invalid tag name encoded in array.',
'XJXRSP:IEAERR:01' => 'Improperly encoded array.',
'XJXRSP:NEAERR:01' => 'Non-encoded array detected.',
'XJXRSP:MBEERR:01' => 'The xajax response output could not be converted to HTML entities because the mb_convert_encoding function is not available',
'XJXRSP:MXRTERR' => 'Error: Cannot mix types in a single response.',
'XJXRSP:MXCTERR' => 'Error: Cannot mix content types in a single response.',
'XJXRSP:MXCEERR' => 'Error: Cannot mix character encodings in a single response.',
'XJXRSP:MXOEERR' => 'Error: Cannot mix output entities (true/false) in a single response.',
'XJXRM:IRERR' => 'An invalid response was returned while processing this request.',
'XJXRM:MXRTERR' => 'Error: You cannot mix response types while processing a single request: '
);
$this->sLanguage = 'en';
}
/*
Function: getInstance
Implements the singleton pattern: provides a single instance of the xajax
language manager object to all object which request it.
*/
function &getInstance()
{
static $obj;
if (!$obj) {
$obj = new xajaxLanguageManager();
}
return $obj;
}
/*
Function: configure
Called by the main xajax object as configuration options are set. See also:
<xajax::configure>. The <xajaxLanguageManager> tracks the following configuration
options.
Parameters:
- language (string, default 'en'): The currently selected language.
*/
function configure($sName, $mValue)
{
if ('language' == $sName) {
if ($mValue !== $this->sLanguage) {
$sFolder = dirname(__FILE__);
@include $sFolder . '/xajax_lang_' . $mValue . '.inc.php';
// require $sFolder . '/xajax_lang_' . $mValue . '.inc.php';
$this->sLanguage = $mValue;
}
}
}
/*
Function: register
Called to register an array of alternate language messages.
Parameters:
sLanguage - (string): the character code which represents the language being registered.
aMessages - (array): the array of translated debug and error messages
*/
function register($sLanguage, $aMessages) {
$this->aMessages[$sLanguage] = $aMessages;
}
/*
Function: getText
Called by the main xajax object and other objects during the initial page generation
or request processing phase to obtain language specific debug and error messages.
sMessage - (string): A code indicating the message text being requested.
*/
function getText($sMessage)
{
if (isset($this->aMessages[$this->sLanguage]))
if (isset($this->aMessages[$this->sLanguage][$sMessage]))
return $this->aMessages[$this->sLanguage][$sMessage];
return '(Unknown language or message identifier)'
. $this->sLanguage
. '::'
. $sMessage;
}
}
|