From e93441e07a75d63204881c33f3781e05015b9e5d Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 15 Nov 2007 23:17:36 +0000 Subject: Add genhtmltitle() from m0n0wall. --- usr/local/www/fbegin.inc | 71 +++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 31 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc index a0f2a18..8f96a08 100755 --- a/usr/local/www/fbegin.inc +++ b/usr/local/www/fbegin.inc @@ -2,43 +2,52 @@ require_once("notices.inc"); /* $Id$ */ - function return_ext_menu($section) { - global $config; - $htmltext = ""; - if($config['installedpackages']['menu'] <> "") { - foreach($config['installedpackages']['menu'] as $menuitem) { - if($menuitem['section'] != $section) continue; - if($menuitem['url'] <> "") { - $addresswithport = getenv("HTTP_HOST"); - $colonpos = strpos($addresswithport, ":"); - if ($colonpos !== False){ - //my url is actually just the IP address of the pfsense box - $myurl = substr($addresswithport, 0, $colonpos); - } - else - { - $myurl = $addresswithport; - } - $description = str_replace('$myurl', $myurl, $menuitem['url']); - } else { - $description = '/pkg.php?xml=' . $menuitem['configfile']; +function gentitle($title) { + global $navlevelsep; + return join($navlevelsep, $title); +} + +function genhtmltitle($title) { + global $config; + return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . gentitle($title); +} + +function return_ext_menu($section) { + global $config; + $htmltext = ""; + if($config['installedpackages']['menu'] <> "") { + foreach($config['installedpackages']['menu'] as $menuitem) { + if($menuitem['section'] != $section) continue; + if($menuitem['url'] <> "") { + $addresswithport = getenv("HTTP_HOST"); + $colonpos = strpos($addresswithport, ":"); + if ($colonpos !== False){ + //my url is actually just the IP address of the pfsense box + $myurl = substr($addresswithport, 0, $colonpos); + } + else + { + $myurl = $addresswithport; } - $htmltext .= '
  • ' . $menuitem['name'] . '
  • ' . "\n"; + + $description = str_replace('$myurl', $myurl, $menuitem['url']); + } else { + $description = '/pkg.php?xml=' . $menuitem['configfile']; } + $htmltext .= '
  • ' . $menuitem['name'] . '
  • ' . "\n"; } - return $htmltext; } + return $htmltext; +} +/* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */ +if ($_REQUEST['noticeaction'] == 'acknowledge') { + $notice_id = $_REQUEST['noticeid']; + close_notice($notice_id); +} +/**********************************************/ - - - /* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */ - if ($_REQUEST['noticeaction'] == 'acknowledge') { - $notice_id = $_REQUEST['noticeid']; - close_notice($notice_id); - } - /**********************************************/ ?>
    @@ -284,4 +293,4 @@ require_once("notices.inc"); echo "
    "; } -?> +?> \ No newline at end of file -- cgit v1.1