From: Nicolas Boisselier Date: Tue, 20 Dec 2016 10:47:40 +0000 (+0000) Subject: dbq X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=c6dbfeed9652a8d27c39ad866ca8b333e12eac3d;p=nb.git dbq --- diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 188902bd..1edabc76 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -795,6 +795,11 @@ Class Table extends nb { $call = $this->row_parse_pre; $call($row,$this); } + # Passed param on rows() + if ($parser and !empty($opt['row_parse_pre'])) { + $call = $opt['row_parse_pre']; $call($row,$this); + } + // // Format // diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 7e01fd26..672811e1 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -235,17 +235,25 @@ table.rows th, table.rows td { border-color: '.$this->colors['body-border'].'; } #$this->pset('action','table.row'); #$this->pset('action',''); $opt = ($this->page->is('html') - #and $this->table->type() == 'table' + and ($this->perm >= self::VIEW) + and $this->table->type() != 'sql' ) ? [ 'buttons' => join(' ',[ '', #'', '', ]), + 'row_parse_pre' => function(&$r){ + + #if ($this->perm < self::VIEW) return; +# NB 20.12.16 $args = urlencode( join(self::PARAM_ARGS_SEP,$this->table->fields_keys_values($r)) ); + $GLOBALS['dbq_args'] = urlencode( join(self::PARAM_ARGS_SEP,$this->table->fields_keys_values($r)) ); + }, 'row_parse_post' => function(&$r){ - if ($this->perm < self::VIEW) return; - $args = urlencode( join(self::PARAM_ARGS_SEP,$this->table->fields_keys_values($r)) ); + #if ($this->perm < self::VIEW) return; +# NB 20.12.16 $args = urlencode( join(self::PARAM_ARGS_SEP,$this->table->fields_keys_values($r)) ); + $args = $GLOBALS['dbq_args']; $r = ['@' => join(' ',[ 'View'