diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-01-12 04:47:39 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-01-12 04:47:39 +0000 |
commit | d51f86e05d95089c7a7e0ebac305e6b750314cfa (patch) | |
tree | 6f60447892470cc3ecee99ac95f3a9bdd0c60877 /usr/local/www/wizard.php | |
parent | a6e4adb3f9b2be6b3416a4e3ea1855af2655e2b2 (diff) | |
download | pfsense-d51f86e05d95089c7a7e0ebac305e6b750314cfa.zip pfsense-d51f86e05d95089c7a7e0ebac305e6b750314cfa.tar.gz |
Expand the usage of $myurl in wizard fields and pkg_edit
Diffstat (limited to 'usr/local/www/wizard.php')
-rwxr-xr-x | usr/local/www/wizard.php | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index 86306b5..79febf8 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -132,15 +132,16 @@ if($pkg['step'][$stepid]['stepbeforeformdisplay'] <> "") { <br> -<img src="/logo.gif"><p> +<a href="http://<?= getenv("HTTP_HOST") ?>"><img border="0" src="/logo.gif"></a> +<p> <table width="600" cellspacing="0" cellpadding="3"> <!-- wizard goes here --> <tr><td> </td></tr> - <tr><td colspan='2'><center><b><?= $description ?></b></center></td></tr><tr><td> </td></tr> + <tr><td colspan='2'><center><b><?= fixup_string($description) ?></b></center></td></tr><tr><td> </td></tr> <?php if(!$pkg['step'][$stepid]['disableheader']) - echo "<tr><td colspan=\"2\" class=\"listtopic\">" . $title . "</td></tr>"; + echo "<tr><td colspan=\"2\" class=\"listtopic\">" . fixup_string($title) . "</td></tr>"; ?> <?php @@ -175,7 +176,7 @@ if($pkg['step'][$stepid]['stepbeforeformdisplay'] <> "") { if ($field['type'] == "input") { if(!$field['dontdisplayname']) { echo "<td width=\"22%\" align=\"right\" class=\"vncellreq\">\n"; - echo $field['name']; + echo fixup_string($field['name']); echo ":</td>\n"; } if(!$field['dontcombinecells']) @@ -184,7 +185,7 @@ if($pkg['step'][$stepid]['stepbeforeformdisplay'] <> "") { } else if ($field['type'] == "password") { if(!$field['dontdisplayname']) { echo "<td width=\"22%\" align=\"right\" class=\"vncellreq\">\n"; - echo $field['name']; + echo fixup_string($field['name']); echo ":</td>\n"; } if(!$field['dontcombinecells']) @@ -193,7 +194,7 @@ if($pkg['step'][$stepid]['stepbeforeformdisplay'] <> "") { } else if ($field['type'] == "select") { if(!$field['dontdisplayname']) { echo "<td width=\"22%\" align=\"right\" class=\"vncellreq\">\n"; - echo $field['name']; + echo fixup_string($field['name']); echo ":</td>\n"; } // XXX: TODO: set $selected @@ -217,7 +218,7 @@ if($pkg['step'][$stepid]['stepbeforeformdisplay'] <> "") { } else if ($field['type'] == "textarea") { if(!$field['dontdisplayname']) { echo "<td width=\"22%\" align=\"right\" class=\"vncellreq\">\n"; - echo $field['name']; + echo fixup_string($field['name']); echo ":</td>"; } if(!$field['dontcombinecells']) @@ -325,4 +326,23 @@ if($pkg['step'][$stepid]['javascriptafterformdisplay'] <> "") { echo "</script>\n\n"; } +/* + * HELPER FUNCTIONS + */ + +function fixup_string($string) { + // fixup #1: $myurl -> http[s]://ip_address:port/ + $https = ""; + $port = ""; + $urlport = ""; + $port = $config['system']['webguiport']; + if($port <> "443" and $port <> "80") $urlport = ":" . $port; + if($config['system']['webguiproto'] == "https") $https = "s"; + $myurl = "http" . $https . "://" . getenv("HTTP_HOST") . $urlportport; + $newstring = str_replace("\$myurl", $myurl, $string); + // fixup #2: fix'er'up here. + return $newstring; +} + ?> + |