function dbq_run() {
+ $colors = [
+ 'text' => '#ddd',
+ 'background' => '#009B9C',
+ ];
#
# Url
if (empty($_SERVER['HTTP_USER_AGENT'])) $_SERVER['HTTP_USER_AGENT'] = '';
# Page
if (empty($_SERVER['DOCUMENT_ROOT'])) $_SERVER['DOCUMENT_ROOT'] = dirname(__FILE__).'/html';
require_once($_SERVER['DOCUMENT_ROOT'].'/../../../lib/php/page.php');
- #debug(nb::p());
- #debug($params);
- $title = array_filter(array_unique(array_slice(array_values($params),1)),function($v){ return($v=='ls' ? '' : $v); });
- array_unshift($title,'Home');
$params['ext'] = $ext;
- $path = '/';
- $nav = [];
- #debug($title);
- $i = 0;
- foreach ($title as $k=>$v) {
- if ($i == 0) {
- $nav[] = [$v,'/'];
- } else {
- $nav[] = [$v,"$path$v.".$params['ext']];
- $path .= "$v/";
- }
- $i++;
- }
+ list($title,$nav) = title_nav($params);
#debug($nav);
$Page = new Page([
'css' => '/default.css',
'title' => join(' ',$title),
- #'h1' => join(' ',array_map(function($v) use($Page,$params){},$nav)),
'nav' => $nav,
]);
+ if (!empty($colors)) $Page->css_code = trim('
+body, .button {
+ color: '.$colors['text'].';
+ background-color: '.$colors['background'].';
+}
+.button {
+ border-color: '.$colors['text'].';
+}
+table.rows,
+div.rows,
+.menu,
+object, iframe, pre
+{
+ border-color: '.$colors['text'].';
+}
+table.rows th, table.rows td { border-color: '.$colors['text'].'; }
+');
$Page->content_type($Page->ext2mime($params['format']) ? $Page->ext2mime($params['format']) : 'text/plain');
if ($Page->is('text') and !$Page->is('html')) $Page->content_type('text/plain');
$Page->headers_no_cache();
echo "$msg\n";
exit;
}
+
+function title_nav($params) {
+ $title = array_filter(array_unique(array_slice(array_values($params),1)),function($v){ return($v=='ls' ? '' : $v); });
+ array_unshift($title,'Home');
+ $path = '/';
+ $nav = [];
+ $i = 0;
+ foreach ($title as $k=>$v) {
+ if ($i == 0) {
+ $nav[] = [$v,'/'];
+ } else {
+ $nav[] = [$v,"$path$v.".$params['ext']];
+ $path .= "$v/";
+ }
+ $i++;
+ }
+ return [$title,$nav];
+}
# NB 05.12.16 function row_a(&$v) {
# NB 05.12.16 $v = Page::tag('a',$r['command'],'href="'.$r['command'].'.'.$params['ext'].'"');
# NB 05.12.16 }
margin-right: auto;
padding-left: 1em;
padding-right: 1em;
- background-color: #009B9C;
}
h1 {
margin: 0 0 0.2em 0;
}
-a,
-body {
- color: #ddd;
+a {
+ color :inherit;
+}
+
+a, a:visited {
+ text-decoration: none;
}
ul {
padding: 0 0 0 0.3em;
}
-a, a:visited {
- text-decoration: none;
-}
-
table { border-collapse: collapse; }
td, th { padding: 0.2em 0.7em; }
.menu,
object, iframe, pre
{
+ border-radius: 2px;
border-collapse: separate;
border-spacing: 0;
- border-radius: 2px;
- border: solid 1px #ddd;
padding: 0.5em 0.2em;
margin-bottom: 0.5em;
+ border: solid 1px;
}
table.rows { padding: 0; }
-table.rows th, table.rows td { border-bottom: solid 1px #ddd; }
+table.rows th, table.rows td { border-bottom: solid 1px; }
table.rows tr:last-child td { border-bottom: none; }
.menu, .nav, .rows,
text-decoration: none;
line-height: 1.5em;
cursor: pointer;
- background-color: #ddd;
- border: solid 1px #ddd;
border-radius: 4px;
white-space: nowrap;
box-sizing: border-box;
- color: #ddd;
margin: 0;
padding: 0 0.2em;
- color: #009B9C;
}
a:hover,