From ace55ed14293d6cd84ba44d9e30c483ae7f0de8f Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Sat, 11 Jul 2009 20:30:40 +0000 Subject: [PATCH] HTML instead of XHTML git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@803 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/call.inc.php | 13 +++--- adminer/coverage.inc.php | 8 ++-- adminer/create.inc.php | 39 +++++++--------- adminer/createv.inc.php | 13 +++--- adminer/database.inc.php | 13 +++--- adminer/db.inc.php | 47 +++++++++---------- adminer/dump.inc.php | 28 +++++------ adminer/edit.inc.php | 17 ++++--- adminer/event.inc.php | 23 +++++---- adminer/foreign.inc.php | 28 +++++------ adminer/include/adminer.inc.php | 29 ++++++------ adminer/include/auth.inc.php | 12 ++--- adminer/include/connect.inc.php | 6 +-- adminer/include/design.inc.php | 23 ++++----- adminer/include/editing.inc.php | 50 ++++++++++---------- adminer/include/export.inc.php | 4 +- adminer/include/functions.inc.php | 29 ++++++------ adminer/include/lang.inc.php | 4 +- adminer/indexes.inc.php | 17 ++++--- adminer/privileges.inc.php | 18 +++---- adminer/procedure.inc.php | 15 +++--- adminer/processlist.inc.php | 9 ++-- adminer/schema.inc.php | 4 +- adminer/select.inc.php | 78 +++++++++++++++---------------- adminer/sql.inc.php | 26 +++++------ adminer/table.inc.php | 20 ++++---- adminer/trigger.inc.php | 17 ++++--- adminer/user.inc.php | 28 ++++++----- adminer/variables.inc.php | 5 +- adminer/view.inc.php | 2 +- editor/include/adminer.inc.php | 10 ++-- 31 files changed, 297 insertions(+), 338 deletions(-) diff --git a/adminer/call.inc.php b/adminer/call.inc.php index 8974d946..5d2e1475 100644 --- a/adminer/call.inc.php +++ b/adminer/call.inc.php @@ -29,14 +29,14 @@ if (!$error && $_POST) { } $result = $dbh->multi_query((isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($_GET["call"]) . "(" . implode(", ", $call) . ")"); if (!$result) { - echo "

" . htmlspecialchars($dbh->error) . "

\n"; + echo "

" . htmlspecialchars($dbh->error) . "\n"; } else { do { $result = $dbh->store_result(); if (is_object($result)) { select($result); } else { - echo "

" . lang('Routine has been called, %d row(s) affected.', $dbh->affected_rows) . "

\n"; + echo "

" . lang('Routine has been called, %d row(s) affected.', $dbh->affected_rows) . "\n"; } } while ($dbh->next_result()); if ($out) { @@ -52,19 +52,18 @@ if ($in) { echo "\n"; foreach ($in as $key) { $field = $routine["fields"][$key]; - echo ""; + echo "\n"; + echo "\n"; } echo "
" . htmlspecialchars($field["field"]) . "
" . htmlspecialchars($field["field"]); $value = $_POST["fields"][$key]; if (strlen($value) && ($field["type"] == "enum" || $field["type"] == "set")) { $value = intval($value); } input($key, $field, $value); // param name can be empty - echo "
\n"; } ?>

- - -

+ + diff --git a/adminer/coverage.inc.php b/adminer/coverage.inc.php index dc0bbf4e..eef900ac 100644 --- a/adminer/coverage.inc.php +++ b/adminer/coverage.inc.php @@ -19,7 +19,7 @@ if ($_GET["coverage"] === "0") { unset($_SESSION["coverage"]); // disable coverage if it is not available if (extension_loaded("xdebug")) { $_SESSION["coverage"] = array(); - echo "

Coverage started.

\n"; + echo "

Coverage started.\n"; } } elseif (preg_match('~^(include/)?[-_.a-z0-9]+$~i', $_GET["coverage"])) { // highlight single file @@ -49,7 +49,7 @@ if ($_GET["coverage"] === "0") { $s = ($open_tags ? "<" . implode("><", $open_tags) . ">" : ""); $prev_color = $color; } - $s .= "$line
\n"; + $s .= "$line
\n"; } } else { // display list of files @@ -61,10 +61,10 @@ if ($_GET["coverage"] === "0") { $values = array_count_values($cov); $ratio = round(100 - 100 * $values[-1] / count($cov)); } - echo "$ratio%$filename\n"; + echo "$ratio%$filename\n"; } echo "\n"; - echo '

Start new coverage

' . "\n"; + echo '

Start new coverage' . "\n"; } page_footer("auth"); exit; diff --git a/adminer/create.inc.php b/adminer/create.inc.php index 2c727112..7984f981 100644 --- a/adminer/create.inc.php +++ b/adminer/create.inc.php @@ -127,50 +127,45 @@ $collations = collations(); $suhosin = floor(extension_loaded("suhosin") ? (min(ini_get("suhosin.request.max_vars"), ini_get("suhosin.post.max_vars")) - 13) / 8 : 0); if ($suhosin && count($row["fields"]) > $suhosin) { - echo "

" . htmlspecialchars(lang('Maximum number of allowed fields exceeded. Please increase %s and %s.', 'suhosin.post.max_vars', 'suhosin.request.max_vars')) . "

\n"; + echo "

" . htmlspecialchars(lang('Maximum number of allowed fields exceeded. Please increase %s and %s.', 'suhosin.post.max_vars', 'suhosin.request.max_vars')) . "\n"; } ?>

-: " /> - - - -

+: "> + + +

-: " /> -: " maxlength="60" /> +: "> +: " maxlength="60"> -

- - - /> -

+ + +> server_info >= 5.1) { $partition_table = ereg('RANGE|LIST', $row["partition_by"]); ?>

- -(" />) -: " /> -

+ +(">) +: "> > - + $val) { echo ''; - echo ''; - echo ''; - echo "\n"; + echo ' diff --git a/adminer/createv.inc.php b/adminer/createv.inc.php index 6222016d..2e5a1ef4 100644 --- a/adminer/createv.inc.php +++ b/adminer/createv.inc.php @@ -21,12 +21,11 @@ if ($_POST) { ?> -

+

- - -: " maxlength="64" /> - - /> -

+ + +: " maxlength="64"> + +> diff --git a/adminer/database.inc.php b/adminer/database.inc.php index 5f9780c7..85778c3a 100644 --- a/adminer/database.inc.php +++ b/adminer/database.inc.php @@ -69,16 +69,15 @@ if ($_POST) {

-' . htmlspecialchars($name) . '
' : '') . "\n"; ?> - - - +' . htmlspecialchars($name) . '
' : '') . "\n"; ?> + + + \n"; + echo "\n"; } elseif (!$_POST["add_x"]) { - echo "\n"; + echo "\n"; } ?> -

diff --git a/adminer/db.inc.php b/adminer/db.inc.php index 11e7ee6e..684b8543 100644 --- a/adminer/db.inc.php +++ b/adminer/db.inc.php @@ -31,7 +31,7 @@ if ($tables_views && !$error) { $message = lang('Tables have been dropped.'); } else { while ($row = $result->fetch_assoc()) { - $message .= htmlspecialchars("$row[Table]: $row[Msg_text]") . "
"; + $message .= htmlspecialchars("$row[Table]: $row[Msg_text]") . "
"; } } } @@ -39,76 +39,73 @@ if ($tables_views && !$error) { } page_header(lang('Database') . ": " . htmlspecialchars($_GET["db"]), $error, false); -echo '

' . lang('Alter database') . "

\n"; -echo '

' . lang('Database schema') . "

\n"; +echo '

' . lang('Alter database') . "\n"; +echo '

' . lang('Database schema') . "\n"; echo "

" . lang('Tables and views') . "

\n"; $table_status = table_status(); if (!$table_status) { - echo "

" . lang('No tables.') . "

\n"; + echo "

" . lang('No tables.') . "\n"; } else { echo "

\n"; echo "\n"; - echo '\n"; + echo '\n"; foreach ($table_status as $row) { $name = $row["Name"]; table_comment($row); - echo ''; + echo '"; + echo ''; + echo '"; + echo "'; + echo '\n"; } echo "
' . lang('Table') . '' . lang('Engine') . '' . lang('Collation') . '' . lang('Data Length') . '' . lang('Index Length') . '' . lang('Data Free') . '' . lang('Auto Increment') . '' . lang('Rows') . '' . lang('Comment') . "
' . lang('Table') . '' . lang('Engine') . '' . lang('Collation') . '' . lang('Data Length') . '' . lang('Index Length') . '' . lang('Data Free') . '' . lang('Auto Increment') . '' . lang('Rows') . '' . lang('Comment') . "
'; if (isset($row["Rows"])) { - echo '' . htmlspecialchars($name) . "$row[Engine]$row[Collation]' . htmlspecialchars($name) . "$row[Engine]$row[Collation]"; foreach (array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create", "Rows" => "select") as $key => $link) { $val = number_format($row[$key], 0, '.', lang(',')); - echo '' . (strlen($row[$key]) ? '' . str_replace(" ", " ", ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val)) . '' : ' ') . '' . (strlen($row[$key]) ? '' . str_replace(" ", " ", ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val)) . '' : ' '); } - echo "" . (strlen(trim($row["Comment"])) ? htmlspecialchars($row["Comment"]) : " ") . "" . (strlen(trim($row["Comment"])) ? htmlspecialchars($row["Comment"]) : " "); } else { - echo '' . htmlspecialchars($name) . '' . lang('View') . '' . htmlspecialchars($name) . '' . lang('View') . ''; } - echo "
\n"; - echo "

\n"; + echo "

\n"; $dbs = get_databases(); if (count($dbs) != 1) { $db = (isset($_POST["target"]) ? $_POST["target"] : $_GET["db"]); - echo "

" . lang('Move to other database') . ($dbs ? ": " : ': ') . "

\n"; + echo "

" . lang('Move to other database') . ($dbs ? ": " : ': ') . " \n"; } echo "

\n"; } if ($dbh->server_info >= 5) { - echo '

' . lang('Create view') . "

\n"; + echo '

' . lang('Create view') . "\n"; echo "

" . lang('Routines') . "

\n"; $result = $dbh->query("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = " . $dbh->quote($_GET["db"])); if ($result->num_rows) { echo "\n"; while ($row = $result->fetch_assoc()) { echo ""; - echo ""; - echo ''; - echo '"; - echo "\n"; + echo "
" . htmlspecialchars($row["ROUTINE_TYPE"]) . "' . htmlspecialchars($row["ROUTINE_NAME"]) . '' . lang('Alter') . "
" . htmlspecialchars($row["ROUTINE_TYPE"]); + echo '' . htmlspecialchars($row["ROUTINE_NAME"]) . ''; + echo '' . lang('Alter') . ""; } echo "
\n"; } $result->free(); - echo '

' . lang('Create procedure') . ' ' . lang('Create function') . "

\n"; + echo '

' . lang('Create procedure') . ' ' . lang('Create function') . "\n"; } if ($dbh->server_info >= 5.1 && ($result = $dbh->query("SHOW EVENTS"))) { echo "

" . lang('Events') . "

\n"; if ($result->num_rows) { echo "\n"; - echo "\n"; + echo "\n"; while ($row = $result->fetch_assoc()) { echo ""; - echo '"; - echo ""; - echo ""; - echo "\n"; + echo '
" . lang('Name') . "" . lang('Schedule') . "" . lang('Start') . "" . lang('End') . "
" . lang('Name') . "" . lang('Schedule') . "" . lang('Start') . "" . lang('End') . "
' . htmlspecialchars($row["Name"]) . "" . ($row["Execute at"] ? lang('At given time') . "" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "$row[Starts]") . "$row[Ends]
' . htmlspecialchars($row["Name"]) . ""; + echo "" . ($row["Execute at"] ? lang('At given time') . "" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "$row[Starts]"); + echo "$row[Ends]"; } echo "
\n"; } $result->free(); - echo '

' . lang('Create event') . "

\n"; + echo '

' . lang('Create event') . "\n"; } diff --git a/adminer/dump.inc.php b/adminer/dump.inc.php index d8e0e340..9738da4c 100644 --- a/adminer/dump.inc.php +++ b/adminer/dump.inc.php @@ -162,39 +162,39 @@ if ($dbh->server_info >= 5) { $db_style[] = 'CREATE+ALTER'; $table_style[] = 'CREATE+ALTER'; } -echo "" . lang('Output') . "$dump_output\n"; -echo "" . lang('Format') . "$dump_format\n"; -echo "" . lang('Database') . "\n"; -echo "" . lang('Tables') . "\n"; -echo "" . lang('Data') . "\n"; +echo "" . lang('Output') . "$dump_output\n"; +echo "" . lang('Format') . "$dump_format\n"; +echo "" . lang('Database') . "\n"; +echo "" . lang('Tables') . "\n"; +echo "" . lang('Data') . "\n"; ?> -

+

"; - echo ""; - echo ""; - echo "\n"; + echo ""; + $print = '\n"; + $views .= "$print\n"; } else { - echo "$print\n"; + echo "$print\n"; + echo "\n"; foreach (get_databases() as $db) { if (!information_schema($db)) { - echo '\n"; + echo ' - + +echo "'; +echo ($unsigned ? " ' : ''); +?> - - - - - + - - - + - + - -\n\n"; + echo "\n"; + echo "\n"; } - echo "\n"; + echo "
"; + echo ""; + echo "\n"; $views = ""; foreach (table_status() as $row) { $checked = (strlen($_GET["dump"]) && $row["Name"] != $_GET["dump"] ? '' : " checked='checked'"); - $print = '
"; if (!$row["Engine"]) { - $views .= "$print
\n"; } } echo $views; } else { - echo "
\n"; } } } diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index b5791f68..c21fc753 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -73,7 +73,7 @@ if ($fields) { unset($create); echo "\n"; foreach ($fields as $name => $field) { - echo ""; + echo "\n"; + echo "\n"; } echo "
" . adminer_field_name($fields, $name) . "
" . adminer_field_name($fields, $name); $value = (isset($row) ? (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : $row[$name]) : ($_POST["clone"] && $field["auto_increment"] ? "" : ($where ? $field["default"] : false)) @@ -85,29 +85,28 @@ if ($fields) { $create = $dbh->result($dbh->query("SHOW CREATE TABLE " . idf_escape($_GET["edit"])), 1); } $checked = ($_POST ? $_POST["on_update"][bracket_escape($name)] : preg_match("~\n\\s*" . preg_quote(idf_escape($name), '~') . " timestamp.* on update CURRENT_TIMESTAMP~i", $create)); - echo ''; + echo ''; } - echo "
\n"; } ?>

- - + + (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"])); } if ($fields) { - echo "\n"; + echo "\n"; if (!isset($_GET["default"]) && !isset($_GET["select"])) { - echo "\n"; + echo "\n"; } } if ($update) { - echo "\n"; + echo "\n"; } ?> -

diff --git a/adminer/event.inc.php b/adminer/event.inc.php index 21eec46f..a18bd55b 100644 --- a/adminer/event.inc.php +++ b/adminer/event.inc.php @@ -36,18 +36,17 @@ if ($_POST) {
- - - - - - - +
" maxlength="64" />
" />
" />
" size="6" />
" maxlength="64" />
 
" maxlength="64"> +
"> +
"> +
" size="6"> +
+
" maxlength="64"> +
 
-

+

- - - /> -

+ + +>
diff --git a/adminer/foreign.inc.php b/adminer/foreign.inc.php index ecdf49c4..6062df43 100644 --- a/adminer/foreign.inc.php +++ b/adminer/foreign.inc.php @@ -15,7 +15,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change- . (in_array($_POST["on_delete"], $on_actions) ? " ON DELETE $_POST[on_delete]" : "") . (in_array($_POST["on_update"], $on_actions) ? " ON UPDATE $_POST[on_update]" : "") , $SELF . "table=" . urlencode($_GET["foreign"]), (strlen($_GET["name"]) ? lang('Foreign key has been altered.') : lang('Foreign key has been created.'))); - $error = lang('Source and target columns must have the same data type and there must be an index on the target columns.') . "
$error"; + $error = lang('Source and target columns must have the same data type and there must be an index on the target columns.') . "
$error"; } } page_header(lang('Foreign key'), $error, array("table" => $_GET["foreign"]), $_GET["foreign"]); @@ -44,30 +44,26 @@ $target = ($_GET["foreign"] === $row["table"] ? $source : get_vals("SHOW COLUMNS

: - -

- + +
" size="3" /> +" size="3"> ' . optionlist($collations, $field["collation"]) . ''; -echo ($unsigned ? " ' : ''); -?>
+ + + + - + +"; ?>
"; ?> + $field) { $i++; $display = (isset($_POST["add"][$i-1]) || (isset($field["field"]) && !$_POST["drop_col"][$i])); ?> > -" onchange=" 1 ? "" : "editing_add_row(this, $allowed); "); ?>editing_name_change(this);" maxlength="64" />" /> +" onchange=" 1 ? "" : "editing_add_row(this, $allowed); "); ?>editing_name_change(this);" maxlength="64">"> - checked="checked" /> checked="checked" /> checked="checked"> + checked="checked"> +
"; + echo " "; + echo " "; + echo " "; + echo "\n\n"; } return $column_comments; } diff --git a/adminer/include/export.inc.php b/adminer/include/export.inc.php index 40f6a489..01716dcb 100644 --- a/adminer/include/export.inc.php +++ b/adminer/include/export.inc.php @@ -155,6 +155,6 @@ function dump_headers($identifier, $multi_table = false) { return $ext; } -$dump_output = ""; -$dump_format = ""; +$dump_output = ""; +$dump_format = ""; $max_packet = 1048576; // default, minimum is 1024 diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 64e050c3..0678186a 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -20,7 +20,7 @@ function optionlist($options, $selected = null) { $return .= ''; } foreach ((is_array($v) ? $v : array($k => $v)) as $key => $val) { - $return .= '' . htmlspecialchars($val) . ''; + $return .= '' . htmlspecialchars($val); } if (is_array($v)) { $return .= ''; @@ -159,7 +159,7 @@ function odd($s = ' class="odd"') { function select($result, $dbh2 = null) { global $SELF; if (!$result->num_rows) { - echo "

" . lang('No rows.') . "

\n"; + echo "

" . lang('No rows.') . "\n"; } else { echo "\n"; $links = array(); // colno => orgtable - create links from these columns @@ -195,9 +195,9 @@ function select($result, $dbh2 = null) { $blobs[$j] = true; } $types[$j] = $field->type; - echo ""; + echo "\n"; + echo "\n"; } echo ""; foreach ($row as $key => $val) { @@ -222,9 +222,8 @@ function select($result, $dbh2 = null) { $val = '' . $val . ''; } } - echo ""; + echo "\n"; } echo "
" . htmlspecialchars($field->name) . "" . htmlspecialchars($field->name); } - echo "
$val$val"; } - echo "
\n"; } @@ -253,7 +252,7 @@ function hidden_fields($process, $ignore = array()) { $process[$key . "[$k]"] = $v; } } elseif (!in_array($key, $ignore)) { - echo ''; + echo ''; } } } @@ -263,18 +262,18 @@ function input($name, $field, $value) { $name = htmlspecialchars(bracket_escape($name)); echo "

"; if ($field["type"] == "enum") { - echo " " . (isset($_GET["select"]) ? ' ' : ""); + echo " " . (isset($_GET["select"]) ? ' ' : ""); if ($field["null"] || isset($_GET["default"])) { - echo ' '; + echo ' '; } if (!isset($_GET["default"])) { - echo ''; + echo ''; } preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches); foreach ($matches[1] as $i => $val) { $val = stripcslashes(str_replace("''", "'", $val)); $checked = (is_int($value) ? $value == $i+1 : $value === $val); - echo ' '; + echo ' '; } } else { $first = ($field["null"] || isset($_GET["default"])) + isset($_GET["select"]); @@ -302,22 +301,22 @@ function input($name, $field, $value) { if ($field["null"] || isset($_GET["default"])) { array_unshift($options, "NULL"); } - echo (count($options) > 1 || isset($_GET["select"]) ? '' : " ") . ''; + echo (count($options) > 1 || isset($_GET["select"]) ? '' : " ") . ''; if ($field["type"] == "set") { //! 64 bits preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches); foreach ($matches[1] as $i => $val) { $val = stripcslashes(str_replace("''", "'", $val)); $checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true)); - echo ' '; + echo ' '; } } elseif (strpos($field["type"], "text") !== false) { echo ''; } elseif (preg_match('~binary|blob~', $field["type"])) { - echo (ini_get("file_uploads") ? '' : lang('File uploads are disabled.') . ' '); + echo (ini_get("file_uploads") ? '' : lang('File uploads are disabled.') . ' '); } else { // int(3) is only a display hint $maxlength = (!ereg('int', $field["type"]) && preg_match('~^([0-9]+)(,([0-9]+))?$~', $field["length"], $match) ? ($match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0)); - echo ''; + echo ''; } } } diff --git a/adminer/include/lang.inc.php b/adminer/include/lang.inc.php index 3f26478c..cd03fd40 100644 --- a/adminer/include/lang.inc.php +++ b/adminer/include/lang.inc.php @@ -33,9 +33,9 @@ function switch_lang() { hidden_fields($_GET, array('lang')); echo lang('Language') . ": \n\n\n\n"; + echo "\n\n\n\n"; } if (isset($_GET["lang"])) { diff --git a/adminer/indexes.inc.php b/adminer/indexes.inc.php index fca8d03a..b316bba5 100644 --- a/adminer/indexes.inc.php +++ b/adminer/indexes.inc.php @@ -65,24 +65,23 @@ if ($_POST) {
- +\n"; + echo "\n"; $j++; } ?>
\n"; + echo "
\n"; ksort($index["columns"]); foreach ($index["columns"] as $i => $column) { - echo ""; - echo " \n"; + echo ""; + echo " \n"; } - echo "

- - -

- + + +
 " . implode("", array_keys($row)) . "
 " . implode("", array_keys($row)) . "
" . implode("", $row) . "
" . implode("", $row) . "\n"; } $result->free(); ?>

- - -

+ + diff --git a/adminer/schema.inc.php b/adminer/schema.inc.php index 9dd0e1ca..fed0eacf 100644 --- a/adminer/schema.inc.php +++ b/adminer/schema.inc.php @@ -60,7 +60,7 @@ document.onmouseup = schema_mouseup; $table) { echo "
"; - echo '' . htmlspecialchars($name) . "
\n"; + echo '' . htmlspecialchars($name) . "
\n"; foreach ($table["fields"] as $field) { $val = htmlspecialchars($field["field"]); $title = ' title="' . htmlspecialchars($field["full_type"] . ($field["null"] ? " " . lang('NULL') : '')) . '"'; @@ -75,7 +75,7 @@ foreach ($schema as $name => $table) { } else { $val = "$val"; } - echo ($field["primary"] ? "$val" : $val) . "
\n"; + echo ($field["primary"] ? "$val" : $val) . "
\n"; } foreach ((array) $table["references"] as $target_name => $refs) { foreach ($refs as $left => $ref) { diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 471f2872..31cefd18 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -162,79 +162,78 @@ if (isset($rights["insert"])) { echo '' . lang('New item') . ' '; } echo adminer_select_links($table_status); -echo "

\n"; if (!$columns) { - echo "

" . lang('Unable to select the table') . ($fields ? "" : ": " . htmlspecialchars($dbh->error)) . ".

\n"; + echo "

" . lang('Unable to select the table') . ($fields ? "" : ": " . htmlspecialchars($dbh->error)) . ".\n"; } else { echo "

\n"; echo '
' . lang('Select') . "
\n"; echo '
' . lang('Search') . "
\n"; echo '
' . lang('Sort') . "
1 ? "" : " class='hidden'") . ">\n"; $i = 0; foreach ((array) $_GET["order"] as $key => $val) { if (isset($columns[$val])) { - echo "
"; - echo "
\n"; + echo "
"; + echo "
\n"; $i++; } } - echo "
"; - echo "
\n"; + echo "
"; + echo "
\n"; echo "
\n"; echo "
" . lang('Limit') . "
"; //
for easy styling - echo ""; + echo ""; echo "
\n"; if (isset($text_length)) { echo "
" . lang('Text length') . "
"; - echo ""; + echo ""; echo "
\n"; } echo "
" . lang('Action') . "
"; - echo ""; + echo ""; echo "
\n"; echo "
\n"; @@ -243,11 +242,11 @@ if (!$columns) { $result = $dbh->query($query); if (!$result) { - echo "

" . htmlspecialchars($dbh->error) . "

\n"; + echo "

" . htmlspecialchars($dbh->error) . "\n"; } else { echo "

\n"; if (!$result->num_rows) { - echo "

" . lang('No rows.') . "

\n"; + echo "

" . lang('No rows.') . "\n"; } else { $foreign_keys = array(); foreach (foreign_keys($_GET["select"]) as $foreign_key) { @@ -261,14 +260,14 @@ if (!$columns) { echo "\n"; for ($j=0; $row = $result->fetch_assoc(); $j++) { if (!$j) { - echo ''; + echo ''; + echo '\n"; + echo "\n"; } $unique_idf = implode('&', unique_idf($row, $indexes)); //! don't use aggregation functions - echo ''; + echo '"; + echo "\n"; } echo "
'; foreach ($row as $key => $val) { - echo '' . adminer_field_name($fields, $key) . '' . adminer_field_name($fields, $key) . ''; } - echo "
' . (count($select) != count($group) || information_schema($_GET["db"]) ? '' : ' ' . lang('edit') . '') . '' . (count($select) != count($group) || information_schema($_GET["db"]) ? '' : ' ' . lang('edit') . ''); foreach ($row as $key => $val) { if (strlen($val) && (!isset($email_fields[$key]) || $email_fields[$key])) { $email_fields[$key] = is_email($val); //! filled e-mails may be contained on other pages @@ -300,9 +299,8 @@ if (!$columns) { } } } - echo "$val$val"; } - echo "
\n"; @@ -328,23 +326,23 @@ if (!$columns) { } print_pagination($max_page); } - echo " (" . lang('%d row(s)', $found_rows) . ')

\n"; + echo " (" . lang('%d row(s)', $found_rows) . ') \n"; - echo (information_schema($_GET["db"]) ? "" : "
" . lang('Edit') . "
\n"); - echo "
" . lang('Export') . "
$dump_output $dump_format
\n"; + echo (information_schema($_GET["db"]) ? "" : "
" . lang('Edit') . "
\n"); + echo "
" . lang('Export') . "
$dump_output $dump_format
\n"; } $result->free(); - echo "
" . lang('CSV Import') . "
\n"; + echo "
" . lang('CSV Import') . "
\n"; //! Editor only $email_fields = array_filter($email_fields); if ($email_fields) { echo '
' . lang('E-mail') . "
\n"; } diff --git a/adminer/sql.inc.php b/adminer/sql.inc.php index 6f2847cb..5177df68 100644 --- a/adminer/sql.inc.php +++ b/adminer/sql.inc.php @@ -36,13 +36,13 @@ if (!$error && $_POST) { $start = explode(" ", microtime()); // microtime(true) is available since PHP 5 //! don't allow changing of character_set_results, convert encoding of displayed query if (!$dbh->multi_query(substr($query, 0, $match[0][1]))) { - echo "

" . lang('Error in query') . ": " . htmlspecialchars($dbh->error) . "

\n"; + echo "

" . lang('Error in query') . ": " . htmlspecialchars($dbh->error) . "\n"; if ($_POST["error_stops"]) { break; } } else { $end = explode(" ", microtime()); - echo "

" . lang('%.3f s', max(0, $end[0] - $start[0] + $end[1] - $start[1])) . "

\n"; + echo "

" . lang('%.3f s', max(0, $end[0] - $start[0] + $end[1] - $start[1])) . "\n"; do { $result = $dbh->store_result(); if (is_object($result)) { @@ -51,7 +51,7 @@ if (!$error && $_POST) { if (preg_match("~^$space*(CREATE|DROP)$space+(DATABASE|SCHEMA)\\b~isU", $query)) { unset($_SESSION["databases"][$_GET["server"]]); // clear cache } - echo "

" . lang('Query executed OK, %d row(s) affected.', $dbh->affected_rows) . "

\n"; + echo "

" . lang('Query executed OK, %d row(s) affected.', $dbh->affected_rows) . "\n"; } } while ($dbh->next_result()); } @@ -61,38 +61,36 @@ if (!$error && $_POST) { } } if ($empty) { - echo "

" . lang('No commands to execute.') . "

\n"; + echo "

" . lang('No commands to execute.') . "\n"; } } else { - echo "

" . lang('Unable to upload a file.') . "

\n"; + echo "

" . lang('Unable to upload a file.') . "\n"; } } ?> -

+

- - - -

+ + +

-: - +: + -

" . lang('History') . "\n"; foreach ($history as $key => $val) { //! save and display timestamp - echo '' . lang('Edit') . ' ' . shorten_utf8(str_replace("\n", " ", $val), 80, "") . "
\n"; + echo '' . lang('Edit') . ' ' . shorten_utf8(str_replace("\n", " ", $val), 80, "") . "
\n"; } echo "
\n"; } diff --git a/adminer/table.inc.php b/adminer/table.inc.php index 229e7e00..ecbf7ba3 100644 --- a/adminer/table.inc.php +++ b/adminer/table.inc.php @@ -13,7 +13,7 @@ if ($result) { if (!$row["auto_increment"]) { $auto_increment_only = false; } - echo "" . htmlspecialchars($row["Field"]) . "" . htmlspecialchars($row["Type"]) . ($row["Null"] == "YES" ? " NULL" : "") . "\n"; + echo "" . htmlspecialchars($row["Field"]) . "" . htmlspecialchars($row["Type"]) . ($row["Null"] == "YES" ? " NULL" : "") . "\n"; } echo "\n"; $result->free(); @@ -23,7 +23,6 @@ if ($result) { echo ($auto_increment_only ? '' : ' ' . lang('Default values') . ''); echo ' ' . lang('Select table') . ''; echo ' ' . lang('New item') . ''; - echo "

\n"; echo "

" . lang('Indexes') . "

\n"; $indexes = indexes($_GET["table"]); @@ -35,11 +34,11 @@ if ($result) { foreach ($index["columns"] as $key => $val) { $print[] = "" . htmlspecialchars($val) . "" . ($index["lengths"][$key] ? "(" . $index["lengths"][$key] . ")" : ""); } - echo "$index[type]" . implode(", ", $print) . "\n"; + echo "$index[type]" . implode(", ", $print) . "\n"; } echo "\n"; } - echo '

' . lang('Alter indexes') . "

\n"; + echo '

' . lang('Alter indexes') . "\n"; if ($table_status["Engine"] == "InnoDB") { echo "

" . lang('Foreign keys') . "

\n"; @@ -49,15 +48,14 @@ if ($result) { foreach ($foreign_keys as $name => $foreign_key) { $link = (strlen($foreign_key["db"]) ? "" . htmlspecialchars($foreign_key["db"]) . "." : "") . htmlspecialchars($foreign_key["table"]); echo ""; - echo "" . implode(", ", array_map('htmlspecialchars', $foreign_key["source"])) . ""; + echo "" . implode(", ", array_map('htmlspecialchars', $foreign_key["source"])) . ""; echo '$link"; - echo "(" . implode(", ", array_map('htmlspecialchars', $foreign_key["target"])) . ")"; - echo "" . (!strlen($foreign_key["db"]) ? '' . lang('Alter') . '' : ' ') . ""; - echo "\n"; + echo "(" . implode(", ", array_map('htmlspecialchars', $foreign_key["target"])) . ")"; + echo "" . (!strlen($foreign_key["db"]) ? '' . lang('Alter') . '' : ' '); } echo "\n"; } - echo '

' . lang('Add foreign key') . "

\n"; + echo '

' . lang('Add foreign key') . "\n"; } } @@ -67,10 +65,10 @@ if ($dbh->server_info >= 5) { if ($result->num_rows) { echo "\n"; while ($row = $result->fetch_assoc()) { - echo "\n"; + echo "
$row[Timing]$row[Event]" . htmlspecialchars($row["Trigger"]) . "' . lang('Alter') . "
$row[Timing]$row[Event]" . htmlspecialchars($row["Trigger"]) . "' . lang('Alter') . "\n"; } echo "
\n"; } $result->free(); - echo '

' . lang('Add trigger') . "

\n"; + echo '

' . lang('Add trigger') . "\n"; } diff --git a/adminer/trigger.inc.php b/adminer/trigger.inc.php index 9085df05..e79ba959 100644 --- a/adminer/trigger.inc.php +++ b/adminer/trigger.inc.php @@ -27,15 +27,14 @@ if ($_POST) { - - - +
" maxlength="64" />
+
+
" maxlength="64">
-

+

- - - - /> -

+ + + +> diff --git a/adminer/user.inc.php b/adminer/user.inc.php index cafaba16..891aa663 100644 --- a/adminer/user.inc.php +++ b/adminer/user.inc.php @@ -124,21 +124,21 @@ if ($_POST) { ?>
- - - +
" />
" />
" />
"> +
"> +
">
\n"; -echo "" . lang('Privileges') . ""; +echo "" . lang('Privileges'); $i = 0; foreach ($grants as $object => $grant) { - echo '' . ($object != "*.*" ? '' : '*.*') . ''; //! separate db, table, columns, PROCEDURE|FUNCTION, routine + echo '' . ($object != "*.*" ? '' : '*.*'); //! separate db, table, columns, PROCEDURE|FUNCTION, routine $i++; } -echo "\n"; +echo "\n"; foreach (array( "" => "", "Server Admin" => lang('Server'), @@ -148,28 +148,26 @@ foreach (array( "Procedures" => lang('Routine'), ) as $context => $desc) { foreach ((array) $privileges[$context] as $privilege => $comment) { - echo "$desc' . htmlspecialchars($privilege) . ""; + echo "$desc' . htmlspecialchars($privilege) . ""; $i = 0; foreach ($grants as $object => $grant) { $name = '"grants[' . $i . '][' . htmlspecialchars(strtoupper($privilege)) . ']"'; $value = $grant[strtoupper($privilege)]; if ($context == "Server Admin" && $object != (isset($grants["*.*"]) ? "*.*" : "")) { - echo " "; + echo " "; } elseif (isset($_GET["grant"])) { - echo ""; + echo ""; } else { - echo ""; + echo ""; } $i++; } - echo "\n"; } } echo "\n"; ?>

- - - /> -

+ + +> diff --git a/adminer/variables.inc.php b/adminer/variables.inc.php index 10be348d..ad853fee 100644 --- a/adminer/variables.inc.php +++ b/adminer/variables.inc.php @@ -5,9 +5,8 @@ echo "\n"; $result = $dbh->query("SHOW VARIABLES"); while ($row = $result->fetch_assoc()) { echo ""; - echo ""; - echo ""; - echo "\n"; + echo "
" . htmlspecialchars($row["Variable_name"]) . "" . (strlen(trim($row["Value"])) ? htmlspecialchars($row["Value"]) : " ") . "
" . htmlspecialchars($row["Variable_name"]) . ""; + echo "" . (strlen(trim($row["Value"])) ? htmlspecialchars($row["Value"]) : " "); } $result->free(); echo "
\n"; diff --git a/adminer/view.inc.php b/adminer/view.inc.php index c4d8ec7c..ab99929a 100644 --- a/adminer/view.inc.php +++ b/adminer/view.inc.php @@ -2,4 +2,4 @@ page_header(lang('View') . ": " . htmlspecialchars($_GET["view"])); $view = view($_GET["view"]); echo "
" . htmlspecialchars($view["select"]) . "
\n"; -echo '

' . lang('Alter view') . "

\n"; +echo '

' . lang('Alter view') . "\n"; diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 7be722b6..b4dea4d8 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -38,23 +38,21 @@ function adminer_navigation($missing) { ?>

-" /> - -

+"> +
" . lang('No tables.') . "

\n"; + echo "

" . lang('No tables.') . "\n"; } else { echo "

\n"; foreach ($table_status as $row) { if (isset($row["Engine"])) { // ignore views - echo '' . adminer_table_name($row) . "
\n"; + echo '' . adminer_table_name($row) . "
\n"; } } - echo "

\n"; } } }