]> git.nbdom.net Git - nb.git/commitdiff
Bed
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 19 Jul 2016 01:30:26 +0000 (02:30 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 19 Jul 2016 01:30:26 +0000 (02:30 +0100)
lib/php/db/table.php
lib/php/db/wp.php

index 951c7a7d90ab6942f9b5d80707169e3e645ca434..5396f566b41af05f5cd404b083aa380395ffb7d8 100644 (file)
@@ -246,6 +246,8 @@ Class Table extends nb {
     return $this->sql;
   }
 
+  public function field($name) { return $this->fields($name); }
+
   /*
    * Function db.fields
    *
index 3557bbd08f8b1a6891b1d25fb65d2ac5169cc609..5caef81b3fc2d4b5489a63e79eba7eb800d37c21 100644 (file)
@@ -15,8 +15,10 @@ class html_table extends WP_List_Table {
     #$fields = $this->get_columns();
     #debug($sort);
     $this->_column_headers = array($this->get_columns(), array(), $this->get_sortable_columns());
+    #$this->items =  ['zaza'];
 
-    $this->search_box();
+    $this->search_box('Search','search');
+    #echo 'zaza;'.(int)$this->has_items();
     return;
   }
 
@@ -72,10 +74,19 @@ class html_table extends WP_List_Table {
 
     foreach ($this->get_columns() as $k =>$v) {
       #echo '<div>';
+      #$this->_table->debug( $this->_table->field($k) );
+      #echo $this->_table->field($k)->html_edit(isset($_REQUEST[$k]) ? esc_attr( $_REQUEST[$k] ) : '');
+      #continue;
+      $size = 0;
+      if ($field = $this->_table->field($k)) {
+        $size = ($field->size() and is_scalar($field->size())) ? $field->size() : 0;
+      }
       echo '<span>';
       echo '<label for="'.$input_id.'-'.$k.'">'.$v.': ';
       echo '</label>';
-      echo '<input type="text" id="'.$input_id.'-'.$k.'" name="'.$k.'" value="' .( isset($_REQUEST[$k]) ? esc_attr( $_REQUEST[$k] ) : '' ). '" />';
+      echo '<input type="text" id="'.$input_id.'-'.$k.'" name="'.$k.'" value="' .( isset($_REQUEST[$k]) ? esc_attr( $_REQUEST[$k] ) : '' ). '"'
+        .( $size ? ' size="'.$size.'"' : '')
+      . ' />';
       echo '</span>';
       #echo '<div>';
     }