]> git.nbdom.net Git - nb.git/commitdiff
dbq
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 20 Dec 2016 12:25:10 +0000 (12:25 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 20 Dec 2016 12:25:10 +0000 (12:25 +0000)
lib/php/db/table.php
lib/php/out.php
lib/php/page.php

index ede96045865b3d9bf7680d58eaa473396792b2dc..7ee5614d795a390b6f96af66af824360f9c990b1 100644 (file)
@@ -912,8 +912,6 @@ Class Table extends nb {
       foreach ($this->db()->fields($st) as $f) { $fields[$f->name] = $f; }
       $this->fields = $fields;
     }
-    #debug($fields);
-    #bye($this->name);
 
     #
     # Fields filter
index 7650ad75a85812d5be5f826622f85fd5127ae717..ff81ce9d3ab56bede184e6c78e895b75859ac0ef 100644 (file)
@@ -101,10 +101,6 @@ Class Out extends Nb {
       ),
 
       'php' => array(
-# NB 27.09.16         'enclose' => [
-# NB 27.09.16            '<?php'.(NB_EOL ? NB_EOL:' ') . '$VAR = array('.NB_EOL
-# NB 27.09.16           ,NB_EOL.');' . (NB_EOL ? NB_EOL:' ').'?'.'>'.NB_EOL
-# NB 27.09.16         ],
         'enclose' => (self::p('enclose') === '0' ? [] : [
            '<?php'.(NB_EOL ? NB_EOL:' ') . '$VAR = array('
           ,');' . (NB_EOL ? NB_EOL:' ').'?'.'>'.NB_EOL
@@ -112,17 +108,6 @@ Class Out extends Nb {
         'eol' => self::p('eol',NB_EOL),
         'rec' => ',',
         'row' => function(&$o,&$r) {
-#bye($o['var_export']);
-/*
-          if (!empty($o['var_export'])) {
-            if (empty($_GLOBAL['ROWS'])) {
-              $_GLOBAL['ROWS'] = [];
-              $o['rec'] = '';
-            }
-            $_GLOBAL['ROWS'][] = $r;
-            return;
-          }
-          */
           return var_export($r);
           echo preg_replace(array(
             '/(=>\s*)\n\s+/m',
@@ -133,9 +118,9 @@ Class Out extends Nb {
           ),var_export($r,true));
         }
       ),
-      'php_var_dump' => array( 'row' => function(&$o,&$r) {var_dump($r);},),
-      'php_print_r' => array( 'row' => function(&$o,&$r) {print_r($r);},),
-      'php_var_export' => array( 'row' => function(&$o,&$r) {var_export($r);},),
+      'php_var_dump' => ['row' => function(&$o,&$r) {var_dump($r);},],
+      'php_print_r' => ['row' => function(&$o,&$r) {print_r($r);},],
+      'php_var_export' => ['row' => function(&$o,&$r) {var_export($r);},],
 
       'div' => array(
         'is_html' => true,
@@ -189,7 +174,6 @@ Class Out extends Nb {
         'quote' => self::p('quote',''),
         'quote_escape' => self::punescape('quote_escape','\\'),
         'eol' => self::punescape('eol',"\n"),
-# NB 17.10.16         'enclose' => ["","\n"],
       ),
 
       'yaml' => [
@@ -202,7 +186,6 @@ Class Out extends Nb {
       ],
 
       'json' => array(
-        #'enclose' => array('['.NB_EOL,NB_EOL.']'),
         'enclose' => array('['.self::p('eol',NB_EOL),']'),
         'row' => function(&$o,&$row) { return json_encode($row); },
         'eol' => self::p('eol',NB_EOL),
@@ -355,10 +338,11 @@ Class Out extends Nb {
     # Assume html/xml tag style
     } elseif (isset($o['tag'])) {
       $ret = out_tag($o,$row);
-    } else {
 
+    } else {
       # txt
       $ret = self::row_txt($o,$row);
+
     }
 
     if (isset($o['eol'])) echo $o['eol'];
index 49efa09660b29b6d4f15e6761a4302a5c13c12f5..9d93c2e281bcc53c6ea47e9a97cee9adbbd56531 100644 (file)
@@ -191,6 +191,7 @@ class Page extends nb {
     #bye('zaza');
     static $is_html = null;
     if ($is_html === null) $is_html = preg_match('/ml$/',self::content_type()) ? true : false;
+    #bye((int)$is_html);
     
     # Extract attrs from tag
     if (preg_match('/^([\w-]+)\s+(.*?)$/',$tag,$m)) {
@@ -208,6 +209,8 @@ class Page extends nb {
     # NB 28.11.16: Proper Markdown yould be great  !
     #if (!$is_html) return (preg_match('/^(span|a|inline|label|input|select)$/',strtolower($tag))?"":"\n").join("\n",(array)$content);
     // Markdonw to html
+    if (!$is_html) return join("\n",(array)$content);
+    /*
     if (!$is_html) return join("\n",array_map(function($e) use($tag){
 
       if (preg_match('/^(li|dd)$/',$tag)) {
@@ -229,6 +232,7 @@ class Page extends nb {
       ;
 
     },(array)$content));
+    */
 
     if ($content===null) {
       self::tag_end($tag);