Revision 68eacaa2
Added by Peter Schofield over 7 years ago
src/usr/local/www/interfaces_assign.php | ||
---|---|---|
553 | 553 |
$portselect=''; |
554 | 554 |
foreach ($portlist as $portname => $portinfo) { |
555 | 555 |
$portselect.='<option value="'.$portname.'"'; |
556 |
if($portname == $iface['if']) { |
|
556 |
/*if($portname == $iface['if']) {
|
|
557 | 557 |
$portselect.=' selected'; |
558 |
} |
|
558 |
}*/
|
|
559 | 559 |
$portselect.=">".$ifdescrs[$portname]."</option>\n"; |
560 | 560 |
} |
561 | 561 |
/*$timeb2 = microtime(); |
... | ... | |
576 | 576 |
<tbody> |
577 | 577 |
<?php |
578 | 578 |
//$timea2 = microtime(true); |
579 |
$i=0; |
|
579 | 580 |
foreach ($config['interfaces'] as $ifname => $iface): |
580 | 581 |
if ($iface['descr']) { |
581 | 582 |
$ifdescr = $iface['descr']; |
... | ... | |
591 | 592 |
/* replacing the port select menu generation loop that has count(interfaces) iterations |
592 | 593 |
and is run count(interfaces) times with a pre-prepared select menu generated outside of |
593 | 594 |
this loop has produced a significant improvement in page generation and load time */ |
594 |
//foreach ($portlist as $portname => $portinfo):?>
|
|
595 |
<?=$portselect?>
|
|
596 |
<?php //endforeach;
|
|
595 |
//foreach ($portlist as $portname => $portinfo): |
|
596 |
echo str_replace('value="'.$iface['if'].'">','value="'.$iface['if'].'" selected>',$portselect);
|
|
597 |
//endforeach; |
|
597 | 598 |
/*$timeb3 = microtime(true); |
598 | 599 |
$profile['html_if_assign_desc'] = $timeb3-$timea3;*/ |
599 | 600 |
?> |
... | ... | |
608 | 609 |
<?php endif;?> |
609 | 610 |
</td> |
610 | 611 |
</tr> |
611 |
<?php endforeach; |
|
612 |
<?php $i++; |
|
613 |
endforeach; |
|
612 | 614 |
/*$timeb2 = microtime(true); |
613 | 615 |
$profile['html_display_ifs'] = $timeb2-$timea2;*/ |
614 | 616 |
if (count($config['interfaces']) < count($portlist)): |
Also available in: Unified diff
fix for broken preselection of select boxes