From da8f2f70a513163c5bdec3d4e0fd5658c387196e Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 28 Sep 2018 16:33:22 +0100 Subject: [PATCH] www/dbq/dbq.php --- lib/php/db/table.php | 29 ++++++++++---------- lib/php/out/table.php | 2 +- www/dbq/dbq.php | 52 +++++++++++++++++++----------------- www/dbq/html/default.css | 23 +++++++++++----- www/dbq/html/default.min.css | 2 +- 5 files changed, 61 insertions(+), 47 deletions(-) diff --git a/lib/php/db/table.php b/lib/php/db/table.php index d72e9d15..72ec6669 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -633,7 +633,7 @@ Class Table extends nb { #.'
' .'
' .( empty($_SERVER['HTTP_REFERER']) ? '' : '') - .'' + .'' .'' .'
'.NB_EOL #.'
'.NB_EOL @@ -2169,10 +2169,10 @@ Class Table extends nb { #$r .= ''; #$r .= ''; + $options = (bool)($this->p('table-menu-options')!=='0'); // // Options // - $options = (bool)($this->p('table-menu-options')!=='0'); if ($options) { $option_html = ''; @@ -2250,15 +2250,6 @@ Class Table extends nb { } - // - // Hidden - // - if ($this->show_hidden_params) $r .= ''#.print_r(self::$params,true) - .self::form_hidden($form_hidden_ignore) - // Embed for no html format (rent) -# NB 08.06.18 .''; - ; - // // Criterias // @@ -2277,13 +2268,21 @@ Class Table extends nb { ; } - if (!$options) $r .= $buttons; $r .= ''; # < Criterias - /// - // Bye - /// + // + // Hidden + // + if ($this->show_hidden_params) $r .= ''#.print_r(self::$params,true) + .self::form_hidden($form_hidden_ignore) + // Embed for no html format (rent) +# NB 08.06.18 .''; + ; + + // + // End menu + // $r .= ''.NB_EOL; return $r; } diff --git a/lib/php/out/table.php b/lib/php/out/table.php index 8f73838b..bfaf16f0 100644 --- a/lib/php/out/table.php +++ b/lib/php/out/table.php @@ -1,7 +1,7 @@ true, - 'enclose' => array("".NB_EOL,"
".NB_EOL), + 'enclose' => array("".NB_EOL,"
".NB_EOL), 'tag_enclose' => 'tr class="db-row"', 'tag_head' => 'th', 'tag' => 'td', diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 698243b7..9773d355 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -345,34 +345,38 @@ class DbQ extends nb { $bottom = []; - if ($this->http->user()) { - $bottom[] = 'db->conf['ldap']) and $this->http->user() ) - ? ' style="background:url(\'' . $this->base . '/ldap/me.jpg?w=20\') right no-repeat;padding-right:22px"' - : '' - ) - .'>Logout: ' - .$this->http->user() - .' (can: '.$this->perm2h().')' - .''; - } + $this->page_bottom(); + $this->page->end(); + } - if ($this->perm >= self::ADMIN and !empty($this->db->pdo)) { - $r = [ - '/(^|;)password=[^;]*/' => '', - '/;/' => ' ', - ]; - $bottom[] = 'Database: '.preg_replace(array_keys($r),$r,$this->db->pdo); - } + exit; + } - if ($bottom and $this->is_html) echo $this->page->tag('div class="block bottom card"',join('
'.NB_EOL,$bottom)); + private function page_bottom() { + if ($this->http->user()) { + $bottom[] = 'db->conf['ldap']) and $this->http->user() ) + ? ' style="background:url(\'' . $this->base . '/ldap/me.jpg?w=20\') right no-repeat;padding-right:22px"' + : '' + ) + .'>Logout: ' + .$this->http->user() + .' (can: '.$this->perm2h().')' + .''; + } - $this->page->end(); + + if ($this->perm >= self::ADMIN and !empty($this->db->pdo)) { + $r = [ + '/(^|;)password=[^;]*/' => '', + '/;/' => ' ', + ]; + $bottom[] = 'Database: '.preg_replace(array_keys($r),$r,$this->db->pdo); } - exit; + if ($bottom and $this->is_html) echo $this->page->tag('div class="block bottom border rounded p-2 d-table"',join('
'.NB_EOL,$bottom)); } public function user() { @@ -559,7 +563,7 @@ class DbQ extends nb { $r = $this->ar_unshift($r,'view','' .'
' - .'View' + .'View' .$hidden .'
' ); @@ -575,7 +579,7 @@ class DbQ extends nb { $rm = $this->uri_add_referer($this->table->base.'/rm'); $r['delete'] = '' .'
' - .'Delete' + .'Delete' .$hidden .'
' ; diff --git a/www/dbq/html/default.css b/www/dbq/html/default.css index 5cfcc54a..5eb0ec03 100644 --- a/www/dbq/html/default.css +++ b/www/dbq/html/default.css @@ -13,6 +13,13 @@ body { color: #444444; } +h1 select { + padding: 0; + border: none; + background: inherit; + font: inherit; +} + a { color: inherit; } @@ -322,14 +329,18 @@ body.loader { h1 { margin: 0 0 0.2em 0; - font-size: 160%; + font-size: 140%; padding-bottom: 0.3em; margin-bottom: 0.5em; } -h1.zaza select { - padding: 0; - border: none; - background: inherit; - font: inherit; +.menu * { + font-size: 90%; +} +.menu .btn, +.menu .form-control { + max-width: 5rem; + height: 1.7rem; + padding-top: 0; + padding-bottom: 0; } diff --git a/www/dbq/html/default.min.css b/www/dbq/html/default.min.css index 8fb25b98..ee71ab9d 100644 --- a/www/dbq/html/default.min.css +++ b/www/dbq/html/default.min.css @@ -1 +1 @@ -@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.loader{border:16px solid #fff;border-radius:50%;border-top:16px solid #000;padding:0;margin:0 auto 0 auto;width:8em;height:8em;animation:spin 2s linear infinite;display:block}body.loader{margin-top:8em}.loader *{display:none!important}h1{margin:0 0 .2em 0;font-size:160%;padding-bottom:.3em;margin-bottom:.5em}h1.zaza select{padding:0;border:none;background:inherit;font:inherit} +@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.loader{border:16px solid #fff;border-radius:50%;border-top:16px solid #000;padding:0;margin:0 auto 0 auto;width:8em;height:8em;animation:spin 2s linear infinite;display:block}body.loader{margin-top:8em}.loader *{display:none!important}h1{margin:0 0 .2em 0;font-size:140%;padding-bottom:.3em;margin-bottom:.5em}.menu *{font-size:90%}.menu .btn,.menu .form-control{max-width:5rem;height:1.7rem;padding-top:0;padding-bottom:0} -- 2.47.3