]> git.nbdom.net Git - nb.git/commitdiff
lib/php/db/table.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 15 Jan 2018 04:52:23 +0000 (04:52 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 15 Jan 2018 04:52:23 +0000 (04:52 +0000)
lib/php/db/table.php

index 852e5f544d964aba8e711746a221f33691e6e30e..dc0f7c007650cdec54dcf9964d79cbea3fbaefa5 100644 (file)
@@ -1035,7 +1035,6 @@ Class Table extends nb {
   }
 
   public function rows(&$opt=[],$opt_by_val=null) {
-    $opt['TABLE'] = $this;
 
     #
     # Db type change
@@ -1167,7 +1166,6 @@ Class Table extends nb {
     $count = 0;
     while ($fct() and $row = $st->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) {
 
-      $opt_backup = $opt;
       $count++;
       $call = null;
 
@@ -1225,7 +1223,6 @@ Class Table extends nb {
       } else {
         echo $this->{"rows_rec_$format"}($row,$opt);
       }
-      $opt = $opt_backup;
 
     } # < while rows
 
@@ -1291,7 +1288,6 @@ Class Table extends nb {
       echo '</div>'.NB_EOL;
     }
 
-    unset($opt['TABLE']);
     #return $count;
   }
 
@@ -1562,8 +1558,8 @@ Class Table extends nb {
     if ($this->buttons() and !empty($buttons[0])) $html .= '<td class="action">'.$buttons[0].'</td>'.NB_EOL;
 
     foreach ($row as $k => $v) {
-      if ( !empty($opt['TABLE']) and !empty($opt['TABLE']->field($k)) ) {
-        $v = $opt['TABLE']->field($k)->htmlValue($v);
+      if ( !empty($this) and !empty($this->field($k)) ) {
+        $v = $this->field($k)->htmlValue($v);
       }
       $html .= '<td'.$this->__rows_table_attr[$k].'>'.$v.'</td>'.NB_EOL;
     }