From e143aeabbb11b050ff77464b4bd337bc622805ca Mon Sep 17 00:00:00 2001 From: Devops Date: Fri, 12 May 2017 16:35:56 +0100 Subject: [PATCH] www/dbq/dbq.php --- lib/php/db/field.php | 29 ++++++++++++++++++----------- www/dbq/dbq.php | 7 +++---- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/lib/php/db/field.php b/lib/php/db/field.php index 29a3fb9a..889e3d0f 100644 --- a/lib/php/db/field.php +++ b/lib/php/db/field.php @@ -78,18 +78,25 @@ class field extends nb { $size = ($this->size() and is_scalar($this->size())) ? $this->size() : 0; $tag = ( ($size>$this->textarea_size) or preg_match('/^(text|binary|blob)/i',$this->type) ) ? 'textarea' : 'input'; + $html = ''; + if ($this->extras) { + $html = ''.$this->out($value).''; + } elseif (strpos($this->type,'Zbool') !== false) { + $html = 'Yes No'; + } else { + $html = '<'.$tag + .' name="'.$this->name.'"' + .' id="'.$this->name.'"' + .( ($size and $tag != 'textarea') ? ' size="'.$size.'"' : '') + #.' value="'.$value.'"' + .($tag == 'textarea' ? '>'.$value.'' : ' type="' + .($type ? $type : $this->html_type()) + .'" value="'.$value.'" />') + ; + } + return '
' - .($this->extras - ? ''.$this->out($value).'' - : '<'.$tag - .' name="'.$this->name.'"' - .' id="'.$this->name.'"' - .( ($size and $tag != 'textarea') ? ' size="'.$size.'"' : '') - #.' value="'.$value.'"' - .($tag == 'textarea' ? '>'.$value.'' : ' type="' - .($type ? $type : $this->html_type()) - .'" value="'.$value.'" />') - ) + .$html .'
'.NB_EOL; } diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 9d52a416..0effa376 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -333,7 +333,7 @@ class DbQ extends nb { $params = $this->params; $ext = $this->ext; - $title = array_filter(array_unique(array_slice(array_values($params),1)), + $title = array_filter(array_unique(array_slice(array_values($params),1,3)), function($v){ return(in_array($v,self::ACTIONS_NO_TITLE) ? '' : trim($v)); } @@ -351,8 +351,8 @@ class DbQ extends nb { $nav[] = [$v,'/']; } else { - $nav[] = [$this->prettyText($v),"$path$v.".$ext]; - $path .= "$v/"; + $nav[] = [$this->prettyText($v),"$path".urlencode($v).".".$ext]; + $path .= $v."/"; } @@ -858,7 +858,6 @@ EOF; $this->page($info); } elseif ($action == 'update' and $this->perm >= self::WRITE) { - # NB 19.12.16: TODO NOT WORKING with update using replace if (!$this->table->update($_POST,$info)) $this->error('update: '.print_r($info,true)); header('Location: '.$this->table->base.'/'); $this->page($info); -- 2.47.3