Json
-----------------------------------------------------------------*/
function rows_begin_json() {
- echo '['.PHP_EOL;
$this->_row_json = null;
- return '';
+ echo '['.PHP_EOL;
}
function rows_rec_json($row) {
}
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 ''
.'<?xml version=“1.0” encoding=“utf-8”?>'.PHP_EOL
.'<db src="db.php" table="'.$this->name.'">'.PHP_EOL
;
}
function rows_end_xml() {
- #return '</'.$this->name.'>'.PHP_EOL;
- return '</db>'.PHP_EOL;
+ #echo '</'.$this->name.'>'.PHP_EOL;
+ echo '</db>'.PHP_EOL;
}
/*-----------------------------------------------------------------
// NB 14.04.14 function rows_begin_table($opt=array()) {
function rows_begin_table() {
- $html = '<table class="'.$this->name.' rows border">'.PHP_EOL;
+ echo '<table class="'.$this->name.' rows border">'.PHP_EOL;
- $html .= '<tr class="'.$this->name.' row bold">';
- $html .= '<th class="'.DB_HTML_EDIT.'"></th>';
+ echo '<tr class="'.$this->name.' row bold">';
+ echo '<th class="'.DB_HTML_EDIT.'"></th>';
foreach (array_keys($this->fields()) as $f) {
- $html .= '<th class="'.$f.'">'.$this->url_sort($f).'</th>';
+ echo '<th class="'.$f.'">'.$this->url_sort($f).'</th>';
}
- $html .= "</tr>".PHP_EOL;
- return $html;
+ echo '</tr>'.PHP_EOL;
}
function rows_rec_table($row) {
}
function rows_end_table() {
- return "</table>".PHP_EOL;
+ echo '</table>'.PHP_EOL;
}
/*-----------------------------------------------------------------
Html Div
-----------------------------------------------------------------*/
function rows_begin_div() {
- return '<div class="'.$this->name.' rows">'.PHP_EOL;
+ echo '<div class="'.$this->name.' rows">'.PHP_EOL;
}
function rows_rec_div($row) {