]> git.nbdom.net Git - nb.git/commitdiff
dbq
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 20 Dec 2016 10:47:40 +0000 (10:47 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 20 Dec 2016 10:47:40 +0000 (10:47 +0000)
lib/php/db/table.php
www/dbq/dbq.php

index 188902bd91b85a6c4598b61944229c09e54afb8f..1edabc76cd6152ade7c80f70f5dfdaa56472beb4 100644 (file)
@@ -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
     //
index 7e01fd26cbeb2d10d581f6d0e4b04fda1cda0059..672811e198fefb9e0070d25f0a97142bed6f4f4c 100644 (file)
@@ -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('&nbsp;',[
         '<input type="submit" class="button button-small" value="GO"/>',
         #'<input type="button" class="button button-small" onclick="f=this.parentElement.parentElement; f.elements[\'action\'].value=\'edit\'; f.setAttribute(\'method\',\'POST\'); f.submit();" value="Add"/>',
         '<input type="button" class="button button-small" onclick="window.location=\''.$this->table->base.'add/'.'\'" value="Add"/>',
       ]),
+      '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(' ',[
           '<a class="button select" href="'.$this->table->base.'vi/'.$args.'">View</a>'