oops... broke the header links, fixed it so it should work for both the status page and the default header.

This commit is contained in:
Ad Schellevis 2015-04-13 15:55:03 +00:00
parent 39628a1ae6
commit fd7ec79bc5
2 changed files with 18 additions and 19 deletions

View File

@ -1,9 +0,0 @@
<?php
global $shortcuts;
$shortcuts['upnp'] = array();
$shortcuts['upnp']['main'] = "pkg_edit.php?xml=miniupnpd.xml";
$shortcuts['upnp']['log'] = "diag_logs_routing.php";
$shortcuts['upnp']['status'] = "status_upnp.php";
$shortcuts['upnp']['service'] = "miniupnpd";

View File

@ -87,7 +87,10 @@ function get_shortcut_main_link($shortcut_section, $addspace = true, $service =
break;
}
if(!empty($link) && ($_SERVER['REQUEST_URI'] != "/{$link}"))
return "{$space}<a href=\"{$link}\" class=\"btn btn-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"" . gettext("Main page for this section") . "\"><span class=\"glyphicon glyphicon-home\"></span></a>";
if (strtok($_SERVER['REQUEST_URI'],'?') != "/status_services.php")
return "{$space}<a href=\"{$link}\" title=\"" . gettext("Main page for this section") . "\">Main page</a>";
else
return "{$space}<a href=\"{$link}\" class=\"btn btn-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"" . gettext("Main page for this section") . "\"><span class=\"glyphicon glyphicon-home\"></span></a>";
}
function get_shortcut_status_link($shortcut_section, $addspace = true, $service = array()) {
@ -111,24 +114,29 @@ function get_shortcut_status_link($shortcut_section, $addspace = true, $service
break;
}
if(!empty($link))
return "{$space}<a href=\"{$link}\" class=\"btn btn-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"" . gettext("Status of items on this page") . "\"><span class=\"glyphicon glyphicon-eye-open\"></span></a>";
if (strtok($_SERVER['REQUEST_URI'],'?') != "/status_services.php")
return "{$space}<a href=\"{$link}\" title=\"" . gettext("Status of items on this page") . "\">Status</a>";
else
return "{$space}<a href=\"{$link}\" class=\"btn btn-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"" . gettext("Status of items on this page") . "\"><span class=\"glyphicon glyphicon-eye-open\"></span></a>";
}
function get_shortcut_log_link($shortcut_section, $addspace = true) {
global $g, $shortcuts;
$space = ($addspace) ? "&nbsp;" : "" ;
if(!empty($shortcut_section) && !empty($shortcuts[$shortcut_section]['log'])) {
return "{$space}<a href=\"{$shortcuts[$shortcut_section]['log']}\" class=\"btn btn-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"" . gettext("Log entries for items on this page") . "\"><span class=\"glyphicon glyphicon-list\"></span></a>";
if (strtok($_SERVER['REQUEST_URI'],'?') != "/status_services.php")
return "{$space}<a href=\"{$shortcuts[$shortcut_section]['log']}\" title=\"" . gettext("Log entries for items on this page") . "\">Log</a>";
else
return "{$space}<a href=\"{$shortcuts[$shortcut_section]['log']}\" class=\"btn btn-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"" . gettext("Log entries for items on this page") . "\"><span class=\"glyphicon glyphicon-list\"></span></a>";
}
}
// Load shortcuts
$dir_array = get_shortcut_files("/usr/local/pkg/shortcuts");
foreach ($dir_array as $file) {
if (!is_dir("/usr/local/pkg/shortcuts/{$file}") && stristr($file,".inc")) {
include("/usr/local/pkg/shortcuts/{$file}");
}
}
$shortcuts['upnp'] = array();
$shortcuts['upnp']['main'] = "pkg_edit.php?xml=miniupnpd.xml";
$shortcuts['upnp']['log'] = "diag_logs_routing.php";
$shortcuts['upnp']['status'] = "status_upnp.php";
$shortcuts['upnp']['service'] = "miniupnpd";
$shortcuts['relayd'] = array();
$shortcuts['relayd']['main'] = "load_balancer_pool.php";