]> git.nbdom.net Git - nb.git/commitdiff
css,div
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 10 Jul 2015 10:18:44 +0000 (11:18 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Fri, 10 Jul 2015 10:18:44 +0000 (11:18 +0100)
lib/css/db.css
lib/php/db/table.php
lib/php/page.php

index 814be6d8c19a0d2456fa8278a4e3ee6b49285562..6b8b90614cf424e40ce09c3b273e696f38f4acf8 100644 (file)
@@ -1,13 +1,26 @@
 /*
   All
 .rows { margin: 0 auto; }
+border: solid  1px red !important;
 */
 
+.rows ul {
+  margin: 0 0 0.5em 0;
+  padding: 0.2em;
+  /*
+  margin: 0 0.5em 0.5em 0;
+  float: left;
+  width: 45em;
+  overflow: scroll;
+  */
+}
+
+.rows ul .edit { float: right; }
+
 /*
   Edit
 */
-form.Zdb.edit
-,form.db.edit label
+form.db.edit label
 ,form.db.edit input
 {
   float: left;
@@ -38,12 +51,6 @@ form.db.edit .buttons input {
   float: none;
 }
 
-/*
-  List
-  border: solid 1px red;
-*/
-.sel:before { content: ">"; }
-
 div.db.menu label {
   margin-right: 0.1em;
 }
index aa19e14fa689c94645f1bba8f9ee760fe828f6f0..5edecba8ee97bb98cc1dd1d2c282fd6511092de4 100644 (file)
@@ -502,9 +502,9 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog.
     $st = $this->db->conn->prepare($sql);
     $st->execute();
 
-    $format = (!empty($opt['format']) ? $opt['format'] : 'table');
+    $format = ( $this->db->p('format') ? $this->db->p('format') : 'table' );
 
-    if (!@$opt['is_html']) $opt['is_html'] = preg_match('/^(table)$/',$format) ? true : false;
+    if (!isset($opt['is_html'])) $opt['is_html'] = preg_match('/^(table|div)$/',$format) ? true : false;
 
     $escape = preg_match('/^(table|row|xml)$/',$format) ? true : false;
     if (preg_match('/^(1)?$/',$this->db->p('header'))) echo $this->{"rows_begin_$format"}($opt);
@@ -640,7 +640,7 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog.
   function rows_begin_table() {
 
     $html = '';
-    $html .= '<table class="'.$this->name.' rows border">'.PHP_EOL;
+    $html .= '<table class="rows border '.$this->name.'">'.PHP_EOL;
 
     if (DB_HTML_NAV_TOP) $html .= '<thead><tr>'
       . '<td colspan="'.(count($this->fields())+1).'">' . DB_HTML_NAV_TOP . '</td>'
@@ -688,7 +688,7 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog.
     Html Div
   -----------------------------------------------------------------*/
   function rows_begin_div() {
-    return '<div class="'.$this->name.' rows">'.DB_HTML_NAV_TOP.PHP_EOL;
+    return '<div class="rows '.$this->name.'">'.DB_HTML_NAV_TOP.PHP_EOL;
   }
 
   function rows_rec_div($row) {
@@ -698,8 +698,7 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog.
 
     foreach ($row as $k => $v) {
       $html .= '<li>'
-        .'<span class="k">'.$k.'</span>'
-        .': '
+        .( $k == '0' ? '' : '<span class="k">'.$k.'</span>: ')
         .'<span class="v">'.$v.'</span>'
         .'</li>';
     }
index c3e9e46b6de322b6515cbccfb871a14d94450385..4d8975989159d9a406c16418670646107f32bd67 100644 (file)
@@ -18,19 +18,19 @@ $Page = new Page(array(
 
 class Page {
 
-  var $call = array();
-  var $output = '';
+  public $call = array();
+  public $output = '';
 
-  var $charset = 'utf-8';
-  var $content_type = 'text/html';
-  var $title = '';
+  public $charset = 'utf-8';
+  public $content_type = 'text/html';
+  public $title = '';
 
-  var $css = array();
-  var $head = array();
-  var $css_code = '';
+  public $css = array();
+  public $head = array();
+  public $css_code = '';
 
-  var $js = array();
-  var $js_code = '';
+  public $js = array();
+  public $js_code = '';
 
   /*
     Create