From f28b61e1cb5e118bce4fea41e5fc4639ce041819 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 8 Jan 2003 15:21:11 +0000 Subject: [PATCH] Beautified generated XHTML code --- ChangeLog | 4 ++++ libraries/url_generating.lib.php3 | 22 +++++++++++++++------- server_privileges.php3 | 12 ++++++------ 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index f26326839..3696aab6a 100755 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,10 @@ $Source$ 2003-01-08 Alexander M. Turek * lang/english-*.inc.php3: Fixed a typo. + * server_privileges.php3, libraries/url_generating.lib.php3: + - Beautified generated XHTML code; + - Coding standards; + - Added a missing @param comment. 2003-01-07 Michal Cihar * lang/czech: Updated. diff --git a/libraries/url_generating.lib.php3 b/libraries/url_generating.lib.php3 index 0d2f66894..21271f7d2 100644 --- a/libraries/url_generating.lib.php3 +++ b/libraries/url_generating.lib.php3 @@ -16,6 +16,7 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){ * * @param string optional database name * @param string optional table name + * @param int indenting level * * @return string string with input fields * @@ -29,27 +30,34 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){ * * @author nijel */ - function PMA_generate_common_hidden_inputs ($db = '', $table = '') + function PMA_generate_common_hidden_inputs ($db = '', $table = '', $indent = 0) { global $lang, $convcharset, $server; global $cfg, $allow_recoding; - $result = '' . "\n" . - '' . "\n"; + $spaces = ''; + for ($i = 0; $i < $indent; $i++) { + $spaces .= ' '; + } + + $result = $spaces . '' . "\n" + . $spaces . '' . "\n"; if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding) - $result .= '' . "\n"; + $result .= $spaces . '' . "\n"; if (!empty($db)) - $result .= ''; + $result .= $spaces . '' . "\n"; if (!empty($table)) - $result .= ''; + $result .= $spaces . '' . "\n"; return $result; } - + /** * Generates text with URL parameters. * * @param string optional database name * @param string optional table name + * @param string character to use instead of '&' for deviding + * multiple URL parameters from each other * * @return string string with URL parameters * diff --git a/server_privileges.php3 b/server_privileges.php3 index 3f9c8175f..f7f720344 100644 --- a/server_privileges.php3 +++ b/server_privileges.php3 @@ -591,7 +591,7 @@ if (empty($adduser)) { . '
' . "\n"; } echo '
' . "\n"; - echo PMA_generate_common_hidden_inputs(); + echo PMA_generate_common_hidden_inputs('', '', 1); echo ' ' . "\n" . ' ' . "\n" . ' ' . "\n" @@ -687,7 +687,7 @@ if (empty($adduser)) { echo '
    ' . "\n" . '
  • ' . "\n" . ' ' . "\n"; - echo PMA_generate_common_hidden_inputs(); + echo PMA_generate_common_hidden_inputs('', '', 3); echo ' ' . "\n"; if ($hostname != '%') { echo ' ' . "\n"; @@ -800,7 +800,7 @@ if (empty($adduser)) { echo '
' . "\n" . '
' . "\n" . ' ' . "\n"; - echo PMA_generate_common_hidden_inputs(); + echo PMA_generate_common_hidden_inputs('', '', 6); echo ' ' . "\n"; if ($hostname != '%') { echo ' ' . "\n"; @@ -823,7 +823,7 @@ if (empty($adduser)) { if (empty($dbname)) { echo '
  • ' . "\n" . ' ' . "\n"; - echo PMA_generate_common_hidden_inputs(); + echo PMA_generate_common_hidden_inputs('', '', 3); echo ' ' . "\n"; if ($hostname != '%') { echo ' ' . "\n"; @@ -863,7 +863,7 @@ if (empty($adduser)) { . ' ' . $strAddUser . "\n" . '' . "\n" . '' . "\n"; - echo PMA_generate_common_hidden_inputs(); + echo PMA_generate_common_hidden_inputs('', '', 1); echo ' ' . "\n" . ' ' . "\n" . '
    ' . "\n" @@ -964,4 +964,4 @@ if (empty($adduser)) { */ require('./footer.inc.php3'); -?> +?> \ No newline at end of file