.. (content:sub(p2+1))
end
- content = nb:html_fix(content)
+ content = self:html_fix(content)
template.render(content,vars)
ngx.exit(0)
function nb:md2html(content)
if self.discount == nil then self.discount = require("discount") end
content = self.discount(content)
+ if content then
+ content = '<div class="md">' .. content .. '</div>'
+ end
return content
end
$this->tot = $opt['tot'] = $tot;
} # < is_html
+ if (!isset($opt['tot'])) $opt['tot'] = $opt['count'];
if ($count === 0 and !$format) {
echo $this->{"rows_begin_$format"}($fields,$opt);
$this->page->headers_no_cache();
$this->page->js = $this->js;
+
+ if ($this->base) {
+ if (!empty($this->db)) $this->db->base = $this->base . $this->db->base;
+ if (!empty($this->table)) $this->table->base = $this->base . $this->table->base;
+ foreach( (array)$this->page->css as $k=>$v ) { $this->page->css[$k] = $this->base . $v; }
+ foreach( (array)$this->page->js as $k=>$v ) { $this->page->js[$k] = $this->base . $v; }
+ }
+
$this->conf = [
'db.base' => ( empty($this->db) ? '' : $this->db->base ),
'table.base' => ( empty($this->table) ? '' : $this->table->base ),
;
- if ($this->base) $this->page->head[] = '<base href="' . $this->base . '" />';
+ if ($this->base) $this->page->head[] = '<base href="' . $this->base . '/" />';
+#debug($this->base);
$this->page->begin();
} # if (empty($this->_nopage)) {
$bottom = [];
if ($this->http->user()) {
- $bottom[] = '<a href="/logout"'
- .($this->http->user() ? ' style="background:url(\'/ldap/jpegPhoto.jpg?w=20\') right no-repeat;padding-right:22px"' : '')
+ $bottom[] = '<a href="' . $this->base . '/logout"'
+ .($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().')'
}
- if ($base = $this->client_header('Dbq-Base')) $this->base = $base;
return $this->params;
}
}
} # < Class Dbq
-$DBQ = new DbQ(['run'=>true]);
+$DBQ = new DbQ([
+ 'run' => true,
+ 'base' => (($base = Dbq::client_header('Dbq-Base')) ? preg_replace(',/+$,','',$base) : ''),
+]);
?>