Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2013-05-02 15:01:50 +02:00
commit 3a9ea899bd
13 changed files with 102 additions and 97 deletions

View File

@ -306,7 +306,7 @@ function PMA_exportOutputHandler($line)
if ($dump_buffer_len > $GLOBALS['memory_limit']) {
if ($GLOBALS['output_charset_conversion']) {
$dump_buffer = PMA_convert_string(
$dump_buffer = PMA_convertString(
'utf-8',
$GLOBALS['charset_of_file'],
$dump_buffer
@ -349,7 +349,7 @@ function PMA_exportOutputHandler($line)
} else {
if ($GLOBALS['asfile']) {
if ($GLOBALS['output_charset_conversion']) {
$line = PMA_convert_string(
$line = PMA_convertString(
'utf-8',
$GLOBALS['charset_of_file'],
$line
@ -885,7 +885,7 @@ if ($save_on_server && isset($message)) {
if (! empty($asfile)) {
// Convert the charset if required.
if ($output_charset_conversion) {
$dump_buffer = PMA_convert_string(
$dump_buffer = PMA_convertString(
'utf-8',
$GLOBALS['charset_of_file'],
$dump_buffer

View File

@ -202,7 +202,7 @@ var validators = {
*
* @param {boolean} isKeyUp
*/
validate_positive_number: function (isKeyUp) {
PMA_validatePositiveNumber: function (isKeyUp) {
if (isKeyUp && this.value === '') {
return true;
}
@ -214,7 +214,7 @@ var validators = {
*
* @param {boolean} isKeyUp
*/
validate_non_negative_number: function (isKeyUp) {
PMA_validateNonNegativeNumber: function (isKeyUp) {
if (isKeyUp && this.value === '') {
return true;
}
@ -226,7 +226,7 @@ var validators = {
*
* @param {boolean} isKeyUp
*/
validate_port_number: function (isKeyUp) {
PMA_validatePortNumber: function (isKeyUp) {
if (this.value === '') {
return true;
}
@ -239,7 +239,7 @@ var validators = {
* @param {boolean} isKeyUp
* @param {string} regexp
*/
validate_by_regex: function (isKeyUp, regexp) {
PMA_validateByRegex: function (isKeyUp, regexp) {
if (isKeyUp && this.value === '') {
return true;
}
@ -254,7 +254,7 @@ var validators = {
* @param {boolean} isKeyUp
* @param {int} max_value
*/
validate_upper_bound: function (isKeyUp, max_value) {
PMA_validateUpperBound: function (isKeyUp, max_value) {
var val = parseInt(this.value, 10);
if (isNaN(val)) {
return true;

View File

@ -775,7 +775,7 @@ class PMA_File
}
if ($GLOBALS['charset_conversion']) {
$result = PMA_convert_string($this->getCharset(), 'utf-8', $result);
$result = PMA_convertString($this->getCharset(), 'utf-8', $result);
} else {
/**
* Skip possible byte order marks (I do not think we need more

View File

@ -63,7 +63,12 @@ class PMA_PDF extends TCPDF
if (!isset($this->footerset[$this->page])) {
$this->SetY(-15);
$this->SetFont(PMA_PDF_FONT, '', 14);
$this->Cell(0, 6, __('Page number:') . ' ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 'T', 0, 'C');
$this->Cell(
0, 6,
__('Page number:') . ' '
. $this->getAliasNumPage() . '/' . $this->getAliasNbPages(),
'T', 0, 'C'
);
$this->Cell(0, 6, PMA_Util::localisedDate(), 0, 1, 'R');
$this->SetY(20);

View File

@ -73,7 +73,7 @@ if ($PMA_recoding_engine == PMA_CHARSET_ICONV_AIX) {
* @access public
*
*/
function PMA_convert_string($src_charset, $dest_charset, $what)
function PMA_convertString($src_charset, $dest_charset, $what)
{
if ($src_charset == $dest_charset) {
return $what;
@ -92,6 +92,6 @@ function PMA_convert_string($src_charset, $dest_charset, $what)
default:
return $what;
}
} // end of the "PMA_convert_string()" function
} // end of the "PMA_convertString()" function
?>

View File

@ -17,7 +17,7 @@ if (! defined('PHPMYADMIN')) {
* @return void
* @access public
*/
function PMA_remove_request_vars(&$whitelist)
function PMA_removeRequestVars(&$whitelist)
{
// do not check only $_REQUEST because it could have been overwritten
// and use type casting because the variables could have become

View File

@ -497,7 +497,7 @@ if ($token_mismatch) {
/**
* Do actual cleanup
*/
PMA_remove_request_vars($allow_list);
PMA_removeRequestVars($allow_list);
}

View File

@ -192,54 +192,54 @@ $cfg_db['_overrides']['Servers/1/extension'] = extension_loaded('mysqli')
* Use only full paths and form ids
*/
$cfg_db['_validators'] = array(
'CharTextareaCols' => 'validate_positive_number',
'CharTextareaRows' => 'validate_positive_number',
'ExecTimeLimit' => 'validate_non_negative_number',
'Export/sql_max_query_size' => 'validate_positive_number',
'ForeignKeyMaxLimit' => 'validate_positive_number',
'Import/csv_enclosed' => array(array('validate_by_regex', '/^.?$/')),
'Import/csv_escaped' => array(array('validate_by_regex', '/^.$/')),
'Import/csv_terminated' => array(array('validate_by_regex', '/^.$/')),
'Import/ldi_enclosed' => array(array('validate_by_regex', '/^.?$/')),
'Import/ldi_escaped' => array(array('validate_by_regex', '/^.$/')),
'Import/ldi_terminated' => array(array('validate_by_regex', '/^.$/')),
'Import/skip_queries' => 'validate_non_negative_number',
'InsertRows' => 'validate_positive_number',
'NumRecentTables' => 'validate_non_negative_number',
'LimitChars' => 'validate_positive_number',
'LoginCookieValidity' => 'validate_positive_number',
'LoginCookieStore' => 'validate_non_negative_number',
'MaxDbList' => 'validate_positive_number',
'MaxNavigationItems' => 'validate_positive_number',
'MaxCharactersInDisplayedSQL' => 'validate_positive_number',
'MaxRows' => 'validate_positive_number',
'MaxTableList' => 'validate_positive_number',
'MemoryLimit' => array(array('validate_by_regex', '/^\d+(?:[kmg])?$/i')),
'NavigationTreeTableLevel' => 'validate_positive_number',
'QueryHistoryMax' => 'validate_positive_number',
'QueryWindowWidth' => 'validate_positive_number',
'QueryWindowHeight' => 'validate_positive_number',
'RepeatCells' => 'validate_non_negative_number',
'Server' => 'validate_server',
'Server_pmadb' => 'validate_pmadb',
'Servers/1/port' => 'validate_port_number',
'Servers/1/hide_db' => 'validate_regex',
'TextareaCols' => 'validate_positive_number',
'TextareaRows' => 'validate_positive_number',
'TrustedProxies' => 'validate_trusted_proxies');
'CharTextareaCols' => 'PMA_validatePositiveNumber',
'CharTextareaRows' => 'PMA_validatePositiveNumber',
'ExecTimeLimit' => 'PMA_validateNonNegativeNumber',
'Export/sql_max_query_size' => 'PMA_validatePositiveNumber',
'ForeignKeyMaxLimit' => 'PMA_validatePositiveNumber',
'Import/csv_enclosed' => array(array('PMA_validateByRegex', '/^.?$/')),
'Import/csv_escaped' => array(array('PMA_validateByRegex', '/^.$/')),
'Import/csv_terminated' => array(array('PMA_validateByRegex', '/^.$/')),
'Import/ldi_enclosed' => array(array('PMA_validateByRegex', '/^.?$/')),
'Import/ldi_escaped' => array(array('PMA_validateByRegex', '/^.$/')),
'Import/ldi_terminated' => array(array('PMA_validateByRegex', '/^.$/')),
'Import/skip_queries' => 'PMA_validateNonNegativeNumber',
'InsertRows' => 'PMA_validatePositiveNumber',
'NumRecentTables' => 'PMA_validateNonNegativeNumber',
'LimitChars' => 'PMA_validatePositiveNumber',
'LoginCookieValidity' => 'PMA_validatePositiveNumber',
'LoginCookieStore' => 'PMA_validateNonNegativeNumber',
'MaxDbList' => 'PMA_validatePositiveNumber',
'MaxNavigationItems' => 'PMA_validatePositiveNumber',
'MaxCharactersInDisplayedSQL' => 'PMA_validatePositiveNumber',
'MaxRows' => 'PMA_validatePositiveNumber',
'MaxTableList' => 'PMA_validatePositiveNumber',
'MemoryLimit' => array(array('PMA_validateByRegex', '/^\d+(?:[kmg])?$/i')),
'NavigationTreeTableLevel' => 'PMA_validatePositiveNumber',
'QueryHistoryMax' => 'PMA_validatePositiveNumber',
'QueryWindowWidth' => 'PMA_validatePositiveNumber',
'QueryWindowHeight' => 'PMA_validatePositiveNumber',
'RepeatCells' => 'PMA_validateNonNegativeNumber',
'Server' => 'PMA_validateServer',
'Server_pmadb' => 'PMA_validatePMAStorage',
'Servers/1/port' => 'PMA_validatePortNumber',
'Servers/1/hide_db' => 'PMA_validateRegex',
'TextareaCols' => 'PMA_validatePositiveNumber',
'TextareaRows' => 'PMA_validatePositiveNumber',
'TrustedProxies' => 'PMA_validateTrustedProxies');
/**
* Additional validators used for user preferences
*/
$cfg_db['_userValidators'] = array(
'MaxDbList' => array(
array('validate_upper_bound', 'value:MaxDbList')
array('PMA_validateUpperBound', 'value:MaxDbList')
),
'MaxTableList' => array(
array('validate_upper_bound', 'value:MaxTableList')
array('PMA_validateUpperBound', 'value:MaxTableList')
),
'QueryHistoryMax' => array(
array('validate_upper_bound', 'value:QueryHistoryMax')
array('PMA_validateUpperBound', 'value:QueryHistoryMax')
)
);
?>

View File

@ -310,8 +310,8 @@ class FormDisplay
Form $form, $field, $system_path, $work_path,
$translated_path, $show_restore_default, $userprefs_allow, array &$js_default
) {
$name = PMA_lang_name($system_path);
$description = PMA_lang_name($system_path, 'desc', '');
$name = PMA_langName($system_path);
$description = PMA_langName($system_path, 'desc', '');
$cf = ConfigFile::getInstance();
$value = $cf->get($work_path);
@ -327,7 +327,7 @@ class FormDisplay
'wiki' => $this->getWikiLink($system_path),
'show_restore_default' => $show_restore_default,
'userprefs_allow' => $userprefs_allow,
'userprefs_comment' => PMA_lang_name($system_path, 'cmt', ''));
'userprefs_comment' => PMA_langName($system_path, 'cmt', ''));
if (isset($form->default[$system_path])) {
$opts['setvalue'] = $form->default[$system_path];
}
@ -426,7 +426,7 @@ class FormDisplay
foreach ($this->_errors as $system_path => $error_list) {
if (isset($this->_systemPaths[$system_path])) {
$path = $this->_systemPaths[$system_path];
$name = PMA_lang_name($path);
$name = PMA_langName($path);
} else {
$name = $GLOBALS["strConfigForm_$system_path"];
}
@ -539,7 +539,7 @@ class FormDisplay
} else {
$this->_errors[$form->name][] = sprintf(
__('Missing data for %s'),
'<i>' . PMA_lang_name($system_path) . '</i>'
'<i>' . PMA_langName($system_path) . '</i>'
);
$result = false;
continue;

View File

@ -41,7 +41,7 @@ function PMA_lang($lang_key, $args = null)
*
* @return string
*/
function PMA_lang_name($canonical_path, $type = 'name', $default = 'key')
function PMA_langName($canonical_path, $type = 'name', $default = 'key')
{
$lang_key = str_replace(
array('Servers/1/', '/'),

View File

@ -155,7 +155,7 @@ function PMA_null_error_handler()
*
* @return void
*/
function test_php_errormsg($start = true)
function PMA_testPHPErrorMsg($start = true)
{
static $old_html_errors, $old_track_errors, $old_error_reporting;
static $old_display_errors;
@ -193,7 +193,7 @@ function test_php_errormsg($start = true)
*
* @return bool|array
*/
function test_db_connection(
function PMA_testDBConnection(
$extension,
$connect_type,
$host,
@ -203,7 +203,7 @@ function test_db_connection(
$pass = null,
$error_key = 'Server'
) {
// test_php_errormsg();
// PMA_testPHPErrorMsg();
$socket = empty($socket) || $connect_type == 'tcp' ? null : $socket;
$port = empty($port) || $connect_type == 'socket' ? null : ':' . $port;
$error = null;
@ -251,7 +251,7 @@ function test_db_connection(
mysqli_close($conn);
}
}
// test_php_errormsg(false);
// PMA_testPHPErrorMsg(false);
if (isset($php_errormsg)) {
$error .= " - $php_errormsg";
}
@ -266,7 +266,7 @@ function test_db_connection(
*
* @return array
*/
function validate_server($path, $values)
function PMA_validateServer($path, $values)
{
$result = array(
'Server' => '',
@ -302,7 +302,7 @@ function validate_server($path, $values)
if (! $error && $values['Servers/1/auth_type'] == 'config') {
$password = $values['Servers/1/nopassword'] ? null
: $values['Servers/1/password'];
$test = test_db_connection(
$test = PMA_testDBConnection(
$values['Servers/1/extension'],
$values['Servers/1/connect_type'],
$values['Servers/1/host'],
@ -327,7 +327,7 @@ function validate_server($path, $values)
*
* @return array
*/
function validate_pmadb($path, $values)
function PMA_validatePMAStorage($path, $values)
{
$result = array(
'Server_pmadb' => '',
@ -352,7 +352,7 @@ function validate_pmadb($path, $values)
$error = true;
}
if (! $error) {
$test = test_db_connection(
$test = PMA_testDBConnection(
$values['Servers/1/extension'], $values['Servers/1/connect_type'],
$values['Servers/1/host'], $values['Servers/1/port'],
$values['Servers/1/socket'], $values['Servers/1/controluser'],
@ -374,7 +374,7 @@ function validate_pmadb($path, $values)
*
* @return array
*/
function validate_regex($path, $values)
function PMA_validateRegex($path, $values)
{
$result = array($path => '');
@ -382,14 +382,14 @@ function validate_regex($path, $values)
return $result;
}
test_php_errormsg();
PMA_testPHPErrorMsg();
$matches = array();
// in libraries/List_Database.class.php _checkHideDatabase(),
// a '/' is used as the delimiter for hide_db
preg_match('/' . $values[$path] . '/', '', $matches);
test_php_errormsg(false);
PMA_testPHPErrorMsg(false);
if (isset($php_errormsg)) {
$error = preg_replace('/^preg_match\(\): /', '', $php_errormsg);
@ -407,7 +407,7 @@ function validate_regex($path, $values)
*
* @return array
*/
function validate_trusted_proxies($path, $values)
function PMA_validateTrustedProxies($path, $values)
{
$result = array($path => array());
@ -461,7 +461,7 @@ function validate_trusted_proxies($path, $values)
*
* @return string empty string if test is successful
*/
function test_number(
function PMA_validateNumber(
$path,
$values,
$allow_neg,
@ -492,10 +492,10 @@ function test_number(
*
* @return array
*/
function validate_port_number($path, $values)
function PMA_validatePortNumber($path, $values)
{
return array(
$path => test_number(
$path => PMA_validateNumber(
$path,
$values,
false,
@ -514,10 +514,10 @@ function validate_port_number($path, $values)
*
* @return array
*/
function validate_positive_number($path, $values)
function PMA_validatePositiveNumber($path, $values)
{
return array(
$path => test_number(
$path => PMA_validateNumber(
$path,
$values,
false,
@ -536,10 +536,10 @@ function validate_positive_number($path, $values)
*
* @return array
*/
function validate_non_negative_number($path, $values)
function PMA_validateNonNegativeNumber($path, $values)
{
return array(
$path => test_number(
$path => PMA_validateNumber(
$path,
$values,
false,
@ -560,7 +560,7 @@ function validate_non_negative_number($path, $values)
*
* @return array
*/
function validate_by_regex($path, $values, $regex)
function PMA_validateByRegex($path, $values, $regex)
{
$result = preg_match($regex, $values[$path]);
return array($path => ($result ? '' : __('Incorrect value')));
@ -575,7 +575,7 @@ function validate_by_regex($path, $values, $regex)
*
* @return array
*/
function validate_upper_bound($path, $values, $max_value)
function PMA_validateUpperBound($path, $values, $max_value)
{
$result = $values[$path] <= $max_value;
return array($path => ($result ? ''

View File

@ -347,7 +347,7 @@ function PMA_importGetNextChunk($size = 32768)
$GLOBALS['offset'] += $size;
if ($charset_conversion) {
return PMA_convert_string($charset_of_file, 'utf-8', $result);
return PMA_convertString($charset_of_file, 'utf-8', $result);
} else {
/**
* Skip possible byte order marks (I do not think we need more

View File

@ -340,7 +340,7 @@ function perform_config_checks()
// should be enabled if possible
//
if (!$cf->getValue("Servers/$i/ssl")) {
$title = PMA_lang(PMA_lang_name('Servers/1/ssl')) . " ($server_name)";
$title = PMA_lang(PMA_langName('Servers/1/ssl')) . " ($server_name)";
messages_set(
'notice',
"Servers/$i/ssl",
@ -354,7 +354,7 @@ function perform_config_checks()
// warn about using 'mysql'
//
if ($cf->getValue("Servers/$i/extension") == 'mysql') {
$title = PMA_lang(PMA_lang_name('Servers/1/extension'))
$title = PMA_lang(PMA_langName('Servers/1/extension'))
. " ($server_name)";
messages_set(
'notice',
@ -372,7 +372,7 @@ function perform_config_checks()
&& $cf->getValue("Servers/$i/user") != ''
&& $cf->getValue("Servers/$i/password") != ''
) {
$title = PMA_lang(PMA_lang_name('Servers/1/auth_type'))
$title = PMA_lang(PMA_langName('Servers/1/auth_type'))
. " ($server_name)";
messages_set(
'notice',
@ -391,7 +391,7 @@ function perform_config_checks()
if ($cf->getValue("Servers/$i/AllowRoot")
&& $cf->getValue("Servers/$i/AllowNoPassword")
) {
$title = PMA_lang(PMA_lang_name('Servers/1/AllowNoPassword'))
$title = PMA_lang(PMA_langName('Servers/1/AllowNoPassword'))
. " ($server_name)";
messages_set(
'notice',
@ -413,7 +413,7 @@ function perform_config_checks()
messages_set(
'notice',
'blowfish_secret_created',
PMA_lang(PMA_lang_name('blowfish_secret')),
PMA_lang(PMA_langName('blowfish_secret')),
$strBlowfishSecretMsg
);
} else {
@ -434,7 +434,7 @@ function perform_config_checks()
messages_set(
'error',
'blowfish_warnings' . count($blowfish_warnings),
PMA_lang(PMA_lang_name('blowfish_secret')),
PMA_lang(PMA_langName('blowfish_secret')),
implode('<br />', $blowfish_warnings)
);
}
@ -449,7 +449,7 @@ function perform_config_checks()
messages_set(
'notice',
'ForceSSL',
PMA_lang(PMA_lang_name('ForceSSL')),
PMA_lang(PMA_langName('ForceSSL')),
PMA_lang($strForceSSLNotice)
);
}
@ -462,7 +462,7 @@ function perform_config_checks()
messages_set(
'notice',
'AllowArbitraryServer',
PMA_lang(PMA_lang_name('AllowArbitraryServer')),
PMA_lang(PMA_langName('AllowArbitraryServer')),
PMA_lang($strAllowArbitraryServerWarning)
);
}
@ -480,7 +480,7 @@ function perform_config_checks()
messages_set(
$message_type,
'LoginCookieValidity',
PMA_lang(PMA_lang_name('LoginCookieValidity')),
PMA_lang(PMA_langName('LoginCookieValidity')),
PMA_lang($strLoginCookieValidityWarning)
);
}
@ -493,7 +493,7 @@ function perform_config_checks()
messages_set(
'notice',
'LoginCookieValidity',
PMA_lang(PMA_lang_name('LoginCookieValidity')),
PMA_lang(PMA_langName('LoginCookieValidity')),
PMA_lang($strLoginCookieValidityWarning2)
);
}
@ -509,7 +509,7 @@ function perform_config_checks()
messages_set(
'error',
'LoginCookieValidity',
PMA_lang(PMA_lang_name('LoginCookieValidity')),
PMA_lang(PMA_langName('LoginCookieValidity')),
PMA_lang($strLoginCookieValidityWarning3)
);
}
@ -522,7 +522,7 @@ function perform_config_checks()
messages_set(
'notice',
'SaveDir',
PMA_lang(PMA_lang_name('SaveDir')),
PMA_lang(PMA_langName('SaveDir')),
PMA_lang($strDirectoryNotice)
);
}
@ -535,7 +535,7 @@ function perform_config_checks()
messages_set(
'notice',
'TempDir',
PMA_lang(PMA_lang_name('TempDir')),
PMA_lang(PMA_langName('TempDir')),
PMA_lang($strDirectoryNotice)
);
}
@ -550,7 +550,7 @@ function perform_config_checks()
messages_set(
'error',
'GZipDump',
PMA_lang(PMA_lang_name('GZipDump')),
PMA_lang(PMA_langName('GZipDump')),
PMA_lang($strGZipDumpWarning, 'gzencode')
);
}
@ -571,7 +571,7 @@ function perform_config_checks()
messages_set(
'error',
'BZipDump',
PMA_lang(PMA_lang_name('BZipDump')),
PMA_lang(PMA_langName('BZipDump')),
PMA_lang($strBZipDumpWarning, $functions)
);
}
@ -584,7 +584,7 @@ function perform_config_checks()
messages_set(
'error',
'ZipDump_import',
PMA_lang(PMA_lang_name('ZipDump')),
PMA_lang(PMA_langName('ZipDump')),
PMA_lang($strZipDumpImportWarning, 'zip_open')
);
}
@ -597,7 +597,7 @@ function perform_config_checks()
messages_set(
'error',
'ZipDump_export',
PMA_lang(PMA_lang_name('ZipDump')),
PMA_lang(PMA_langName('ZipDump')),
PMA_lang($strZipDumpExportWarning, 'gzcompress')
);
}