From e17ce934fd58b9cdfa63209d81fd66673bd9fb87 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 18 Feb 2005 22:16:48 +0000 Subject: Allow $myurl in the url of the tabs .. $myurl is translated to getenv("HTTP_HOST") on the fly --- usr/local/www/pkg.php | 13 ++++++++++--- usr/local/www/pkg_edit.php | 14 +++++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/usr/local/www/pkg.php b/usr/local/www/pkg.php index 806b473..d46e995 100755 --- a/usr/local/www/pkg.php +++ b/usr/local/www/pkg.php @@ -116,10 +116,17 @@ if ($pkg['tabs'] <> "") { foreach($pkg['tabs']['tab'] as $tab) { $active = "tabinact"; if(isset($tab['active'])) $active = "tabact"; - $url = ""; + $urltmp = ""; $title = $tab['text']; - if($tab['url'] <> "") $url = $tab['url']; - if($tab['xml'] <> "") $url = "pkg_edit.php?xml=" . $tab['xml']; + if($tab['url'] <> "") $urltmp = $tab['url']; + if($tab['xml'] <> "") $urltmp = "pkg_edit.php?xml=" . $tab['xml']; + + $toeval = "\$myurl = \"" . getenv("HTTP_HOST") . "\"; \n"; + eval($toeval); + // eval url so that above $myurl item can be processed if need be. + $toeval = "\$url = \"" . $urltmp . "\"; \n"; + eval($toeval); + if($active == "tabinact") { echo "
  • "; echo " "") { foreach($pkg['tabs']['tab'] as $tab) { $active = "tabinact"; if(isset($tab['active'])) $active = "tabact"; - $url = ""; + + $urltmp = ""; $title = $tab['text']; - if($tab['url'] <> "") $url = $tab['url']; - if($tab['xml'] <> "") $url = "pkg_edit.php?xml=" . $tab['xml']; + if($tab['url'] <> "") $urltmp = $tab['url']; + if($tab['xml'] <> "") $urltmp = "pkg_edit.php?xml=" . $tab['xml']; + + $toeval = "\$myurl = \"" . getenv("HTTP_HOST") . "\"; \n"; + eval($toeval); + // eval url so that above $myurl item can be processed if need be. + $toeval = "\$url = \"" . $urltmp . "\"; \n"; + eval($toeval); + if($active == "tabinact") { echo "
  • "; echo "