]> git.nbdom.net Git - nb.git/commitdiff
menu
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 9 Aug 2016 10:29:23 +0000 (12:29 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 9 Aug 2016 10:29:23 +0000 (12:29 +0200)
etc/dbs/rent.php
lib/php/db/wp.php

index 58f465af6d0dc59bacadffcc735042029af2bf11..0f9fac11eeeb58e84b679a881ae447cfdc7b628f 100644 (file)
@@ -22,7 +22,7 @@ $CONF['_rent'] = array(
     ),
 
     'test' => array(
-      'sql' => 'SELECT 1',
+      'sql' => "SELECT 'Test sql table'",
     ),
 
     'rent' => array(
@@ -62,7 +62,7 @@ $CONF['_rent'] = array(
   ),
 );
 
-$CONF['rent'] = array (
+$CONF['rent-sqlite'] = array (
   'order' => 5,
   'pdo' => 'sqlite:/opt/rent/rent.db',
   '_import' => '_rent',
index b59de77fb6d1ba2fab0eedc4d3d62c3cc9ef030f..064e11d9219196188bb8b1a326e4dcd675153c7a 100644 (file)
@@ -10,15 +10,11 @@ class html_table extends WP_List_Table {
 
        public function __construct($table) {
     parent::__construct();
+
     $this->_table = $table;
-#debug($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('Search','search');
-    #echo 'zaza;'.(int)$this->has_items();
     return;
   }
 
@@ -52,11 +48,9 @@ class html_table extends WP_List_Table {
           ,$a
         );},[10,50,100,500]))
       .'</select>'
-/*
-*/
 
-           .get_submit_button( __( 'Search' ), 'button', '', false, array('id' => 'search-submit') )
-      .'<a class="page-title-action" href="/wp-admin/post-new.php?post_type=page&amp;action=edit&amp;table='.($this->_table->db()->p('table')).'">Add New</a>'
+           .get_submit_button( __( $text ), 'button', '', false, array('id' => 'search-submit') )
+      .'<a class="page-title-action" href="/wp-admin/post-new.php?post_type=page&amp;action=edit&amp;table='.($this->_table->db()->p('table')).'">'.__('Add New').'</a>'
     #.'</h1>'
     ;
     echo '<p id="search" class="search-box">';
@@ -83,8 +77,7 @@ class html_table extends WP_List_Table {
         $size = ($field->size() and is_scalar($field->size())) ? $field->size() : 0;
       }
       echo '<span>';
-      echo '<label for="'.$input_id.'-'.$k.'">'.$v.': ';
-      echo '</label>';
+      echo '<label for="'.$input_id.'-'.$k.'">'.$v.': </label>';
       echo '<input type="text" id="'.$input_id.'-'.$k.'" name="'.$k.'" value="' .( isset($_REQUEST[$k]) ? esc_attr( $_REQUEST[$k] ) : '' ). '"'
         .( $size ? ' size="'.$size.'"' : '')
       . ' />';