diff options
author | Chanaka Indrajith <pe.chanaka.ck@gmail.com> | 2012-06-22 22:08:33 +0400 |
---|---|---|
committer | Chanaka Indrajith <pe.chanaka.ck@gmail.com> | 2012-06-22 22:08:33 +0400 |
commit | 766466135e0e4dcca26744e72fc277a3d8f05d11 (patch) | |
tree | b04788e750c9cce728ae58b2ca7893dc3c000db8 /server_variables.php | |
parent | b214b9807b4c050d64ae3135d5dd2b77f4f5b631 (diff) |
Implement class behavior of common.lib.php file
Diffstat (limited to 'server_variables.php')
-rw-r--r-- | server_variables.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/server_variables.php b/server_variables.php index 59a3238bfa..6266c5bd25 100644 --- a/server_variables.php +++ b/server_variables.php @@ -11,6 +11,7 @@ $response = PMA_Response::getInstance(); $header = $response->getHeader(); $scripts = $header->getScripts(); $scripts->addFile('server_variables.js'); +$common_functions = PMA_CommonFunctions::getInstance(); PMA_addJSVar('pma_token', $_SESSION[' PMA_token ']); PMA_addJSVar('url_query', str_replace('&', '&', PMA_generate_common_url($db))); @@ -44,7 +45,7 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { if (isset($VARIABLE_DOC_LINKS[$_REQUEST['varName']][3]) && $VARIABLE_DOC_LINKS[$_REQUEST['varName']][3] == 'byte' ) { - exit(implode(' ', PMA_formatByteDown($varValue[1], 3, 3))); + exit(implode(' ', $common_functions->formatByteDown($varValue[1], 3, 3))); } exit($varValue[1]); break; @@ -57,7 +58,7 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { && 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]) * pow(1024, $exp[strtolower($matches[3])]); + $value = floatval($matches[1]) * $common_functions->pow(1024, $exp[strtolower($matches[3])]); } else { $value = PMA_sqlAddslashes($value); } @@ -95,9 +96,9 @@ if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) { /** * Displays the sub-page heading */ -echo '<h2>' . PMA_getImage('s_vars.png') +echo '<h2>' . $common_functions->getImage('s_vars.png') . '' . __('Server variables and settings') . "\n" - . PMA_showMySQLDocu('server_system_variables', 'server_system_variables') + . $common_functions->showMySQLDocu('server_system_variables', 'server_system_variables') . '</h2>' . "\n"; /** @@ -142,7 +143,7 @@ foreach ($serverVars as $name => $value) { <td class="value"><?php // To display variable documentation link if (isset($VARIABLE_DOC_LINKS[$name])) { - echo PMA_showMySQLDocu($VARIABLE_DOC_LINKS[$name][1], $VARIABLE_DOC_LINKS[$name][1], false, $VARIABLE_DOC_LINKS[$name][2] . '_' . $VARIABLE_DOC_LINKS[$name][0]); + 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]); } ?></td> <?php @@ -166,12 +167,14 @@ foreach ($serverVars as $name => $value) { function formatVariable($name, $value) { global $VARIABLE_DOC_LINKS; + + $common_functions = PMA_CommonFunctions::getInstance(); if (is_numeric($value)) { if (isset($VARIABLE_DOC_LINKS[$name][3]) && $VARIABLE_DOC_LINKS[$name][3]=='byte') { - return '<abbr title="'.PMA_formatNumber($value, 0).'">'.implode(' ', PMA_formatByteDown($value, 3, 3)).'</abbr>'; + return '<abbr title="'.$common_functions->formatNumber($value, 0).'">'.implode(' ', $common_functions->formatByteDown($value, 3, 3)).'</abbr>'; } else { - return PMA_formatNumber($value, 0); + return $common_functions->formatNumber($value, 0); } } return htmlspecialchars($value); |