diff options
author | Colin Fleming <cj_fleming@sky.com> | 2014-04-18 22:48:48 +0100 |
---|---|---|
committer | Colin Fleming <cj_fleming@sky.com> | 2014-04-18 22:48:48 +0100 |
commit | 0e7aea24ca29d59ddbfde63569e95f95fa3c2c66 (patch) | |
tree | b0ba09d3536da60dfc8fe4ad4bff16b1befac412 /usr/local/www/load_balancer_pool_edit.php | |
parent | 928dc66a4341eeb7d84d79d7a331462107863170 (diff) | |
download | pfsense-0e7aea24ca29d59ddbfde63569e95f95fa3c2c66.zip pfsense-0e7aea24ca29d59ddbfde63569e95f95fa3c2c66.tar.gz |
Tidy up "load_balancer_pool" XHTML
Add SUMMARY to tables
Update PHP shorthand
Move "fbegin.inc" include between BODY and SCRIPT
Add CDATA section to scripts
Close INPUT tags
Update HTML Boolean operators
Move SELECT tag into the PHP IF statement
Diffstat (limited to 'usr/local/www/load_balancer_pool_edit.php')
-rw-r--r-- | usr/local/www/load_balancer_pool_edit.php | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/usr/local/www/load_balancer_pool_edit.php b/usr/local/www/load_balancer_pool_edit.php index c104829..46634cd 100644 --- a/usr/local/www/load_balancer_pool_edit.php +++ b/usr/local/www/load_balancer_pool_edit.php @@ -172,51 +172,54 @@ include("head.inc"); ?> <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> +<?php include("fbegin.inc"); ?> <script type="text/javascript"> +//<![CDATA[ function clearcombo(){ for (var i=document.iform.serversSelect.options.length-1; i>=0; i--){ document.iform.serversSelect.options[i] = null; } document.iform.serversSelect.selectedIndex = -1; } +//]]> </script> <script type="text/javascript" src="/javascript/autosuggest.js"></script> <script type="text/javascript" src="/javascript/suggestions.js"></script> -<?php include("fbegin.inc"); ?> + <?php if ($input_errors) print_input_errors($input_errors); ?> <form action="load_balancer_pool_edit.php" method="post" name="iform" id="iform"> - <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="load balancer pool entry"> <tr> <td colspan="2" valign="top" class="listtopic"><?=gettext("Add/edit Load Balancer - Pool entry"); ?></td> </tr> <tr align="left"> <td width="22%" valign="top" class="vncellreq"><?=gettext("Name"); ?></td> <td width="78%" class="vtable" colspan="2"> - <input name="name" type="text" <?if(isset($pconfig['name'])) echo "value=\"{$pconfig['name']}\"";?> size="16" maxlength="16"> + <input name="name" type="text" <?if(isset($pconfig['name'])) echo "value=\"{$pconfig['name']}\"";?> size="16" maxlength="16" /> </td> </tr> <tr align="left"> <td width="22%" valign="top" class="vncellreq"><?=gettext("Mode"); ?></td> <td width="78%" class="vtable" colspan="2"> - <select id="mode" name="mode" onChange="enforceFailover(); checkPoolControls();"> - <option value="loadbalance" <?if(!isset($pconfig['mode']) || ($pconfig['mode'] == "loadbalance")) echo "selected";?>><?=gettext("Load Balance");?></option> - <option value="failover" <?if($pconfig['mode'] == "failover") echo "selected";?>><?=gettext("Manual Failover");?></option> + <select id="mode" name="mode" onchange="enforceFailover(); checkPoolControls();"> + <option value="loadbalance" <?if(!isset($pconfig['mode']) || ($pconfig['mode'] == "loadbalance")) echo "selected=\"selected\"";?>><?=gettext("Load Balance");?></option> + <option value="failover" <?if($pconfig['mode'] == "failover") echo "selected=\"selected\"";?>><?=gettext("Manual Failover");?></option> </select> </td> </tr> <tr align="left"> <td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td> <td width="78%" class="vtable" colspan="2"> - <input name="descr" type="text" <?if(isset($pconfig['descr'])) echo "value=\"{$pconfig['descr']}\"";?>size="64"> + <input name="descr" type="text" <?if(isset($pconfig['descr'])) echo "value=\"{$pconfig['descr']}\"";?> size="64" /> </td> </tr> <tr align="left"> <td width="22%" valign="top" id="monitorport_text" class="vncellreq"><?=gettext("Port"); ?></td> <td width="78%" class="vtable" colspan="2"> - <input class="formfldalias" id="port" name="port" type="text" <?if(isset($pconfig['port'])) echo "value=\"{$pconfig['port']}\"";?> size="16" maxlength="16"><br /> + <input class="formfldalias" id="port" name="port" type="text" <?if(isset($pconfig['port'])) echo "value=\"{$pconfig['port']}\"";?> size="16" maxlength="16" /><br /> <div id="monitorport_desc"> <?=gettext("This is the port your servers are listening on."); ?><br /> <?=gettext("You may also specify a port alias listed in Firewall -> Aliases here."); ?> @@ -232,7 +235,7 @@ function clearcombo(){ <tr align="left"> <td width="22%" valign="top" id="retry_text" class="vncell"><?=gettext("Retry"); ?></td> <td width="78%" class="vtable" colspan="2"> - <input name="retry" type="text" <?if(isset($pconfig['retry'])) echo "value=\"{$pconfig['retry']}\"";?> size="16" maxlength="16"><br /> + <input name="retry" type="text" <?if(isset($pconfig['retry'])) echo "value=\"{$pconfig['retry']}\"";?> size="16" maxlength="16" /><br /> <div id="retry_desc"><?=gettext("Optionally specify how many times to retry checking a server before declaring it down."); ?></div> </td> </tr> @@ -250,7 +253,7 @@ function clearcombo(){ <?php foreach ($config['load_balancer']['monitor_type'] as $monitor) { if ($monitor['name'] == $pconfig['monitor']) { - $selected=" selected"; + $selected=" selected=\"selected\""; } else { $selected = ""; } @@ -266,8 +269,8 @@ function clearcombo(){ <tr align="left"> <td width="22%" valign="top" class="vncellreq"><?=gettext("Server IP Address"); ?></td> <td width="78%" class="vtable" colspan="2"> - <input name="ipaddr" type="text" size="16" style="float: left;"> - <input class="formbtn" type="button" name="button1" value="<?=gettext("Add to pool"); ?>" onclick="AddServerToPool(document.iform); enforceFailover(); checkPoolControls();"><br /> + <input name="ipaddr" type="text" size="16" style="float: left;" /> + <input class="formbtn" type="button" name="button1" value="<?=gettext("Add to pool"); ?>" onclick="AddServerToPool(document.iform); enforceFailover(); checkPoolControls();" /><br /> </td> </tr> <tr> @@ -279,24 +282,20 @@ function clearcombo(){ <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Members"); ?></td> <td width="78%" class="vtable" colspan="2" valign="top"> - <table> + <table summary="members"> <tbody> <tr> - <td> - <center> + <td align="center"> <b><?=gettext("Pool Disabled"); ?></b> - <p/> - <select id="serversDisabledSelect" name="serversdisabled[]" multiple="true" size="5"> - <?php if (is_array($pconfig['serversdisabled'])) { + echo "<select id=\"serversDisabledSelect\" name=\"serversdisabled[]\" multiple=\"multiple\" size=\"5\">"; foreach($pconfig['serversdisabled'] as $svrent) { if($svrent != '') echo " <option value=\"{$svrent}\">{$svrent}</option>\n"; } - } echo "</select>"; + } ?> - <p/> <input class="formbtn" type="button" name="removeDisabled" value="<?=gettext("Remove"); ?>" onclick="RemoveServerFromPool(document.iform, 'serversdisabled[]');" /> </td> @@ -305,21 +304,17 @@ function clearcombo(){ <input class="formbtn" type="button" id="moveToDisabled" name="moveToDisabled" value="<" onclick="moveOptions(document.iform.serversSelect, document.iform.serversDisabledSelect); checkPoolControls();" /> </td> - <td> - <center> + <td align="center"> <b><?=gettext("Enabled (default)"); ?></b> - <p/> - <select id="serversSelect" name="servers[]" multiple="true" size="5"> - <?php if (is_array($pconfig['servers'])) { +echo "<select id=\"serversSelect\" name=\"servers[]\" multiple=\"multiple\" size=\"5\">"; foreach($pconfig['servers'] as $svrent) { echo " <option value=\"{$svrent}\">{$svrent}</option>\n"; } -} echo "</select>"; +} ?> - <p/> <input class="formbtn" type="button" name="removeEnabled" value="<?=gettext("Remove"); ?>" onclick="RemoveServerFromPool(document.iform, 'servers[]');" /> </td> </tr> @@ -331,10 +326,10 @@ echo "</select>"; <td width="22%" valign="top"> </td> <td width="78%"> <br /> - <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onClick="AllServers('serversSelect', true); AllServers('serversDisabledSelect', true);"> - <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()"> + <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="AllServers('serversSelect', true); AllServers('serversDisabledSelect', true);" /> + <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()" /> <?php if (isset($id) && $a_pool[$id] && $_GET['act'] != 'dup'): ?> - <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>"> + <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" /> <?php endif; ?> </td> </tr> |