From d76fb30792b9ee4ec66108237349ae551e84df38 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 15 Dec 2016 10:02:20 +0000 Subject: [PATCH] change for evo --- lib/php/db.php | 1 + lib/php/db/table.php | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/lib/php/db.php b/lib/php/db.php index dd8fb303..7aabfe23 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -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 = [ diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 847dbe9f..2d791bd9 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -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; -- 2.47.3