diff options
author | Colin Fleming <cj_fleming@sky.com> | 2013-04-14 13:59:17 +0100 |
---|---|---|
committer | Colin Fleming <cj_fleming@sky.com> | 2013-04-14 13:59:17 +0100 |
commit | 44507df4d634ac078aad3cf6baefc4d9ff6c886f (patch) | |
tree | 32bfbfa5a561d78ea231c71da0f2f307343b1757 /usr/local/www | |
parent | d62be8b02bb85334a832e8576f6dcd0afb8b1d13 (diff) | |
download | pfsense-44507df4d634ac078aad3cf6baefc4d9ff6c886f.zip pfsense-44507df4d634ac078aad3cf6baefc4d9ff6c886f.tar.gz |
Tidy up "pkg.php" XHTML
Move SCRIPT tags out of the TABLE tag
Add CDATA section to SCRIPT tags
Close INPUT and IMG tags and add ALT statement to IMG tags
Update HTML boolean operators
Move NOWRAP to class statement
Deprecate ampersand in ANCHOR tags
Add missing closing FONT tags
Swap closing TR and TD tags
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/pkg.php | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/usr/local/www/pkg.php b/usr/local/www/pkg.php index 8b31512..fefb380 100755 --- a/usr/local/www/pkg.php +++ b/usr/local/www/pkg.php @@ -152,15 +152,67 @@ include("head.inc"); ?> <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> -<?php -include("fbegin.inc"); -?> +<?php include("fbegin.inc"); ?> +<script type="text/javascript" src="javascript/domTT/domLib.js"></script> +<script type="text/javascript" src="javascript/domTT/domTT.js"></script> +<script type="text/javascript" src="javascript/domTT/behaviour.js"></script> +<script type="text/javascript" src="javascript/domTT/fadomatic.js"></script> +<script type="text/javascript"> +//<![CDATA[ + function setFilter(filtertext) { + jQuery('#pkg_filter').val(filtertext); + document.pkgform.submit(); + } + + <?php + if($pkg['adddeleteeditpagefields']['movable']){ + ?> + jQuery(document).ready(function(){ + jQuery('#mainarea table tbody').sortable({ + items: 'tr.sortable', + cursor: 'move', + distance: 10, + opacity: 0.8, + helper: function(e,ui){ + ui.children().each(function(){ + jQuery(this).width(jQuery(this).width()); + }); + return ui; + }, + }); + }); + function save_changes_to_xml(xml) { + var ids=jQuery('#mainarea table tbody').sortable('serialize',{key:"ids[]"}); + var strloading="<img src='/themes/<?= $g['theme']; ?>/images/misc/loader.gif' alt='loader' /> " + "<?=gettext('Saving changes...');?>"; + if(confirm("<?=gettext("Do you really want to save changes?");?>")){ + jQuery.ajax({ + type: 'get', + cache: false, + url: "<?=$_SERVER['SCRIPT_NAME'];?>", + data: {xml:'<?=$xml?>', act:'update', ids: ids}, + beforeSend: function(){ + jQuery('#savemsg').empty().html(strloading); + }, + error: function(data){ + jQuery('#savemsg').empty().html('Error:' + data); + }, + success: function(data){ + jQuery('#savemsg').empty().html(data); + } + }); + } + } + <?php + } + ?> +//]]> +</script> <form action="pkg.php" name="pkgform" method="get"> -<input type='hidden' name='xml' value='<?=$_REQUEST['xml']?>'> +<input type='hidden' name='xml' value='<?=$_REQUEST['xml']?>' /> <?php if($_GET['savemsg'] <> "") $savemsg = htmlspecialchars($_GET['savemsg']); ?> <div id="savemsg"></div> <?php if ($savemsg) print_info_box($savemsg); ?> -<table width="100%" border="0" cellpadding="0" cellspacing="0"> +<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="package settings"> <?php if ($pkg['tabs'] <> "") { $tab_array = array(); @@ -206,62 +258,10 @@ if ($pkg['tabs'] <> "") { } } ?> -<script type="text/javascript" src="javascript/domTT/domLib.js"></script> -<script type="text/javascript" src="javascript/domTT/domTT.js"></script> -<script type="textjavascript" src="javascript/domTT/behaviour.js"></script> -<script type="textjavascript" src="javascript/domTT/fadomatic.js"></script> -<script> - function setFilter(filtertext) { - jQuery('#pkg_filter').val(filtertext); - document.pkgform.submit(); - } - - <?php - if($pkg['adddeleteeditpagefields']['movable']){ - ?> - jQuery(document).ready(function(){ - jQuery('#mainarea table tbody').sortable({ - items: 'tr.sortable', - cursor: 'move', - distance: 10, - opacity: 0.8, - helper: function(e,ui){ - ui.children().each(function(){ - jQuery(this).width(jQuery(this).width()); - }); - return ui; - }, - }); - }); - function save_changes_to_xml(xml) { - var ids=jQuery('#mainarea table tbody').sortable('serialize',{key:"ids[]"}); - var strloading="<img src='/themes/<?= $g['theme']; ?>/images/misc/loader.gif'> " + "<?=gettext('Saving changes...');?>"; - if(confirm("<?=gettext("Do you really want to save changes?");?>")){ - jQuery.ajax({ - type: 'get', - cache: false, - url: "<?=$_SERVER['SCRIPT_NAME'];?>", - data: {xml:'<?=$xml?>', act:'update', ids: ids}, - beforeSend: function(){ - jQuery('#savemsg').empty().html(strloading); - }, - error: function(data){ - jQuery('#savemsg').empty().html('Error:' + data); - }, - success: function(data){ - jQuery('#savemsg').empty().html(data); - } - }); - } - } - <?php - } - ?> -</script> -<tr><td><div id="mainarea"><table width="100%" border="0" cellpadding="0" cellspacing="0"> +<tr><td><div id="mainarea"><table width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area"> <tr> <td class="tabcont"> - <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="tabs"> <?php /* Handle filtering bar A-Z */ $include_filtering_inputbox = false; @@ -278,22 +278,22 @@ if ($pkg['tabs'] <> "") { if($display_maximum_rows < 1) if($field['display_maximum_rows']) $display_maximum_rows = $field['display_maximum_rows']; - echo "<tr><td class='listhdrr' colspan='$colspan'><center>"; + echo "<tr><td class='listhdrr' colspan='$colspan' align='center'>"; echo "Filter by: "; $isfirst = true; for($char = 65; $char < 91; $char++) { if(!$isfirst) echo " | "; - echo "<a href=\"#\" onClick=\"setFilter('" . chr($char) . "');\">" . chr($char) . "</a>"; + echo "<a href=\"#\" onclick=\"setFilter('" . chr($char) . "');\">" . chr($char) . "</a>"; $isfirst = false; } echo "</td></tr>"; - echo "<tr><td class='listhdrr' colspan='$colspan'><center>"; + echo "<tr><td class='listhdrr' colspan='$colspan' align='center'>"; if($field['sortablefields']) { echo "Filter field: <select name='pkg_filter_type'>"; foreach($field['sortablefields']['item'] as $si) { if($si['name'] == $_REQUEST['pkg_filter_type']) - $SELECTED = "SELECTED"; + $SELECTED = "selected=\"selected\""; else $SELECTED = ""; echo "<option value='{$si['name']}' {$SELECTED}>{$si['name']}</option>"; @@ -301,8 +301,8 @@ if ($pkg['tabs'] <> "") { echo "</select>"; } if($include_filtering_inputbox) - echo " Filter text: <input id='pkg_filter' name='pkg_filter' value='" . $_REQUEST['pkg_filter'] . "'> <input type='submit' value='Filter'>"; - echo "</td></tr><tr><td><font siez='-3'> </td></tr>"; + echo " Filter text: <input id='pkg_filter' name='pkg_filter' value='" . $_REQUEST['pkg_filter'] . "' /> <input type='submit' value='Filter' />"; + echo "</td></tr><tr><td><font size='-3'> </font></td></tr>"; } } } @@ -327,13 +327,13 @@ if ($pkg['tabs'] <> "") { } } echo "<tr><td colspan='" . count($pkg['adddeleteeditpagefields']['columnitem']) . "'>"; - echo "<table width='100%'>"; + echo "<table width='100%' summary=''>"; echo "<tr>"; echo "<td align='left'>Displaying page $page of $totalpages</b></td>"; - echo "<td align='right'>Rows per page: <select onChange='document.pkgform.submit();' name='display_maximum_rows'>"; + echo "<td align='right'>Rows per page: <select onchange='document.pkgform.submit();' name='display_maximum_rows'>"; for($x=0; $x<250; $x++) { if($x == $display_maximum_rows) - $SELECTED = "SELECTED"; + $SELECTED = "selected=\"selected\""; else $SELECTED = ""; echo "<option value='$x' $SELECTED>$x</option>\n"; @@ -413,7 +413,7 @@ if ($pkg['tabs'] <> "") { else $class = "listlr"; ?> - <td class="<?=$class;?>" ondblclick="document.location='pkg_edit.php?xml=<?=$xml?>&act=edit&id=<?=$i;?>';"> + <td class="<?=$class;?>" ondblclick="document.location='pkg_edit.php?xml=<?=$xml?>&act=edit&id=<?=$i;?>';"> <?php $fieldname = $ip[xml_safe_fieldname($column['fieldname'])]; #Check if columnitem has a type field declared @@ -443,17 +443,17 @@ if ($pkg['tabs'] <> "") { <?php } ?> - <td valign="middle" class="list" nowrap> - <table border="0" cellspacing="0" cellpadding="1"> + <td valign="middle" class="list nowrap"> + <table border="0" cellspacing="0" cellpadding="1" summary="icons"> <tr> <?php #Show custom description to edit button if defined $edit_msg=($pkg['adddeleteeditpagefields']['edittext']?$pkg['adddeleteeditpagefields']['edittext']:"Edit this item");?> - <td valign="middle"><a href="pkg_edit.php?xml=<?=$xml?>&act=edit&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" <?=domTT_title($edit_msg)?>></a></td> + <td valign="middle"><a href="pkg_edit.php?xml=<?=$xml?>&act=edit&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" <?=domTT_title($edit_msg)?> alt="edit" /></a></td> <?php #Show custom description to delete button if defined $delete_msg=($pkg['adddeleteeditpagefields']['deletetext']?$pkg['adddeleteeditpagefields']['deletetext']:"Delete this item");?> - <td valign="middle"><a href="pkg.php?xml=<?=$xml?>&act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this item?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" <?=domTT_title($delete_msg)?>></a></td> + <td valign="middle"><a href="pkg.php?xml=<?=$xml?>&act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this item?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" <?=domTT_title($delete_msg)?> alt="delete" /></a></td> </tr> </table> </td> @@ -466,16 +466,16 @@ if ($pkg['tabs'] <> "") { $colcount = count($pkg['adddeleteeditpagefields']['columnitem']); $final_footer = ""; $final_footer .= "<tr><td colspan='$colcount'>"; - $final_footer .= "<table width='100%'><tr>"; + $final_footer .= "<table width='100%' summary=''><tr>"; $final_footer .= "<td align='left'>"; $startingat = $startdisplayingat - $display_maximum_rows; if($startingat > -1) { - $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&startdisplayingat={$startingat}&display_maximum_rows={$display_maximum_rows}'>"; + $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&startdisplayingat={$startingat}&display_maximum_rows={$display_maximum_rows}'>"; } else { if($startingnat > 1) - $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&startdisplayingat=0&display_maximum_rows={$display_maximum_rows}'>"; + $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&startdisplayingat=0&display_maximum_rows={$display_maximum_rows}'>"; } - $final_footer .= "<font size='2'><< Previous page</a>"; + $final_footer .= "<font size='2'><< Previous page</font></a>"; if($tmppp + $display_maximum_rows > count($evaledvar)) $endingrecord = count($evaledvar); else @@ -483,10 +483,10 @@ if ($pkg['tabs'] <> "") { $final_footer .= "</td><td align='center'>"; $tmppp++; $final_footer .= "<font size='2'>Displaying {$tmppp} - {$endingrecord} / " . count($evaledvar) . " records"; - $final_footer .= "</td><td align='right'> "; + $final_footer .= "</font></td><td align='right'> "; if(($i+1) < count($evaledvar)) - $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&startdisplayingat=" . ($startdisplayingat + $display_maximum_rows) . "&display_maximum_rows={$display_maximum_rows}'>"; - $final_footer .= "<font size='2'>Next page >></a>"; + $final_footer .= "<a href='pkg.php?xml=" . $_REQUEST['xml'] . "&startdisplayingat=" . ($startdisplayingat + $display_maximum_rows) . "&display_maximum_rows={$display_maximum_rows}'>"; + $final_footer .= "<font size='2'>Next page >></font></a>"; $final_footer .= "</td></tr></table></td></tr>"; $i = count($evaledvar); break; @@ -499,16 +499,16 @@ if ($pkg['tabs'] <> "") { <tr> <td colspan="<?=$cols?>"></td> <td> - <table border="0" cellspacing="0" cellpadding="1"> + <table border="0" cellspacing="0" cellpadding="1" summary="icons"> <tr> <?php #Show custom description to add button if defined $add_msg=($pkg['adddeleteeditpagefields']['addtext']?$pkg['adddeleteeditpagefields']['addtext']:"Add a new item");?> - <td valign="middle"><a href="pkg_edit.php?xml=<?=$xml?>&id=<?=$i?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" <?=domTT_title($add_msg)?>></a></td> + <td valign="middle"><a href="pkg_edit.php?xml=<?=$xml?>&id=<?=$i?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" <?=domTT_title($add_msg)?> alt="add" /></a></td> <?php #Show description button and info if defined if($pkg['adddeleteeditpagefields']['description']){?> - <td valign="middle"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_info_pkg.gif" width="17" height="17" border="0" <?=domTT_title($pkg['adddeleteeditpagefields']['description'])?>></td> + <td valign="middle"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_info_pkg.gif" width="17" height="17" border="0" <?=domTT_title($pkg['adddeleteeditpagefields']['description'])?> alt="info" /></td> <?php }?> </tr> </table> @@ -518,13 +518,13 @@ if ($pkg['tabs'] <> "") { <?php #Show save button only when movable is defined if($pkg['adddeleteeditpagefields']['movable']){?> - <td><input class="formbtn" type="button" value="Save" name="Submit" onclick="save_changes_to_xml('<?=$xml?>')"></td> + <td><input class="formbtn" type="button" value="Save" name="Submit" onclick="save_changes_to_xml('<?=$xml?>')" /></td> <?php }?> </table> </td> </tr> </table> -</div></tr></td></table> +</div></td></tr></table> </form> <?php include("fend.inc"); ?> |