1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-17 12:00:41 +02:00

Treat tinyint(1) as boolean

Use $SELF and ENT_QUOTES for compiled images

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@922 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-07-28 10:09:05 +00:00
parent 201142850e
commit e1abcda063
7 changed files with 27 additions and 18 deletions

View File

@@ -382,10 +382,12 @@ class Adminer {
/** Get options to display edit field
* @param string table name
* @param array single field from fields()
* @return array options for <select> or empty to display <input>
* @param string attributes to use inside the tag
* @param string
* @return string custom input field or empty string for default
*/
function editInput($table, $field) {
return false;
function editInput($table, $field, $attrs, $value) {
return '';
}
/** Process sent input

View File

@@ -56,7 +56,7 @@ function type_class($type) {
}
function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $foreign_keys = array()) {
global $inout;
global $inout, $SELF; // $SELF is used by compiled images
$column_comments = false;
foreach ($fields as $field) {
if (strlen($field["comment"])) {

View File

@@ -305,9 +305,9 @@ function input($field, $value, $function) {
$first = array_search("", $functions);
$onchange = ($first ? ' onchange="var f = this.form[\'function[' . addcslashes($name, "\r\n'\\") . ']\']; if (' . $first . ' > f.selectedIndex) f.selectedIndex = ' . $first . ';"' : '');
echo (count($functions) > 1 ? '<select name="function[' . $name . ']">' . optionlist($functions, $function) . '</select>' : "&nbsp;") . '<td>';
$options = $adminer->editInput($_GET["edit"], $field); // usage in call is without a table
if (is_array($options)) {
echo '<select name="fields[' . $name . ']"' . $onchange . '>' . optionlist(($options ? $options : array("" => "")), $value, true) . '</select>';
$input = $adminer->editInput($_GET["edit"], $field, ' name="fields[' . $name . ']"' . $onchange, $value); // usage in call is without a table
if (strlen($input)) {
echo $input;
} elseif ($field["type"] == "set") { //! 64 bits
preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches);
foreach ($matches[1] as $i => $val) {