]> git.nbdom.net Git - nb.git/commitdiff
clean code
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 1 Mar 2016 01:04:05 +0000 (01:04 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 1 Mar 2016 01:04:05 +0000 (01:04 +0000)
lib/php/db/table.php

index 98071b801537e2204c2206af44e794b232e92d1f..ef40de978558ff64deaa51da8aeff91fc218e7b2 100644 (file)
@@ -27,12 +27,10 @@ class table extends nb {
   public $fields_keys = null;
   public $replace = array(); # replace by javascript
   public $extras = array();
-  public $params = array( # hidden, sort, ... fields
-    'table',
-    'limit',
-    'debug',
-    'action',
-  );
+
+  # hidden, sort, ... fields
+  public $params = array( 'table', 'limit', 'debug', 'action',);
+
   public $order_by = null;
 
   function __construct($name,$opt=array()) {
@@ -454,57 +452,6 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog.
 
   }
 
-  function form_criterias($opt=array()) {
-  // Legacy from sem - NB 25.07.15 !!!!!!!!!!!!!!!!!!!
-    
-    echo '<form class="criteria" method="get" action="?">'.PHP_EOL;
-    echo '<div class="small help">Use: '.join(' | ',$this->db->help_criterias).'</div>'.PHP_EOL;
-
-    foreach ($this->params as $k) {
-      $v = $this->p($k);
-      if ($k == 'limit') $v = '';
-      echo '<input type="hidden" name="'.$k.'" value="'.$v.'" />'.PHP_EOL; 
-    }
-
-    $criteria = array();
-    foreach ( array_keys($this->fields()) as $k ) {
-
-      $v = empty($_REQUEST[$k]) ? '' : $_REQUEST[$k];
-
-      $criteria[] = ''
-        .'<span class="label '.$k.'">'
-        . '<label for="'.$k.'">'.prettyText($k).':</label>'
-        . '<input type="text" id="'.$k.'" name="'.$k.'" value="'.$v.'" />'
-        .'</span>'
-      ;
-
-    }
-
-    $criteria[] = html_select_array(array(
-      'AND',
-      'OR',
-    ),array(
-      'html' => 'name="op"',
-      'selected' => $this->p('op'),
-    ));
-
-    $criteria[] = html_select_array(array(
-      array('','HTML'),
-      array('csv','CSV'),
-      array('xml','XML'),
-      array('yaml','YAML'),
-      array('json','JSON'),
-    ),array(
-      'html' => 'name="format"',
-      'selected' => $this->p('format'),
-    ));
-
-    $criteria[] = '<input type="submit" class="button" value="GO"/>';
-    echo join(''.PHP_EOL,$criteria);
-    echo '</form>'.PHP_EOL;
-
-  }
-
   function where($fields,$hvalues,$need_all_values=false) {
 
     // Construct where