Tidy up "services_captiveportal_mac.php" XHTML

Swapp BODY and php statement
Close INPUT
Close IMG and add ALT
Deprecated ampersand
Add SUMMARY to tables
Move NOWRAP to class
This commit is contained in:
Colin Fleming 2014-04-03 15:26:22 +01:00
parent a4b1bf88bb
commit 0a1ad48cc4
2 changed files with 24 additions and 24 deletions

View File

@ -140,15 +140,15 @@ if ($_GET['act'] == "del") {
include("head.inc");
?>
<?php include("fbegin.inc"); ?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<form action="services_captiveportal_mac.php" method="post">
<input type="hidden" name="zone" id="zone" value="<?=htmlspecialchars($cpzone);?>"/>
<input type="hidden" name="zone" id="zone" value="<?=htmlspecialchars($cpzone);?>" />
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('passthrumac')): ?><p>
<?php print_info_box_np(gettext("The captive portal MAC address configuration has been changed.<br />You must apply the changes in order for them to take effect."));?><br />
<?php endif; ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="captiveportal mac">
<tr><td class="tabnavtbl">
<?php
$tab_array = array();
@ -163,7 +163,7 @@ include("head.inc");
</td></tr>
<tr>
<td class="tabcont">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="main">
<tr>
<td width="3%" class="list"></td>
<td width="37%" class="listhdrr"><?=gettext("MAC address"); ?></td>
@ -175,8 +175,8 @@ include("head.inc");
$i = 0;
foreach ($a_cp[$cpzone]['passthrumac'] as $mac):
?>
<tr ondblclick="document.location='services_captiveportal_mac_edit.php?zone=<?=$cpzone;?>&id=<?=$i;?>'">
<td valign="middle" nowrap class="list">
<tr ondblclick="document.location='services_captiveportal_mac_edit.php?zone=<?=$cpzone;?>&amp;id=<?=$i;?>'">
<td valign="middle" class="list nowrap">
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$mac['action'];?>.gif" width="11" height="11" border="0" alt="icon" />
</td>
<td class="listlr">
@ -185,13 +185,13 @@ include("head.inc");
<td class="listbg">
<?=htmlspecialchars($mac['descr']);?>&nbsp;
</td>
<td valign="middle" nowrap class="list">
<a href="services_captiveportal_mac_edit.php?zone=<?=$cpzone;?>&id=<?=$i;?>">
<img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit host"); ?>" width="17" height="17" border="0">
<td valign="middle" class="list nowrap">
<a href="services_captiveportal_mac_edit.php?zone=<?=$cpzone;?>&amp;id=<?=$i;?>">
<img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit host"); ?>" width="17" height="17" border="0" alt="edit" />
</a>
&nbsp;
<a href="services_captiveportal_mac.php?zone=<?=$cpzone;?>&act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this host?"); ?>')">
<img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete host"); ?>" width="17" height="17" border="0">
<a href="services_captiveportal_mac.php?zone=<?=$cpzone;?>&amp;act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this host?"); ?>')">
<img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete host"); ?>" width="17" height="17" border="0" alt="delte" />
</a>
</td>
</tr>
@ -204,7 +204,7 @@ include("head.inc");
<td class="list" colspan="3">&nbsp;</td>
<td class="list">
<a href="services_captiveportal_mac_edit.php?zone=<?=$cpzone;?>">
<img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add host"); ?>" width="17" height="17" border="0">
<img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add host"); ?>" width="17" height="17" border="0" alt="add" />
</a>
</td>
</tr>
@ -224,4 +224,4 @@ include("head.inc");
</form>
<?php include("fend.inc"); ?>
</body>
</html>
</html>

View File

@ -173,11 +173,11 @@ if ($_POST) {
}
include("head.inc");
?>
<?php include("fbegin.inc"); ?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="services_captiveportal_mac_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="captiveportal mac edit">
<tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit MAC address rules");?></td>
</tr>
@ -203,20 +203,20 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address"); ?></td>
<td width="78%" class="vtable">
<?=$mandfldhtml;?><input name="mac" type="text" class="formfld unknown" id="mac" size="17" value="<?=htmlspecialchars($pconfig['mac']);?>">
<?=$mandfldhtml;?><input name="mac" type="text" class="formfld unknown" id="mac" size="17" value="<?=htmlspecialchars($pconfig['mac']);?>" />
<?php
$ip = getenv('REMOTE_ADDR');
$mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`;
$mac = str_replace("\n","",$mac);
?>
<a OnClick="document.forms[0].mac.value='<?=$mac?>';" href="#"><?=gettext("Copy my MAC address");?></a>
<a onclick="document.forms[0].mac.value='<?=$mac?>';" href="#"><?=gettext("Copy my MAC address");?></a>
<br />
<span class="vexpl"><?=gettext("MAC address (6 hex octets separated by colons)"); ?></span></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable">
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
<br />
<span class="vexpl"><?=gettext("You may enter a description here for your reference (not parsed)"); ?>.</span>
</td>
@ -224,7 +224,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Bandwidth up"); ?></td>
<td width="78%" class="vtable">
<input name="bw_up" type="text" class="formfld unknown" id="bw_up" size="10" value="<?=htmlspecialchars($pconfig['bw_up']);?>">
<input name="bw_up" type="text" class="formfld unknown" id="bw_up" size="10" value="<?=htmlspecialchars($pconfig['bw_up']);?>" />
<br />
<span class="vexpl"><?=gettext("Enter a upload limit to be enforced on this MAC address in Kbit/s"); ?></span>
</td>
@ -232,7 +232,7 @@ include("head.inc");
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Bandwidth down"); ?></td>
<td width="78%" class="vtable">
<input name="bw_down" type="text" class="formfld unknown" id="bw_down" size="10" value="<?=htmlspecialchars($pconfig['bw_down']);?>">
<input name="bw_down" type="text" class="formfld unknown" id="bw_down" size="10" value="<?=htmlspecialchars($pconfig['bw_down']);?>" />
<br />
<span class="vexpl"><?=gettext("Enter a download limit to be enforced on this MAC address in Kbit/s"); ?></span>
</td>
@ -240,13 +240,13 @@ include("head.inc");
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>">
<input name="zone" type="hidden" value="<?=htmlspecialchars($cpzone);?>">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input name="zone" type="hidden" value="<?=htmlspecialchars($cpzone);?>" />
<?php if (isset($id) && $a_passthrumacs[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>">
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
<?php if (isset($pconfig['username']) && $pconfig['username']): ?>
<input name="username" type="hidden" value="<?=htmlspecialchars($pconfig['username']);?>">
<input name="username" type="hidden" value="<?=htmlspecialchars($pconfig['username']);?>" />
<?php endif; ?>
</td>
</tr>