From: Nicolas Boisselier Date: Mon, 6 Aug 2018 21:42:58 +0000 (+0100) Subject: lib/php/db/table.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=0d488d664b594151b71e0556a9685b80b102e9fa;p=nb.git lib/php/db/table.php --- diff --git a/lib/lua/nb.lua b/lib/lua/nb.lua index 41a59edc..175eba1b 100644 --- a/lib/lua/nb.lua +++ b/lib/lua/nb.lua @@ -26,11 +26,11 @@ function nb:ngx_rows(url) if not rows then rows = {} end local count = 0 for _,row in pairs(rows) do count = count+1 end - local langs = {} - local count = 0 for _,row in pairs(rows) do + --local langs = {} langs["eng"] = 1 + local count = 0 + for _,row in pairs(rows) do count = count + 1 - local lang = rows.lang - --langs[lang] = rows.lang + --langs[rows.lang] = 1 end return { diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 8a60887a..cbfa10a6 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -1206,7 +1206,7 @@ Class Table extends nb { $opt['use_out'] = false; if ($this->p('out') or !preg_match('/^('.join('|', - [ '','template','table','sql','_div','wp' ] # local + [ '','template','table','_div','sql','wp' ] # local ).')$/',$format)) { @@ -1296,7 +1296,12 @@ Class Table extends nb { foreach ($fields as $f => $field) { if (!$this->field($f)) continue; + # + # Mime content + $row[$f] = $field->htmlValue($row[$f]); + $row[$f] = $field->out(isset($row[$f]) ? $row[$f] : ''); + $count_fields++; } @@ -1634,9 +1639,6 @@ Class Table extends nb { if ($this->buttons() and !empty($buttons[0])) $html .= ''.$buttons[0].''.NB_EOL; foreach ($row as $k => $v) { - if ( !empty($this->field($k)) ) { - $v = $this->field($k)->htmlValue($v); - } $html .= '_rows_table_class($this->field($k)).'>'.$v.''.NB_EOL; } diff --git a/lib/php/mime.php b/lib/php/mime.php index 3f724045..1650dbeb 100644 --- a/lib/php/mime.php +++ b/lib/php/mime.php @@ -831,7 +831,7 @@ class Mime { } - public static function html_img_data($str) { + private static function html_img_jpeg($str) { $v = self::is_base64($str) ? $v : base64_encode($str); return ''; } @@ -860,7 +860,7 @@ class Mime { },$str) and $str != $v) return $v; } elseif (preg_match('@^image/@',$mime)) { - return self::html_img_data($str); + return self::html_img_jpeg($str); } #return $str .= '|'.$mime;