Projet

Général

Profil

« Précédent | Suivant » 

Révision 2871ce84

Ajouté par Colin Fleming il y a presque 10 ans

Tidy up "status_dhcp_leases.php" XHTML

Add SUMMARY to TABLES
Updates spaces in $fspans and $fspane
Close INPUT and IMG tags and ALT to IMG
Deprecate Ampersand in Anchor tags

Voir les différences:

usr/local/www/status_dhcp_leases.php
294 294
/* only print pool status when we have one */
295 295
if(count($pools) > 0) {
296 296
?>
297
<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
297
<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0" summary="dhcp leases">
298 298
  <tr>
299 299
    <td class="listhdrr"><?=gettext("Failover Group"); ?></a></td>
300 300
    <td class="listhdrr"><?=gettext("My State"); ?></a></td>
......
305 305
<?php
306 306
foreach ($pools as $data) {
307 307
	echo "<tr>\n";
308
	echo "<td class=\"listlr\">{$fspans}{$data['name']}{$fspane}&nbsp;</td>\n";
309
	echo "<td class=\"listr\">{$fspans}{$data['mystate']}{$fspane}&nbsp;</td>\n";
310
	echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['mydate']) . "{$fspane}&nbsp;</td>\n";
311
	echo "<td class=\"listr\">{$fspans}{$data['peerstate']}{$fspane}&nbsp;</td>\n";
312
	echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['peerdate']) . "{$fspane}&nbsp;</td>\n";
308
	echo "<td class=\"listlr\">{$fspans}{$data['name']}{$fspane}</td>\n";
309
	echo "<td class=\"listr\">{$fspans}{$data['mystate']}{$fspane}</td>\n";
310
	echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['mydate']) . "{$fspane}</td>\n";
311
	echo "<td class=\"listr\">{$fspans}{$data['peerstate']}{$fspane}</td>\n";
312
	echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['peerdate']) . "{$fspane}</td>\n";
313 313
	echo "<td class=\"list\" valign=\"middle\" width=\"17\">&nbsp;</td>\n";
314 314
	echo "<td class=\"list\" valign=\"middle\" width=\"17\">&nbsp;</td>\n";
315 315
	echo "</tr>\n";
......
323 323
}
324 324
?>
325 325

  
326
<p>
326
<br/>
327 327

  
328
<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
328
<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0" summary="dhcp leases">
329 329
  <tr>
330 330
    <td class="listhdrr"><a href="#"><?=gettext("IP address"); ?></a></td>
331 331
    <td class="listhdrr"><a href="#"><?=gettext("MAC address"); ?></a></td>
......
342 342
	if (($data['act'] == "active") || ($data['act'] == "static") || ($_GET['all'] == 1)) {
343 343
		if ($data['act'] != "active" && $data['act'] != "static") {
344 344
			$fspans = "<span class=\"gray\">";
345
			$fspane = "</span>";
345
			$fspane = "&nbsp;</span>";
346 346
		} else {
347
			$fspans = $fspane = "";
347
			$fspans = "";
348
			$fspane = "&nbsp;";
348 349
		}
349 350
                $lip = ip2ulong($data['ip']);
350 351
		if ($data['act'] == "static") {
......
372 373
			}
373 374
                }		
374 375
		echo "<tr>\n";
375
                echo "<td class=\"listlr\">{$fspans}{$data['ip']}{$fspane}&nbsp;</td>\n";
376
                echo "<td class=\"listlr\">{$fspans}{$data['ip']}{$fspane}</td>\n";
376 377
		$mac=$data['mac']; 
377 378
		$mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
378 379
                if ($data['online'] != "online") {
379 380
			if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
380
	                        echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&mac=$mac\" title=\"" . gettext("$mac - send Wake on LAN packet to this MAC address") ."\">{$mac}</a><br /><font size=\"-2\"><i>{$mac_man[$mac_hi]}</i></font>{$fspane}&nbsp;</td>\n";
381
	                        echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&amp;mac=$mac\" title=\"" . gettext("$mac - send Wake on LAN packet to this MAC address") ."\">{$mac}</a><br /><font size=\"-2\"><i>{$mac_man[$mac_hi]}</i></font>{$fspane}</td>\n";
381 382
			}else{	
382
                        	echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&mac={$data['mac']}\" title=\"" . gettext("send Wake on LAN packet to this MAC address") ."\">{$data['mac']}</a>{$fspane}&nbsp;</td>\n";
383
                        	echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&amp;mac={$data['mac']}\" title=\"" . gettext("send Wake on LAN packet to this MAC address") ."\">{$data['mac']}</a>{$fspane}</td>\n";
383 384
			}
384 385
                }else{
385 386
			if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
386
				echo "<td class=\"listr\">{$fspans}{$mac}<br /><font size=\"-2\"><i>{$mac_man[$mac_hi]}</i></font>{$fspane}&nbsp;</td>\n";
387
				echo "<td class=\"listr\">{$fspans}{$mac}<br /><font size=\"-2\"><i>{$mac_man[$mac_hi]}</i></font>{$fspane}</td>\n";
387 388
	                }else{
388
                		echo "<td class=\"listr\">{$fspans}{$data['mac']}{$fspane}&nbsp;</td>\n";
389
                		echo "<td class=\"listr\">{$fspans}{$data['mac']}{$fspane}</td>\n";
389 390
			}
390 391
                }
391
                echo "<td class=\"listr\">{$fspans}"  . htmlentities($data['hostname']) . "{$fspane}&nbsp;</td>\n";
392
                echo "<td class=\"listr\">{$fspans}"  . htmlentities($data['hostname']) . "{$fspane}</td>\n";
392 393
				if ($data['type'] != "static") {
393
					echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['start']) . "{$fspane}&nbsp;</td>\n";
394
					echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['end']) . "{$fspane}&nbsp;</td>\n";
394
					echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['start']) . "{$fspane}</td>\n";
395
					echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['end']) . "{$fspane}</td>\n";
395 396
				} else {
396
					echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
397
					echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
397
					echo "<td class=\"listr\">{$fspans} n/a {$fspane}</td>\n";
398
					echo "<td class=\"listr\">{$fspans} n/a {$fspane}</td>\n";
398 399
				}
399
                echo "<td class=\"listr\">{$fspans}{$data['online']}{$fspane}&nbsp;</td>\n";
400
                echo "<td class=\"listr\">{$fspans}{$data['act']}{$fspane}&nbsp;</td>\n";
401
		
400
                echo "<td class=\"listr\">{$fspans}{$data['online']}{$fspane}</td>\n";
401
                echo "<td class=\"listr\">{$fspans}{$data['act']}{$fspane}</td>\n";
402
                echo "<td valign=\"middle\">&nbsp;";
402 403
		if ($data['type'] == "dynamic") {
403
			echo "<td valign=\"middle\"><a href=\"services_dhcp_edit.php?if={$data['if']}&mac={$data['mac']}&hostname={$data['hostname']}\">";
404
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("add a static mapping for this MAC address") ."\"></a></td>\n";
404
			echo "<a href=\"services_dhcp_edit.php?if={$data['if']}&amp;mac={$data['mac']}&amp;hostname={$data['hostname']}\">";
405
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("add a static mapping for this MAC address") ."\" alt=\"add\" /></a>&nbsp;\n";
405 406
		} else {
406
                	echo "<td class=\"list\" valign=\"middle\">";
407
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus_mo.gif\" width=\"17\" height=\"17\" border=\"0\"></td>\n";
407
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus_mo.gif\" width=\"17\" height=\"17\" border=\"0\" alt=\"add\" />&nbsp;\n";
408 408
		}
409 409

  
410
                echo "<td valign=\"middle\"><a href=\"services_wol_edit.php?if={$data['if']}&mac={$data['mac']}&descr={$data['hostname']}\">";
411
		echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_wol_all.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("add a Wake on LAN mapping for this MAC address") ."\"></a></td>\n";
410
                echo "<a href=\"services_wol_edit.php?if={$data['if']}&amp;mac={$data['mac']}&amp;descr={$data['hostname']}\">";
411
		echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_wol_all.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("add a Wake on LAN mapping for this MAC address") ."\" alt=\"add\" /></a>&nbsp;\n";
412 412

  
413 413
		/* Only show the button for offline dynamic leases */
414 414
		if (($data['type'] == "dynamic") && ($data['online'] != "online")) {
415
			echo "<td class=\"list\" valign=\"middle\"><a href=\"status_dhcp_leases.php?deleteip={$data['ip']}&all=" . htmlspecialchars($_GET['all']) . "\">";
416
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_x.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("delete this DHCP lease") . "\"></a></td>\n";
415
			echo "<a href=\"status_dhcp_leases.php?deleteip={$data['ip']}&amp;all=" . htmlspecialchars($_GET['all']) . "\">";
416
			echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_x.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("delete this DHCP lease") . "\" alt=\"delete\" /></a>&nbsp;\n";
417 417
		}
418
                echo "</tr>\n";
418
                echo "</td></tr>\n";
419 419
	}
420 420
}
421 421

  
422 422
?>
423 423
</table>
424
<p>
424
<br/>
425 425
<form action="status_dhcp_leases.php" method="get">
426
<input type="hidden" name="order" value="<?=htmlspecialchars($_GET['order']);?>">
426
<input type="hidden" name="order" value="<?=htmlspecialchars($_GET['order']);?>" />
427 427
<?php if ($_GET['all']): ?>
428
<input type="hidden" name="all" value="0">
429
<input type="submit" class="formbtn" value="<?=gettext("Show active and static leases only"); ?>">
428
<input type="hidden" name="all" value="0" />
429
<input type="submit" class="formbtn" value="<?=gettext("Show active and static leases only"); ?>" />
430 430
<?php else: ?>
431
<input type="hidden" name="all" value="1">
432
<input type="submit" class="formbtn" value="<?=gettext("Show all configured leases"); ?>">
431
<input type="hidden" name="all" value="1" />
432
<input type="submit" class="formbtn" value="<?=gettext("Show all configured leases"); ?>" />
433 433
<?php endif; ?>
434 434
</form>
435 435
<?php if($leases == 0): ?>

Formats disponibles : Unified diff