diff --git a/browse_foreigners.php b/browse_foreigners.php index b6f2d8b4c9..376a3ca025 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -150,37 +150,32 @@ EOC; $header->getScripts()->addCode($code); -?> -
-
- - - - - - - - - - - - - - - - - -
-
+// HTML output +$output = '
' + . '
' + . PMA_generate_common_hidden_inputs($db, $table) + . '' + . ''; + +if (isset($rownumber)) { + $output .= ''; +} +$output .= '' + . '' + . '' + . '' + . '' + . '' . $gotopage . '' + . '' . $showall . '' + . '
' + . '
'; + +$output .= ''; -
- @@ -190,9 +185,9 @@ if (is_array($foreignData['disp_row'])) { '; - echo '' . $header . '' . "\n" - .'' . $header . '' . "\n" - .'' . "\n"; + $output .= '' . $header . '' . "\n" + . '' . $header . '' . "\n" + . '' . "\n"; $values = array(); $keys = array(); @@ -217,7 +212,7 @@ if (is_array($foreignData['disp_row'])) { $hcount++; if ($cfg['RepeatCells'] > 0 && $hcount > $cfg['RepeatCells']) { - echo $header; + $output .= $header; $hcount = 0; $odd_row = true; } @@ -265,21 +260,23 @@ if (is_array($foreignData['disp_row'])) { $key_ordered_current_equals_data = $key_ordered_current_key == $data; } - ?> - - '; + $odd_row = ! $odd_row; + + $output .= ' - '; + + $output .= ' - + . ($key_ordered_current_equals_data ? '' : '') + . ''; - '; + + $output .= ' - - - ' : '') + . ''; + + $output .= ''; + $output .= ''; } // end while } + +$output .= '' + . '
' . __('Keyname') . '' . __('Keyname') . '
- ' : '') + $output .= '
' + . ($key_ordered_current_equals_data ? '' : '') . '' . htmlspecialchars($key_ordered_current_key) - . '' . ($key_ordered_current_equals_data ? '' : ''); - ?> - ' : '') + . '' . ($key_ordered_current_equals_data ? '' : '') + . '' + . ($key_ordered_current_equals_data ? '' : '') . '' . $key_ordered_current_val . '' - . ($key_ordered_current_equals_data ? '' : ''); - ?> - - ' : '') + $output .= '' + . '' + . ($val_ordered_current_equals_data ? '' : '') . '' . $val_ordered_current_val . '' - . ($val_ordered_current_equals_data ? '' : ''); - ?> - ' : '') . '' - . htmlspecialchars($val_ordered_current_key) - . '' . ($val_ordered_current_equals_data ? '' : ''); - ?>
' + . ($val_ordered_current_equals_data ? '' : '') + . '' + . htmlspecialchars($val_ordered_current_key) + . '' . ($val_ordered_current_equals_data ? '' : '') + . '
'; + +$response->addHtml($output); ?> - - diff --git a/server_variables.php b/server_variables.php index 7984009f42..1d39e0116e 100644 --- a/server_variables.php +++ b/server_variables.php @@ -1,6 +1,7 @@ formatByteDown($varValue[1], 3, 3))); + exit( + implode( + ' ', $common_functions->formatByteDown($varValue[1], 3, 3) + ) + ); } exit($varValue[1]); break; @@ -56,10 +61,24 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { if (isset($VARIABLE_DOC_LINKS[$_REQUEST['varName']][3]) && $VARIABLE_DOC_LINKS[$_REQUEST['varName']][3] == 'byte' - && preg_match('/^\s*(\d+(\.\d+)?)\s*(mb|kb|mib|kib|gb|gib)\s*$/i', $value, $matches) + && preg_match( + '/^\s*(\d+(\.\d+)?)\s*(mb|kb|mib|kib|gb|gib)\s*$/i', + $value, + $matches + ) ) { - $exp = array('kb' => 1, 'kib' => 1, 'mb' => 2, 'mib' => 2, 'gb' => 3, 'gib' => 3); - $value = floatval($matches[1]) * $common_functions->pow(1024, $exp[strtolower($matches[3])]); + $exp = array( + 'kb' => 1, + 'kib' => 1, + 'mb' => 2, + 'mib' => 2, + 'gb' => 3, + 'gib' => 3 + ); + $value = floatval($matches[1]) * $common_functions->pow( + 1024, + $exp[strtolower($matches[3])] + ); } else { $value = $common_functions->sqlAddSlashes($value); } @@ -70,12 +89,15 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { $response = PMA_Response::getInstance(); if (! preg_match("/[^a-zA-Z0-9_]+/", $_REQUEST['varName']) - && PMA_DBI_query('SET GLOBAL ' . $_REQUEST['varName'] . ' = ' . $value) + && PMA_DBI_query( + 'SET GLOBAL ' . $_REQUEST['varName'] . ' = ' . $value + ) ) { // Some values are rounded down etc. $varValue = PMA_DBI_fetch_single_row( 'SHOW GLOBAL VARIABLES WHERE Variable_name="' - . $common_functions->sqlAddSlashes($_REQUEST['varName']) . '";', 'NUM' + . $common_functions->sqlAddSlashes($_REQUEST['varName']) + . '";', 'NUM' ); $response->addJSON( 'variable', @@ -97,10 +119,12 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { /** * Displays the sub-page heading */ -echo '

' . $common_functions->getImage('s_vars.png') - . '' . __('Server variables and settings') . "\n" - . $common_functions->showMySQLDocu('server_system_variables', 'server_system_variables') - . '

' . "\n"; +$output = '

' . $common_functions->getImage('s_vars.png') + . '' . __('Server variables and settings') . "\n" + . $common_functions->showMySQLDocu( + 'server_system_variables', 'server_system_variables' + ) + . '

' . "\n"; /** * Sends the queries and buffers the results @@ -112,59 +136,76 @@ $serverVars = PMA_DBI_fetch_result('SHOW GLOBAL VARIABLES;', 0, 1); /** * Displays the page */ -?> - - - - - - - - - -' + . '' . __('Filters') . '' + . '
' + . '' + . '' + . '
' + . ''; + +$output .= '
- -
' + . '' + . '' + . '' + . '' + . '' + . '' + . ''; + $odd_row = true; foreach ($serverVars as $name => $value) { - $has_session_value = isset($serverVarsSession[$name]) && $serverVarsSession[$name] != $value; - $row_class = ($odd_row ? 'odd' : 'even') . ' ' . ($has_session_value ? 'diffSession' : ''); - ?> - - - - ' + . '' + . ' - '; + if ($has_session_value) { - ?> - - - - - - - - ' + . '' + . '' + . '' + . ''; + } + + $output .= ''; $odd_row = ! $odd_row; } -?> - -
' . __('Variable') . '' + . __('Session value') . ' / ' . __('Global value') + . '' . __('Documentation') . '
' + . '' . htmlspecialchars(str_replace('_', ' ', $name)) + . '' . formatVariable($name, $value) . ''; + // To display variable documentation link if (isset($VARIABLE_DOC_LINKS[$name])) { - echo $common_functions->showMySQLDocu($VARIABLE_DOC_LINKS[$name][1], $VARIABLE_DOC_LINKS[$name][1], false, $VARIABLE_DOC_LINKS[$name][2] . '_' . $VARIABLE_DOC_LINKS[$name][0]); + $output .= $common_functions->showMySQLDocu( + $VARIABLE_DOC_LINKS[$name][1], + $VARIABLE_DOC_LINKS[$name][1], + false, + $VARIABLE_DOC_LINKS[$name][2] . '_' . $VARIABLE_DOC_LINKS[$name][0] + ); } - ?>
()
(' . __('Session value') . ')' . formatVariable($name, $serverVarsSession[$name]) + . '
-' + . ''; +$response->addHtml($output); + +/** + * Format Variable + * + * @param string $name variable name + * @param numeric $value variable value + * + * @return formatted string + */ function formatVariable($name, $value) { global $VARIABLE_DOC_LINKS; @@ -175,7 +216,8 @@ function formatVariable($name, $value) if (isset($VARIABLE_DOC_LINKS[$name][3]) && $VARIABLE_DOC_LINKS[$name][3]=='byte' ) { - return '' + return '' . implode(' ', $common_functions->formatByteDown($value, 3, 3)) . ''; } else {