]> git.nbdom.net Git - nb.git/commitdiff
lib/postgres/nginx_vars.sql
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 21 Jun 2018 04:02:54 +0000 (05:02 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 21 Jun 2018 04:02:54 +0000 (05:02 +0100)
lib/php/db/table.php
lib/postgres/css_reference.sql
lib/postgres/html_tag.sql
lib/postgres/nginx_vars.sql [new file with mode: 0644]
www/dbq/dbq.php

index 319c7273f53aeca959692be4208eaa2f2841483f..9e137de026bf3a6e5efcac70849eab81b698ed09 100644 (file)
@@ -734,11 +734,11 @@ Class Table extends nb {
                        $next = 999999;
                }
 
-               if ($prev>=0) $html .= '<span class="prev"><a href="'.$this->url_list('limit',preg_replace('/^0,/','',"$prev,$y")).'">&lt;&lt;</a></span>&nbsp;';
+               if ($prev>=0) $html .= '<span class="prev"><a href="'.$this->url_list('limit',preg_replace('/^0,/','',"$prev,$y")).'">&lt;</a></span>&nbsp;';
 
                $html .= '<span class="count">'.($tot ? ($x+1) : 0).' - '.( $tot<($x+$y) ? $tot : ($x+$y) ).' / '.$tot.'</span>';
 
-               if ($next<$tot) $html .= '&nbsp;<span class="prev"><a href="'.$this->url_list('limit',"$next,$y").'">&gt;&gt;</a></span>';
+               if ($next<$tot) $html .= '&nbsp;<span class="prev"><a href="'.$this->url_list('limit',"$next,$y").'">&gt;</a></span>';
 
                return $html;
 
@@ -2139,9 +2139,7 @@ Class Table extends nb {
                $buttons = '<input type="submit" class="button button-small" value="Go"/>';
                if (!empty($opt['buttons'])) $buttons = $opt['buttons'];
 
-               #$r = '<form class="menu" method="get" action="?">'.NB_EOL;
                $r = '<form class="menu" method="get" action="'.$this->request_uri().'">'.NB_EOL;
-               #$r = '<form class="menu" method="get" action="'.$this->db()->base.preg_replace('/\?.*$/','',$_SERVER["REQUEST_URI"]).'">'.NB_EOL;
 
                # See: http://html5doctor.com/html5-forms-input-types/
                #$r .= '<input id="skill" type="range" min="1" max="100" value="0" />';
@@ -2150,7 +2148,8 @@ Class Table extends nb {
                //
                // Options
                //
-               if ($this->p('options')!=='0') {
+               $options = (bool)($this->p('table-menu-options')!=='0');
+               if ($options) {
 
                        $r .= '<div class="options">';
 
@@ -2217,18 +2216,25 @@ Class Table extends nb {
                        $r .= '</span>';
                        */
 
-                       // Hiddens
-                       $form_hidden = ['db','table','format','limit'];#,'download'];
-                       if ($this->show_hidden_params) $r .= ''#.print_r(self::$params,true)
-                               .self::form_hidden($form_hidden)
-                               // Embed for no html format (rent)
-# NB 08.06.18                          .'<input type="'.($this->p('debug') ? 'text' : 'hidden').'" name="download" value="0"/>';
-                       ;
+                       $form_hidden_ignore = ['db','table','format','limit'];#,'download'];
 
                        $r .= '</div>'; # < Options
 
+               } else { # // Options
+                       $form_hidden_ignore = ['limit'];
+                       $form_hidden_ignore = null;
+
                }
 
+               //
+               // 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                          .'<input type="'.($this->p('debug') ? 'text' : 'hidden').'" name="download" value="0"/>';
+               ;
+
                //
                // Criterias
                //
@@ -2248,7 +2254,7 @@ Class Table extends nb {
 
                }
 
-               if ($this->p('options')==='0') $r .= $buttons;
+               if (!$options) $r .= $buttons;
                $r .= '</div>'; # < Criterias
 
                ///
index d7ddd79d9a22e575e1d7163913c98ea35bb4dee8..5599e3a71e70a874a0d6d5de5a19d4b212378f38 100644 (file)
@@ -10,6 +10,6 @@ COPY css_reference (name,description,link) FROM PROGRAM '. /etc/profile && html2
 next unless /^align-content .*Specifies/ .. /^z-index/ and /^[a-z]/; \
 s/\s+/\t/; \
 chomp; /^(\S+)/; \
-print qq|\$_\thttps://www.w3schools.com/cssref/css3_pr_\$1.asp\n|" \
+print qq|\$_\thttps://www.w3schools.com/cssref/pr_\$1.asp\n|" \
 ' WITH (format 'text', NULL ''); 
 COMMIT;
index eb8aaf6695ab8e22a25c0b9bb4bac0be2e3e0f50..b5fd3fd7bb2933696dddb1fdf4a434d8a4621bb7 100644 (file)
@@ -8,7 +8,7 @@ BEGIN TRANSACTION;
 DELETE FROM html_tag;
 COPY html_tag (tag,link,description) FROM PROGRAM '. /etc/profile && html2txt https://html.com/tags/ \
 | grep "^<" \
-| sed -E -e "s/ *HTML Tag *//" -e "s,^<([^>]+)>,\1\thttps://html.com/tags/iframe/\1/\t," \
+| sed -E -e "s/ *HTML Tag *//" -e "s,^<([^>]+)>,\1\thttps://html.com/tags/\1/\t," \
 ' WITH (format 'text', NULL ''); 
 COMMIT;
 
diff --git a/lib/postgres/nginx_vars.sql b/lib/postgres/nginx_vars.sql
new file mode 100644 (file)
index 0000000..dff9696
--- /dev/null
@@ -0,0 +1,15 @@
+DROP TABLE IF EXISTS nginx_vars;
+CREATE TABLE IF NOT EXISTS nginx_vars (
+  name varchar(200),
+  module varchar(200) DEFAULT '',
+  link varchar(2000)
+);
+BEGIN TRANSACTION;
+DELETE FROM nginx_vars;
+COPY nginx_vars (link,name,module) FROM PROGRAM '. /etc/profile && http_get https://nginx.org/en/docs/varindex.html | \
+xmllint --html --xpath "/html/body//div[@id=\"content\"]//a" - 2>/dev/null | \
+sed -E "s,<a href=\"([^\"]+)\">([^<]+)</a> *(\(([^\)]+)\))?,https://nginx.org/en/docs/\1\t\2\t\4\n,g" | \
+cat \
+' WITH (format 'text', NULL ''); 
+COMMIT;
+
index 9dbcc67ae2965cb0cbfb8dc2b63dde7daf9225fe..f01ee920f7378b686a1c9c5546734884314a1fb2 100644 (file)
@@ -510,9 +510,13 @@ class DbQ extends nb {
        private function table_rows($fct=null) {
                $ropt = [
                        #'html_menu' => empty($this->_nopage),
-# NB 07.06.18                  'is_html' => empty($this->_nopage),
-# NB 20.06.18                  'is_html' => $this->is_html,
-                       'is_html' => ($this->is_html and empty($this->_nopage)),
+
+                       # With limit or criterias or page next
+                       'is_html' => $this->is_html,
+
+                       # Without limit or criterias or page next
+# NB 20.06.18                  'is_html' => ($this->is_html and empty($this->_nopage)),
+
                ];
                $this->db->is_html = $ropt['is_html'];
                $this->db->limit = $ropt['is_html'] ? $this->limit() : null;