diff options
author | k-paulius <k.dash.paulius@gmail.com> | 2016-02-15 23:29:27 -0600 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-02-16 17:33:03 -0500 |
commit | 9014e27c61b7c342816019f43d8323b675e5773e (patch) | |
tree | a27edf42a8256fc3e90b5ddacecbe2dd91e7617e | |
parent | d5831abcc37d1bc5c6cac17946586c651e21717d (diff) | |
download | pfsense-9014e27c61b7c342816019f43d8323b675e5773e.zip pfsense-9014e27c61b7c342816019f43d8323b675e5773e.tar.gz |
Do not generate empty tags if there is no link.
-rw-r--r-- | src/usr/local/www/head.inc | 14 | ||||
-rw-r--r-- | src/usr/local/www/shortcuts.inc | 3 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/usr/local/www/head.inc b/src/usr/local/www/head.inc index 66c6940..4a52da6 100644 --- a/src/usr/local/www/head.inc +++ b/src/usr/local/www/head.inc @@ -512,9 +512,17 @@ if (!$hide_service_status && !empty($shortcuts[$shortcut_section]['service'])) { } } -echo '<li>'. get_shortcut_main_link($shortcut_section, false). '</li>'; -echo '<li>'. get_shortcut_status_link($shortcut_section, false). '</li>'; -echo '<li>'. get_shortcut_log_link($shortcut_section, false). '</li>'; +if ('' != ($link = get_shortcut_main_link($shortcut_section, false))) { + echo '<li>' . $link . '</li>'; +} + +if ('' != ($link = get_shortcut_status_link($shortcut_section, false))) { + echo '<li>' . $link . '</li>'; +} + +if ('' != ($link = get_shortcut_log_link($shortcut_section, false))) { + echo '<li>' . $link . '</li>'; +} ?> <?php if (!$g['disablehelpicon']): ?> diff --git a/src/usr/local/www/shortcuts.inc b/src/usr/local/www/shortcuts.inc index 7e86f66..d74ded2 100644 --- a/src/usr/local/www/shortcuts.inc +++ b/src/usr/local/www/shortcuts.inc @@ -123,6 +123,7 @@ function get_shortcut_main_link($shortcut_section, $addspace = true, $service = if (!empty($link) && ($_SERVER['REQUEST_URI'] != "/{$link}")) { return "{$space}<a href=\"{$link}\" title=\"" . gettext("Related settings") . "\"><i class=\"fa fa-sliders\"></i></a>"; } + return ""; } function get_shortcut_status_link($shortcut_section, $addspace = true, $service = array()) { @@ -151,6 +152,7 @@ function get_shortcut_status_link($shortcut_section, $addspace = true, $service if (!empty($link)) { return "{$space}<a href=\"{$link}\" title=\"" . gettext("Related status") . "\"><i class=\"fa fa-cog\"></i></a>"; } + return ""; } function get_shortcut_log_link($shortcut_section, $addspace = true) { @@ -159,6 +161,7 @@ function get_shortcut_log_link($shortcut_section, $addspace = true) { if (!empty($shortcut_section) && !empty($shortcuts[$shortcut_section]['log'])) { return "{$space}<a href=\"{$shortcuts[$shortcut_section]['log']}\" title=\"" . gettext("Related log entries") . "\"><i class=\"fa fa-list-alt\"></i></a>"; } + return ""; } // Load shortcuts |