diff options
Diffstat (limited to 'src/usr/local/www')
-rw-r--r-- | src/usr/local/www/guiconfig.inc | 19 | ||||
-rw-r--r-- | src/usr/local/www/head.inc | 2 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc index d4fc383..927e85f 100644 --- a/src/usr/local/www/guiconfig.inc +++ b/src/usr/local/www/guiconfig.inc @@ -492,15 +492,28 @@ function gentitle($title) { } } -function genhtmltitle($title) { +function genhtmltitle($title, $links=array()) { // If the array contains only one element, there are no breadcrumbs, so don't // add anything else if (count($title) > 1) { $bc = '<ol class="breadcrumb">'; - foreach ($title as $el) { - $bc .= '<li>'.$el.'</li>'; + foreach ($title as $idx => $el) { + $href = $links[$idx]; + if (strlen($href) > 0) { + // For convenience, if the caller specifies '@self' then make a link + // to the current page, including any query string. + if ($href == '@self') { + $href = $_SERVER['REQUEST_URI']; + } + if (substr($href, 0, 1) != '/') { + $href = '/' . $href; + } + $bc .= '<li><a href="' . htmlentities($href) . '">' . $el . '</a></li>'; + } else { + $bc .= '<li>' . $el . '</li>'; + } } $bc .= '</ol>'; diff --git a/src/usr/local/www/head.inc b/src/usr/local/www/head.inc index 6205772..8c3b223 100644 --- a/src/usr/local/www/head.inc +++ b/src/usr/local/www/head.inc @@ -514,7 +514,7 @@ if (are_notices_pending()) { print('<br />'); unset($notitle); } else { - print(genhtmltitle($pgtitle)); + print(genhtmltitle($pgtitle, $pglinks)); } ?> <ul class="context-links"> |