Beautified generated XHTML code

This commit is contained in:
Alexander M. Turek
2003-01-08 15:21:11 +00:00
parent 14e6e85747
commit f28b61e1cb
3 changed files with 25 additions and 13 deletions

View File

@@ -19,6 +19,10 @@ $Source$
2003-01-08 Alexander M. Turek <rabus@users.sourceforge.net>
* 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 <nijel@users.sourceforge.net>
* lang/czech: Updated.

View File

@@ -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,19 +30,24 @@ 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 = '<input type="hidden" name="lang" value="' . $lang . '" />' . "\n" .
'<input type="hidden" name="server" value="' . $server . '" />' . "\n";
$spaces = '';
for ($i = 0; $i < $indent; $i++) {
$spaces .= ' ';
}
$result = $spaces . '<input type="hidden" name="lang" value="' . $lang . '" />' . "\n"
. $spaces . '<input type="hidden" name="server" value="' . $server . '" />' . "\n";
if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] && $allow_recoding)
$result .= '<input type="hidden" name="convcharset" value="' . $convcharset . '" />' . "\n";
$result .= $spaces . '<input type="hidden" name="convcharset" value="' . $convcharset . '" />' . "\n";
if (!empty($db))
$result .= '<input type="hidden" name="db" value="'.htmlspecialchars($db).'" />';
$result .= $spaces . '<input type="hidden" name="db" value="'.htmlspecialchars($db).'" />' . "\n";
if (!empty($table))
$result .= '<input type="hidden" name="table" value="'.htmlspecialchars($table).'" />';
$result .= $spaces . '<input type="hidden" name="table" value="'.htmlspecialchars($table).'" />' . "\n";
return $result;
}
@@ -50,6 +56,8 @@ if (!defined('PMA_URL_GENERATION_LIB_INCLUDED')){
*
* @param string optional database name
* @param string optional table name
* @param string character to use instead of '&amp;' for deviding
* multiple URL parameters from each other
*
* @return string string with URL parameters
*

View File

@@ -591,7 +591,7 @@ if (empty($adduser)) {
. '</div><br />' . "\n";
}
echo '<form name="usersForm" action="server_privileges.php3" method="post" />' . "\n";
echo PMA_generate_common_hidden_inputs();
echo PMA_generate_common_hidden_inputs('', '', 1);
echo ' <table border="0">' . "\n"
. ' <tr>' . "\n"
. ' <th></th>' . "\n"
@@ -687,7 +687,7 @@ if (empty($adduser)) {
echo '<ul>' . "\n"
. ' <li>' . "\n"
. ' <form action="server_privileges.php3" method="post">' . "\n";
echo PMA_generate_common_hidden_inputs();
echo PMA_generate_common_hidden_inputs('', '', 3);
echo ' <input type="hidden" name="username" value="' . htmlspecialchars($username) . '" />' . "\n";
if ($hostname != '%') {
echo ' <input type="hidden" name="hostname" value="' . htmlspecialchars($hostname) . '" />' . "\n";
@@ -800,7 +800,7 @@ if (empty($adduser)) {
echo ' <tr>' . "\n"
. ' <td colspan="' .(PMA_MYSQL_INT_VERSION >= 32211 ? '5' : '4') . '">' . "\n"
. ' <form action="server_privileges.php3" method="post">' . "\n";
echo PMA_generate_common_hidden_inputs();
echo PMA_generate_common_hidden_inputs('', '', 6);
echo ' <input type="hidden" name="username" value="' . htmlspecialchars($username) . '" />' . "\n";
if ($hostname != '%') {
echo ' <input type="hidden" name="hostname" value="' . htmlspecialchars($hostname) . '" />' . "\n";
@@ -823,7 +823,7 @@ if (empty($adduser)) {
if (empty($dbname)) {
echo ' <li>' . "\n"
. ' <form action="server_privileges.php3" method="post" onsubmit="checkPassword(this);">' . "\n";
echo PMA_generate_common_hidden_inputs();
echo PMA_generate_common_hidden_inputs('', '', 3);
echo ' <input type="hidden" name="username" value="' . htmlspecialchars($username) . '" />' . "\n";
if ($hostname != '%') {
echo ' <input type="hidden" name="hostname" value="' . htmlspecialchars($hostname) . '" />' . "\n";
@@ -863,7 +863,7 @@ if (empty($adduser)) {
. ' ' . $strAddUser . "\n"
. '</h2>' . "\n"
. '<form action="server_privileges.php3" method="post" onsubmit="return checkAddUser(this);">' . "\n";
echo PMA_generate_common_hidden_inputs();
echo PMA_generate_common_hidden_inputs('', '', 1);
echo ' <table border="0">' . "\n"
. ' <tr>' . "\n"
. ' <th colspan="3">' . "\n"