From: Nicolas Boisselier Date: Mon, 6 Jul 2015 16:05:25 +0000 (+0100) Subject: config dir X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=f15e4ff9b60b7f2ef8888c8b4acbea16bd28abd8;p=nb.git config dir --- diff --git a/lib/php/db.php b/lib/php/db.php index ed912d18..86b26f10 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -807,9 +807,8 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. Json -----------------------------------------------------------------*/ function rows_begin_json() { - echo '['.PHP_EOL; $this->_row_json = null; - return ''; + echo '['.PHP_EOL; } function rows_rec_json($row) { @@ -822,36 +821,34 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. } function rows_end_json() { - echo ']'.PHP_EOL; unset($this->_row_json); - return ''; + echo ']'.PHP_EOL; } /*----------------------------------------------------------------- Yaml -----------------------------------------------------------------*/ function rows_begin_yaml() { - $this->yamls = array(); - return ''; + echo "---\n"; } function rows_rec_yaml($row) { - #echo yaml_emit($row); - $this->yamls[] = $row; + $yaml = yaml_emit($row); + $yaml = preg_replace('/^---\n/','',$yaml); + $yaml = preg_replace('/\n\.\.\.$/','',$yaml); + $yaml = preg_replace('/^/m',' ',$yaml); + echo '- '.trim($yaml)."\n"; } function rows_end_yaml() { - return yaml_emit($this->yamls); - unset($this->yamls); - return ''; + echo ''; } /*----------------------------------------------------------------- Xml -----------------------------------------------------------------*/ function rows_begin_xml() { - #return '<'.$this->name.'>'.PHP_EOL; - return '' + echo '' .''.PHP_EOL .''.PHP_EOL ; @@ -870,8 +867,8 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. } function rows_end_xml() { - #return 'name.'>'.PHP_EOL; - return ''.PHP_EOL; + #echo 'name.'>'.PHP_EOL; + echo ''.PHP_EOL; } /*----------------------------------------------------------------- @@ -894,16 +891,15 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. // NB 14.04.14 function rows_begin_table($opt=array()) { function rows_begin_table() { - $html = ''.PHP_EOL; + echo '
'.PHP_EOL; - $html .= ''; - $html .= ''; + echo ''; + echo ''; foreach (array_keys($this->fields()) as $f) { - $html .= ''; + echo ''; } - $html .= "".PHP_EOL; - return $html; + echo ''.PHP_EOL; } function rows_rec_table($row) { @@ -917,14 +913,14 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. } function rows_end_table() { - return "
'.$this->url_sort($f).''.$this->url_sort($f).'
".PHP_EOL; + echo ''.PHP_EOL; } /*----------------------------------------------------------------- Html Div -----------------------------------------------------------------*/ function rows_begin_div() { - return '
'.PHP_EOL; + echo '
'.PHP_EOL; } function rows_rec_div($row) {