summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/guiconfig.inc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2017-01-10 20:33:55 +0545
committerPhil Davis <phil.davis@inf.org>2017-02-11 18:25:50 +0545
commitde02dc292637fb731986719dbf8c8ead5fae4912 (patch)
tree89e3bbf1db16143f031efb77dd0162be4af90880 /src/usr/local/www/guiconfig.inc
parent990bc1fb8b2e577e7a332b7b1e24b2faa3f3be27 (diff)
downloadpfsense-de02dc292637fb731986719dbf8c8ead5fae4912.zip
pfsense-de02dc292637fb731986719dbf8c8ead5fae4912.tar.gz
Breadcrumb links
(cherry picked from commit edcd75357f0e93b124159314d3306197d5312e6c)
Diffstat (limited to 'src/usr/local/www/guiconfig.inc')
-rw-r--r--src/usr/local/www/guiconfig.inc15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc
index 190a662..abcf0ad 100644
--- a/src/usr/local/www/guiconfig.inc
+++ b/src/usr/local/www/guiconfig.inc
@@ -517,13 +517,24 @@ function gentitle($title) {
}
}
-function genhtmltitle($title, $links=array()) {
+function genhtmltitle($title, $links=true) {
+
+ $num_crumbs = count($title);
// If the array contains only one element, there are no breadcrumbs, so don't
// add anything else
- if (count($title) > 1) {
+ if ($num_crumbs > 1) {
$bc = '<ol class="breadcrumb">';
+ if (!is_array($links)) {
+ $gen_default = ($links === true);
+ $links = array_fill(0, $num_crumbs, '');
+ // If no links passed, then default to a link to self on the last entry.
+ if ($gen_default) {
+ $links[$num_crumbs-1] = '@self';
+ }
+ }
+
foreach ($title as $idx => $el) {
$href = $links[$idx];
if (strlen($href) > 0) {
OpenPOWER on IntegriCloud