diff options
author | Phil Davis <phil.davis@inf.org> | 2017-01-10 20:33:55 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2017-01-10 20:33:55 +0545 |
commit | edcd75357f0e93b124159314d3306197d5312e6c (patch) | |
tree | 6794b7c6bfc78f057e2990bca7096a733c70cb0f /src/usr/local/www/guiconfig.inc | |
parent | c50f228a1583fe694993778e8576322877a15bba (diff) | |
download | pfsense-edcd75357f0e93b124159314d3306197d5312e6c.zip pfsense-edcd75357f0e93b124159314d3306197d5312e6c.tar.gz |
Breadcrumb links
Diffstat (limited to 'src/usr/local/www/guiconfig.inc')
-rw-r--r-- | src/usr/local/www/guiconfig.inc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc index 927e85f..d83e8e6 100644 --- a/src/usr/local/www/guiconfig.inc +++ b/src/usr/local/www/guiconfig.inc @@ -492,13 +492,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) { |