From 976d0213c11c54ddd88b8923047c59b86445ffd8 Mon Sep 17 00:00:00 2001 From: Darren Embry Date: Thu, 17 May 2012 16:49:24 -0400 Subject: fix cosmetic bug when developer was turned on. highlight the hidden menu item differently. --- usr/local/www/fbegin.inc | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'usr/local/www/fbegin.inc') diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc index 31bc627..e700a86 100755 --- a/usr/local/www/fbegin.inc +++ b/usr/local/www/fbegin.inc @@ -74,11 +74,23 @@ function return_ext_menu($section) { return $extarray; } -function output_menu($arrayitem, $target="") { - foreach($arrayitem as $item) { - if($target) - $targetinfo = "target='{$target}'"; - echo '
  • ' . $item[0] . '
  • ' . "\n"; +function output_menu($arrayitem, $target = null) { + foreach ($arrayitem as $item) { + $attr = sprintf("href=\"%s\"", htmlentities($item[1])); + if ($target) { + $attr .= sprintf(" target=\"%s\"", htmlentities($target)); + } + $class = "navlnk"; + if ($item['class']) { + $class .= " {$item['class']}"; + } + $attr .= sprintf(" class=\"%s\"", htmlentities($class)); + if ($item['style']) { + $attr .= sprintf(" style=\"%s\"", htmlentities($item['style'])); + } + echo "
  • \n"; + printf("%s\n", $attr, $item[0]); + echo "
  • \n"; } } @@ -217,8 +229,8 @@ if($g['platform'] == "nanobsd") $diagnostics_menu[] = array(gettext("NanoBSD"), "/diag_nanobsd.php"); if (isset($config['system']['developer'])) { - echo "

  • "; - $diagnostics_menu[] = array(gettext("Restart HTTPD"), "/restart_httpd.php"); + $diagnostics_menu[] = array(gettext("Restart HTTPD"), "/restart_httpd.php", "style" => "font-weight: bold; color: yellow;"); + } $diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")),0); -- cgit v1.1