mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-22 15:40:22 +00:00
Properly selected ininite lease if ininite is selected.
Made time units translatable. Signed-off-by: D9ping <D9ping@users.noreply.github.com>
This commit is contained in:
parent
b9a1692d61
commit
f925a01807
1 changed files with 23 additions and 18 deletions
|
@ -112,12 +112,16 @@ function DisplayDHCPConfig() {
|
|||
$RangeStart = $arrRange[0];
|
||||
$RangeEnd = $arrRange[1];
|
||||
$RangeMask = $arrRange[2];
|
||||
preg_match( '/([0-9]*)([a-z])/i', $arrRange[3], $arrRangeLeaseTime );
|
||||
$leaseTime = $arrRange[3];
|
||||
|
||||
$hselected = '';
|
||||
$mselected = '';
|
||||
$dselected = '';
|
||||
|
||||
$infiniteselected = '';
|
||||
preg_match( '/([0-9]*)([a-z])/i', $leaseTime, $arrRangeLeaseTime );
|
||||
if ($leaseTime === 'infinite') {
|
||||
$infiniteselected = ' selected="selected"';
|
||||
} else {
|
||||
switch( $arrRangeLeaseTime[2] ) {
|
||||
case 'h':
|
||||
$hselected = ' selected="selected"';
|
||||
|
@ -129,8 +133,9 @@ function DisplayDHCPConfig() {
|
|||
$dselected = ' selected="selected"';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-primary">
|
||||
|
@ -161,7 +166,7 @@ function DisplayDHCPConfig() {
|
|||
foreach( $interfaces as $inet ) {
|
||||
$select = '';
|
||||
if( $inet === $conf['interface'] ) {
|
||||
$select = ' selected="selected"'; // FIXED use xhtml valid attribute
|
||||
$select = ' selected="selected"';
|
||||
}
|
||||
|
||||
echo ' <option value="'.htmlspecialchars($inet, ENT_QUOTES).'"'.
|
||||
|
@ -193,10 +198,10 @@ function DisplayDHCPConfig() {
|
|||
<div class="col-xs-2 col-sm-2">
|
||||
<label for="code"><?php echo _("Interval"); ?></label>
|
||||
<select name="RangeLeaseTimeUnits" class="form-control" >
|
||||
<option value="m" <?php echo $mselected; ?>>Minute(s)</option>
|
||||
<option value="h" <?php echo $hselected; ?>>Hour(s)</option>
|
||||
<option value="d" <?php echo $dselected; ?>>Day(s)</option>
|
||||
<option value="infinite">Infinite</option>
|
||||
<option value="m"<?php echo $mselected; ?>><?php echo _("Minute(s)"); ?></option>
|
||||
<option value="h"<?php echo $hselected; ?>><?php echo _("Hour(s)"); ?></option>
|
||||
<option value="d"<?php echo $dselected; ?>><?php echo _("Day(s)"); ?></option>
|
||||
<option value="infinite"<?php echo $infiniteselected; ?>><?php echo _("Infinite"); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue