*/
if ($action == 'help') {
- $this->page($this->db,[
- [ 'help', 'This help' ],
- [ 'ls', 'List configured databases' ],
- # NB 14.12.22 [ 'databases', 'List others databases' ],
- [ 'random_str', 'Generate a random string' ],
- [ 'ssha_password', 'Encrypt a password' ],
- [ 'ssha512_password', 'Encrypt a password' ],
- [ 'logout', 'Clear Basic Auth' ],
- [ 'status', 'Status infos page' ],
- [ 'conf', 'Dump json infos' ],
- [ 'types', 'Available mime types' ],
- ] + (
- ($this->perm < self::ADMIN) ? [] :
- [
-# NB 07.02.18 [ 'ldap', 'Connect to domain ldap server [/FILTER/ATTRS' ],
- [ 'phpinfo', 'Phpinfo' ],
- [ '_SERVER', 'Dump _SERVER' ],
- [ '_REQUEST', 'Dump _REQUEST' ],
- ]
- )
- ,['command','description'],function(&$r) {
- $r['command'] = $this->page->tag('a',$r['command'],'href="'
- .$this->db->base.'/'.($r['command'] == self::PARAM_DB_DEFAULT
- ? ''
- : $r['command']
- )
- .'"');
- });
+ $this->page($this->db
+ # Rows
+ ,array_merge(
+ [
+ [ 'help', 'This help' ],
+ [ 'ls', 'List configured databases' ],
+ # NB 14.12.22 [ 'databases', 'List others databases' ],
+ [ 'random_str', 'Generate a random string' ],
+ [ 'ssha_password', 'Encrypt a password' ],
+ [ 'ssha512_password', 'Encrypt a password' ],
+ [ 'logout', 'Clear Basic Auth' ],
+ [ 'status', 'Status infos page' ],
+ [ 'conf', 'Dump api infos and params' ],
+ [ 'types', 'Available mime types' ],
+ ],
+ (
+ ($this->perm < self::ADMIN) ? [] :
+ [
+ # NB 07.02.18 [ 'ldap', 'Connect to domain ldap server [/FILTER/ATTRS' ],
+ [ 'phpinfo', 'Phpinfo' ],
+ [ '_SERVER', 'Dump _SERVER' ],
+ [ '_REQUEST', 'Dump _REQUEST' ],
+ ]
+ )
+ )
+ # Head
+ ,['command','description']
+ # Print
+ ,function(&$r) {
+ $r['command'] = $this->page->tag('a',$r['command'],
+ 'href="'.$this->db->base.'/'
+ .($r['command'] == self::PARAM_DB_DEFAULT
+ ? ''
+ : $r['command']
+ )
+ .'"');
+ })
+ ;
} elseif ($action == 'ls') {