From 02f1e84d9f3c348f482079b8ea7f11322fca37dc Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 16 Jun 2016 17:08:15 +0200 Subject: [PATCH] textarea --- lib/css/db.css | 9 ++++++--- lib/php/db/field.php | 3 ++- lib/php/db/table.php | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/css/db.css b/lib/css/db.css index b8f80f9b..8ae54f38 100644 --- a/lib/css/db.css +++ b/lib/css/db.css @@ -114,13 +114,12 @@ table.rows tr { vertical-align: top; } Edit */ -@media screen and (min-width: 400px) { +@media screen and (max-width: 400px) { .db form.edit { - min-width: 40em; + max-width: 40em; margin: 0 auto; } } - .db .edit .fields label { width: 25%; text-align: right; @@ -134,6 +133,10 @@ table.rows tr { vertical-align: top; } text-align: left; } +.db form.edit .fields input, .db form.edit .fields textarea, .db form.edit .fields select { + width: 70%; +} + .buttons { margin: 0.5em auto 0 auto; text-align: center; diff --git a/lib/php/db/field.php b/lib/php/db/field.php index bac07be0..7e77621e 100644 --- a/lib/php/db/field.php +++ b/lib/php/db/field.php @@ -13,6 +13,7 @@ class field extends nb { public $name; public $type; public $null = true; + private $textarea_size = 300; public $key = 0; public $uniq = 0; public $default; @@ -64,7 +65,7 @@ class field extends nb { public function html_edit($value) { $size = ($this->size() and is_scalar($this->size())) ? $this->size() : 0; - $tag = ( ($size>100) or preg_match('/^(text|binary)/i',$this->type) ) ? 'textarea' : 'input'; + $tag = ( ($size>$this->textarea_size) or preg_match('/^(text|binary)/i',$this->type) ) ? 'textarea' : 'input'; return '
' .($this->extra ? ''.$this->out($value).'' diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 2af00b9a..862de71e 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -1183,6 +1183,7 @@ Class Table extends nb { } } + $info['keys'] = array_combine($keys,$keys_values); if (empty($fields)) $this->bye("Missing keys!"); if (empty($keys)) { @@ -1225,6 +1226,7 @@ Class Table extends nb { return false; } + return true; #debug($execute); $info['rowCount'] = $query->rowCount(); return $query->rowCount(); -- 2.47.3