From: Nicolas Boisselier Date: Sat, 6 Jan 2018 19:27:04 +0000 (+0000) Subject: www/dbq/dbq.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=683211427813211adf21954f49d7db846abc8eee;p=nb.git www/dbq/dbq.php --- diff --git a/etc/dbq/pub.php b/etc/dbq/pub.php index c4009ec8..000f8e1a 100644 --- a/etc/dbq/pub.php +++ b/etc/dbq/pub.php @@ -1,7 +1,17 @@ ' + .Maps::img($r['latitude'],$r['latitude']) + .''; +} + $DBQ['pub'] = [ 'tables' => [ + 'zipcode' => [ 'extras' => ['maps' => ''] ], ], ]; ?> diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 52816fa7..3d517ecf 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -985,7 +985,8 @@ Class Table extends nb { // Post // if ($parser and !empty($this->row_parse_post)) { - $call = $this->row_parse_post; $call($row,$this); + $call = $this->row_parse_post; + $call($row,$this); } if ($parser and !empty($this->db()->row_parse_post)) { diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 66a6528b..6c192587 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -441,13 +441,24 @@ class DbQ extends nb { public function table_rows($fct=null) { $this->db->limit = $this->limit(); + if (!empty($this->db()->row_parse_pre)) { + $row_parse_pre = $this->db()->row_parse_pre; + } + + if (!empty($this->db()->row_parse_post)) { + $row_parse_post = $this->db()->row_parse_post; + $call($r,$this); + } + $opt = ($this->page->is('html') and $this->table_rw() ) ? [ 'row_parse_pre' => function(&$r){ + if (!empty($row_parse_pre)) $row_parse_pre($r,$this); $GLOBALS['dbq_args'] = urlencode( join($this->param_args_sep,$this->table->fields_keys_values($r)) ); }, 'row_parse_post' => function(&$r){ + if (!empty($row_parse_post)) $row_parse_post($r,$this); $args = $GLOBALS['dbq_args']; $hidden = $this->form_hidden($r); @@ -473,7 +484,9 @@ class DbQ extends nb { }, ] : []; - $this->table->rows($opt); + #$this->table->rows($opt); + $this->db()->__construct($opt); + $this->table->rows(); unset($GLOBALS['dbq_args']); }