get rid of propicon
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/* $Id$ */
|
||||
// vim: expandtab sw=4 ts=4 sts=4:
|
||||
|
||||
/**
|
||||
* phpMyAdmin Language Loading File
|
||||
*
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -152,42 +152,30 @@ function PMA_langDetect(&$str, $envType)
|
||||
} // end of the 'PMA_langDetect()' function
|
||||
|
||||
/**
|
||||
* @var string path to the translations directory
|
||||
* @global string path to the translations directory
|
||||
*/
|
||||
$lang_path = './lang/';
|
||||
$GLOBALS['lang_path'] = './lang/';
|
||||
|
||||
/**
|
||||
* first check for lang dir exists
|
||||
* @global string interface language
|
||||
*/
|
||||
if (! is_dir($lang_path)) {
|
||||
// language directory not found
|
||||
trigger_error('phpMyAdmin-ERROR: path not found: '
|
||||
. $lang_path . ', check your language directory.',
|
||||
E_USER_WARNING);
|
||||
// and tell the user
|
||||
PMA_sendHeaderLocation('error.php?error='
|
||||
. urlencode( 'path to languages is invalid: ' . $lang_path));
|
||||
// stop execution
|
||||
exit;
|
||||
}
|
||||
|
||||
$GLOBALS['lang'] = 'en-iso-8859-1';
|
||||
/**
|
||||
* @var string interface language
|
||||
* @global boolean wether loading lang from cfg failed
|
||||
*/
|
||||
$GLOBALS['lang'] = '';
|
||||
$GLOBALS['lang_failed_cfg'] = false;
|
||||
/**
|
||||
* @var boolean wether loading lang from cfg failed
|
||||
* @global boolean wether loading lang from cookie failed
|
||||
*/
|
||||
$lang_failed_cfg = false;
|
||||
$GLOBALS['lang_failed_cookie'] = false;
|
||||
/**
|
||||
* @var boolean wether loading lang from cookie failed
|
||||
* @global boolean wether loading lang from user request failed
|
||||
*/
|
||||
$lang_failed_cookie = false;
|
||||
$GLOBALS['lang_failed_request'] = false;
|
||||
/**
|
||||
* @var boolean wether loading lang from user request failed
|
||||
* @global string text direction ltr or rtl
|
||||
*/
|
||||
$lang_failed_request = false;
|
||||
|
||||
$GLOBALS['text_dir'] = 'ltr';
|
||||
|
||||
/**
|
||||
* All the supported languages have to be listed in the array below.
|
||||
@@ -222,7 +210,10 @@ $lang_failed_request = false;
|
||||
* For Russian, we put 1251 first, because MSIE does not accept 866
|
||||
* and users would not see anything.
|
||||
*/
|
||||
$available_languages = array(
|
||||
/**
|
||||
* @global array supported languages
|
||||
*/
|
||||
$GLOBALS['available_languages'] = array(
|
||||
'af-iso-8859-1' => array('af|afrikaans', 'afrikaans-iso-8859-1', 'af', ''),
|
||||
'af-utf-8' => array('af|afrikaans', 'afrikaans-utf-8', 'af', ''),
|
||||
'ar-win1256' => array('ar|arabic', 'arabic-windows-1256', 'ar', 'العربية'),
|
||||
@@ -346,29 +337,43 @@ $available_languages = array(
|
||||
// Language filtering support
|
||||
if (! empty($GLOBALS['cfg']['FilterLanguages'])) {
|
||||
$new_lang = array();
|
||||
foreach ($available_languages as $key => $val) {
|
||||
foreach ($GLOBALS['available_languages'] as $key => $val) {
|
||||
if (preg_match('@' . $GLOBALS['cfg']['FilterLanguages'] . '@', $key)) {
|
||||
$new_lang[$key] = $val;
|
||||
}
|
||||
}
|
||||
if (count($new_lang) > 0) {
|
||||
$available_languages = $new_lang;
|
||||
$GLOBALS['available_languages'] = $new_lang;
|
||||
}
|
||||
unset($key, $val, $new_lang);
|
||||
}
|
||||
|
||||
/**
|
||||
* first check for lang dir exists
|
||||
*/
|
||||
if (! is_dir($GLOBALS['lang_path'])) {
|
||||
// language directory not found
|
||||
trigger_error('phpMyAdmin-ERROR: path not found: '
|
||||
. $GLOBALS['lang_path'] . ', check your language directory.',
|
||||
E_USER_WARNING);
|
||||
// and tell the user
|
||||
PMA_fatalError('path to languages is invalid: ' . $GLOBALS['lang_path']);
|
||||
}
|
||||
|
||||
/**
|
||||
* check for language files
|
||||
*/
|
||||
foreach ($available_languages as $each_lang_key => $each_lang) {
|
||||
if (! file_exists($lang_path . $each_lang[1] . '.inc.php')) {
|
||||
unset($available_languages[$each_lang_key]);
|
||||
foreach ($GLOBALS['available_languages'] as $each_lang_key => $each_lang) {
|
||||
if (! file_exists($GLOBALS['lang_path'] . $each_lang[1] . '.inc.php')) {
|
||||
unset($GLOBALS['available_languages'][$each_lang_key]);
|
||||
}
|
||||
}
|
||||
unset($each_lang_key, $each_lang);
|
||||
|
||||
// MySQL charsets map
|
||||
$mysql_charset_map = array(
|
||||
/**
|
||||
* @global array MySQL charsets map
|
||||
*/
|
||||
$GLOBALS['mysql_charset_map'] = array(
|
||||
'big5' => 'big5',
|
||||
'cp-866' => 'cp866',
|
||||
'euc-jp' => 'ujis',
|
||||
@@ -394,49 +399,51 @@ $mysql_charset_map = array(
|
||||
'windows-1257' => 'cp1257',
|
||||
);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Do the work!
|
||||
*/
|
||||
// Checks whether charset recoding should be allowed or not
|
||||
$allow_recoding = FALSE; // Default fallback value
|
||||
if (empty($convcharset)) {
|
||||
|
||||
/**
|
||||
* @global boolean whether charset recoding should be allowed or not
|
||||
*/
|
||||
$GLOBALS['allow_recoding'] = false;
|
||||
if (empty($GLOBALS['convcharset'])) {
|
||||
if (isset($_COOKIE['pma_charset'])) {
|
||||
$convcharset = $_COOKIE['pma_charset'];
|
||||
$GLOBALS['convcharset'] = $_COOKIE['pma_charset'];
|
||||
} else {
|
||||
$convcharset = $GLOBALS['cfg']['DefaultCharset'];
|
||||
$GLOBALS['convcharset'] = $GLOBALS['cfg']['DefaultCharset'];
|
||||
}
|
||||
}
|
||||
|
||||
if (! PMA_langCheck()) {
|
||||
// fallback language
|
||||
$fall_back_lang = 'en-utf-8'; $line = __LINE__;
|
||||
$fall_back_lang = 'en-utf-8';
|
||||
$line = __LINE__;
|
||||
if (! PMA_langSet($fall_back_lang)) {
|
||||
trigger_error('phpMyAdmin-ERROR: invalid lang code: '
|
||||
. __FILE__ . '#' . $line . ', check hard coded fall back language.',
|
||||
E_USER_WARNING);
|
||||
// stop execution
|
||||
// and tell the user that his choosen language is invalid
|
||||
PMA_sendHeaderLocation('error.php?error='
|
||||
. urlencode('Could not load any language, please check your language settings and folder'));
|
||||
exit;
|
||||
PMA_fatalError('Could not load any language, please check your language settings and folder.');
|
||||
}
|
||||
}
|
||||
|
||||
// Defines the associated filename and load the translation
|
||||
$lang_file = $lang_path . $available_languages[$GLOBALS['lang']][1] . '.inc.php';
|
||||
$lang_file = $GLOBALS['lang_path'] . $GLOBALS['available_languages'][$GLOBALS['lang']][1] . '.inc.php';
|
||||
require_once $lang_file;
|
||||
|
||||
// now, that we have loaded the language strings we can send the errors
|
||||
if ($lang_failed_cfg) {
|
||||
$GLOBALS['PMA_errors'][] = sprintf($strLanguageUnknown, htmlspecialchars($lang_failed_cfg));
|
||||
if ($GLOBALS['lang_failed_cfg']) {
|
||||
$GLOBALS['PMA_errors'][] = sprintf($GLOBALS['strLanguageUnknown'], htmlspecialchars($GLOBALS['lang_failed_cfg']));
|
||||
}
|
||||
if ($lang_failed_cookie) {
|
||||
$GLOBALS['PMA_errors'][] = sprintf($strLanguageUnknown, htmlspecialchars($lang_failed_cookie));
|
||||
if ($GLOBALS['lang_failed_cookie']) {
|
||||
$GLOBALS['PMA_errors'][] = sprintf($GLOBALS['strLanguageUnknown'], htmlspecialchars($GLOBALS['lang_failed_cookie']));
|
||||
}
|
||||
if ($lang_failed_request) {
|
||||
$GLOBALS['PMA_errors'][] = sprintf($strLanguageUnknown, htmlspecialchars($lang_failed_request));
|
||||
if ($GLOBALS['lang_failed_request']) {
|
||||
$GLOBALS['PMA_errors'][] = sprintf($GLOBALS['strLanguageUnknown'], htmlspecialchars($GLOBALS['lang_failed_request']));
|
||||
}
|
||||
|
||||
unset($strLanguageFileNotFound, $line, $fall_back_lang,
|
||||
$lang_failed_cfg, $lang_failed_cookie, $lang_failed_request, $strLanguageUnknown);
|
||||
$GLOBALS['lang_failed_cfg'], $GLOBALS['lang_failed_cookie'], $GLOBALS['ang_failed_request'], $GLOBALS['strLanguageUnknown']);
|
||||
?>
|
||||
|
Reference in New Issue
Block a user