From e0b060b3fb6469f645b8dc3996b44ac4b2a73fb2 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 13 Oct 2017 16:45:08 +0100 Subject: [PATCH] www/dbq/dbq.php --- lib/php/page.php | 4 ++-- share/db/update.sh | 2 +- www/dbq/dbq.php | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/php/page.php b/lib/php/page.php index f9b06516..c9a2e160 100644 --- a/lib/php/page.php +++ b/lib/php/page.php @@ -503,8 +503,8 @@ class Page extends nb { $text = $v[0]; $attr = $v[1]; - if (is_array($attr)) { - # k => v + if (is_array($attr)) { + # k => v $attr_ = $attr; $attr = []; diff --git a/share/db/update.sh b/share/db/update.sh index 0b3f1583..3ecb7ad4 100755 --- a/share/db/update.sh +++ b/share/db/update.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash --login +#!/bin/bash --login set +e dir=$(dirname "$0") tmp=`mktemp -d` diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 0d455276..3dc49740 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -357,10 +357,11 @@ class DbQ extends nb { $title = []; if (!empty($this->title)) $title['title'] = $this->title; + foreach (array_unique(array_slice(array_keys($params),1,3)) as $k) { if (in_array($k,self::ACTIONS_NO_TITLE)) continue; $v = $params[$k]; - $title[$k] = $v; + if ($v) $title[$k] = $v; } @@ -384,6 +385,7 @@ class DbQ extends nb { ]; $path .= $v . "/"; + $title[$k] = $this->prettyText($v); } @@ -391,7 +393,7 @@ class DbQ extends nb { } - return [$title,$nav]; + return [array_values($title),$nav]; } public function parse_uri() { -- 2.47.3