if ($run) $this->run();
}
- public function json() {
+ public function conf() {
$rows = [];
- foreach ($this->json as $k=>$v) $rows[] = ['name'=>$k,'value'=>$v];
+ foreach ($this->conf as $k=>$v) $rows[] = ['name'=>$k,'value'=>$v];
return $rows;
}
$this->page->headers_no_cache();
$this->page->js = $this->js;
- $this->json = [
+ $this->conf = [
'db.base' => ( empty($this->db) ? '' : $this->db->base ),
'table.base' => ( empty($this->table) ? '' : $this->table->base ),
'default.format' => $this->format_html,
'perm' => $this->perm,
'perms' => $this->perms,
];
- $this->page->js_code = 'window._dbq = '.json_encode($this->json);
+ $this->page->js_code = 'window._dbq = '.json_encode($this->conf);
# NB 22.05.17 if (is_scalar($obj) and $obj != 'logout') {
if ($obj != 'logout') {
and $connect === true
) {
if (empty($this->db->conf[$this->params['db']]))
- $this->not_found('Unknown database: '.$this->params['db']);
+ $this->not_found('Unknown db: '.$this->params['db']);
$connect = $this->db->conf[$this->params['db']];
}
# NB 23.11.17: Handle format for /vi/
if ($this->params['format'] != $this->format_html) {
- #bye([$this->format_cli,$this->params['format']]);
- if ($this->params['format'] == $this->format_cli) $this->db->format = $this->params['format'] = 'txt';
+
$row = $this->db->query2h($this->table->sql_edit($values));
if ($fields) {
foreach ($row as $k=>$v) {
}
}
- $this->db->out->header(false);
+ if ($this->params['format'] == $this->format_cli) $this->db->format = $this->params['format'] = 'txt';
+ $this->db->out->header($this->p('header',false));
$this->db->out($row);
return;
}
[ 'ssha512_password', 'Encrypt a password' ],
[ 'logout', 'Clear Basic Auth' ],
[ 'status', 'Status infos page' ],
- [ 'json', 'Dump json infos' ],
+ [ 'conf', 'Dump json infos' ],
+ [ 'types', 'Available mime types' ],
] + (
($this->perm < self::ADMIN) ? [] :
[
$r['id'] = $this->page->tag('a',$r['id'],'href="'.$this->db->base.'/'.$r['id'].'"');
});
- } elseif ($action == 'logout') {
-
- #$this->logout();
- $this->page($this,'logout');
-
- } elseif ($action == 'ssha_password') {
- $this->page($this,'ssha_password');
-
- } elseif ($action == 'ssha512_password') {
- $this->page($this,'ssha512_password');
-
- } elseif ($action == 'cryptkey') {
- $this->page($this->db,'cryptkey',['key']);
-
- } elseif ($action == 'status') {
- $this->page($this,'status');
-
- } elseif ($action == 'json') {
- $this->page($this,'json');
+ } elseif ($action == 'logout') { $this->page($this,'logout');
+ } elseif ($action == 'ssha_password') { $this->page($this,'ssha_password');
+ } elseif ($action == 'ssha512_password') { $this->page($this,'ssha512_password');
+ } elseif ($action == 'cryptkey') { $this->page($this->db,'cryptkey',['key']);
+ } elseif ($action == 'status') { $this->page($this,'status');
+ } elseif ($action == 'conf') { $this->page($this,'conf');
+ } elseif ($action == 'types') {
+ $types = [];
+ foreach (array_keys($this->db->out->types()) as $type) {
+ $types[] = [ 'type' => $type ];
+ }
+ $this->page($types);
+ // NOW ONLY FOR ADMIN !
} elseif ($this->perm < self::ADMIN) {
- // NOW ONLY FOR ADMIN !
} elseif ($action == 'phpinfo') {
$this->rows_table($action,$this->phpinfo_rows());