]> git.nbdom.net Git - nb.git/commitdiff
change for evo
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 15 Dec 2016 10:02:20 +0000 (10:02 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 15 Dec 2016 10:02:20 +0000 (10:02 +0000)
lib/php/db.php
lib/php/db/table.php

index dd8fb3032a6538306e7b2a01c03e107b1ee9dbdf..7aabfe23d0f9c81bd19c6a8cb829bc234e0d2cfc 100644 (file)
@@ -54,6 +54,7 @@ class Db extends nb {
   public $conf = [];
   public $attach = []; # for sqlite
   public $row_parse_pre; # Function to call in table.rows()
+  public $row_parse_post; # Function to call in table.rows()
 
   # Encryption
   public $encrypt = [
index 847dbe9f17241f4e6f932b0f0f2f80a242b6638e..2d791bd99109585f4397dc8f31f5725399a45065 100644 (file)
@@ -780,15 +780,25 @@ Class Table extends nb {
     $parser = isset($opt['parser']) ? $opt['parser'] : true;
     $call = null;
 
+    //
+    // Decrypt
+    //
     if ($parser) $this->db()->table_row_decrypt($this,$row);
+
+    //
+    // Pre
+    //
     if ($parser and !empty($this->db()->row_parse_pre)) {
-      $call = $this->db()->row_parse_pre; $call($row);
+      $call = $this->db()->row_parse_pre; $call($row,$this);
     }
 
     if ($parser and !empty($this->row_parse_pre)) {
-      $call = $this->row_parse_pre; $call($row);
+      $call = $this->row_parse_pre; $call($row,$this);
     }
 
+    //
+    // Format
+    //
     if ($opt['is_html'] and !$opt['use_out']) {
       foreach ($row as $k=>$v) {
         if (!isset($this->extras[$k])) $row[$k] = $this->db()->out->format($v);
@@ -796,17 +806,20 @@ Class Table extends nb {
 
     }
 
+    //
+    // Post
+    //
     if ($parser and !empty($this->row_parse_post)) {
-      $call = $this->row_parse_post; $call($row);
+      $call = $this->row_parse_post; $call($row,$this);
     }
 
     if ($parser and !empty($this->db()->row_parse_post)) {
-      $call = $this->db()->row_parse_post; $call($row);
+      $call = $this->db()->row_parse_post; $call($row,$this);
     }
 
     # Passed param on rows()
     if ($parser and !empty($opt['row_parse_post'])) {
-      $call = $opt['row_parse_post']; $call($row);
+      $call = $opt['row_parse_post']; $call($row,$this);
     }
 
     return $call;