]> git.nbdom.net Git - nb.git/commitdiff
db/index.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 17 Nov 2016 12:15:40 +0000 (12:15 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 17 Nov 2016 12:15:40 +0000 (12:15 +0000)
etc/dbq/ui.php
lib/php/db/index.php

index 6f1f2c7255662bc70fd53d97fdf0363a90cc8d00..9ed515627dadae176d936a6080390bd111ba8da1 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 #$GLOBALS['web'] = Db::p('extras')==='0' ? true : false;
+if (empty($DIR_SQLITE) or !file_exists('/opt/www/sem_ui/var/db/semantico.db')) return;
 $GLOBALS['web'] = true;
 if (Db::p('noextra')==='1') $GLOBALS['web'] = false;
 
index 19cfd6634493d2029a1f630a0be50cce1ec9caa4..06d95843503fc8e1b328a22236eee700d37cca63 100755 (executable)
@@ -14,5 +14,16 @@ if(defined('DB_NO_ACTION') and DB_NO_ACTION) return true;
 # Happend when include from a function
 if (!isset($Db)) global $Db, $Table;
 
+switch ($Db->mime2ext($Db->content_type())) {
+  case "html":
+    $Db->pdef('format','table');
+    break;
+  case "txt":
+    $Db->pdef('format','human');
+    break;
+  default:
+    #bye($type);
+    $Db->pdef('format','csv');
+}
 return $Db->action($Db->p('action'),$Table);
 ?>