From: Nicolas Boisselier Date: Fri, 14 Sep 2018 18:48:19 +0000 (+0100) Subject: lib/php/db/field.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=cced92c4d271f50938f6b5062fd7aafd3df74a08;p=nb.git lib/php/db/field.php --- diff --git a/lib/php/db/field.php b/lib/php/db/field.php index 75776d7f..94184c7f 100644 --- a/lib/php/db/field.php +++ b/lib/php/db/field.php @@ -73,7 +73,6 @@ class field extends nb { # See: http://www.w3schools.com/html/html_form_input_types.asp if (stripos($this->name,'password') !== false) return 'password" autocomplete="off'; if ($this->numeric() !== false) return 'number" step="any'; - if ($this->autoincrement) return 'text" readonly="readonly'; return 'text'; # Html5 only if (stripos($this->name,'mail') !== false) return 'email'; # no safari @@ -104,9 +103,9 @@ class field extends nb { #$t1 = $t2 = ''; return $t1 - .'Yes ' + .'Yes ' .' | ' - .'No ' + .'No ' #.'' .$t2; @@ -156,6 +155,10 @@ class field extends nb { $h .= '<'.$tag .' name="'.$this->preffix.$this->name . ($multi ? '[]' : '') . '"' .( ($size and $tag != 'textarea') ? ' size="'.$size.'"' : '') + .' class="form-control"' + .' placeholder="'.htmlspecialchars(prettyText($this->name)).'"' + . ($this->autoincrement ? ' readonly="readonly"' : '') + . ($this->null ? '' : ' required="required"') .($tag == 'textarea' ? '>'.$value.'' : ' type="'.$type.'" value="'.htmlspecialchars($value).'" />') ; diff --git a/lib/php/db/table.php b/lib/php/db/table.php index c27ee99d..4da49e76 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -634,9 +634,9 @@ Class Table extends nb { echo '' .'
' - .( empty($_SERVER['HTTP_REFERER']) ? '' : '') - .'' - .'' + .( empty($_SERVER['HTTP_REFERER']) ? '' : '') + .'' + .'' .'
'.NB_EOL ; @@ -2159,7 +2159,7 @@ Class Table extends nb { public function html_menu($opt=[]) { if (isset($opt['html_menu']) and !$opt['html_menu']) return ''; - $buttons = ''; + $buttons = ''; if (!empty($opt['buttons'])) $buttons = $opt['buttons']; $r = '