implements gettext in interfaces_bridge_edit.php

This commit is contained in:
Neriberto C.Prado 2010-07-01 15:00:47 -03:00
parent 2ded2c1b3c
commit eb4cf3cb25

View File

@ -104,45 +104,45 @@ if ($_POST) {
/* input validation */
$reqdfields = explode(" ", "members");
$reqdfieldsn = explode(",", "Member Interfaces");
$reqdfieldsn = array(gettext("Member Interfaces"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
if ($_POST['maxage'] && !is_numeric($_POST['maxage']))
$input_errors[] = "Maxage needs to be an integer between 6 and 40.";
$input_errors[] = gettext("Maxage needs to be an integer between 6 and 40.");
if ($_POST['maxaddr'] && !is_numeric($_POST['maxaddr']))
$input_errors[] = "Maxaddr needs to be an integer.";
$input_errors[] = gettext("Maxaddr needs to be an integer.");
if ($_POST['timeout'] && !is_numeric($_POST['timeout']))
$input_errors[] = "Timeout needs to be an integer.";
$input_errors[] = gettext("Timeout needs to be an integer.");
if ($_POST['fwdelay'] && !is_numeric($_POST['fwdelay']))
$input_errors[] = "Forward Delay needs to be an integer between 4 and 30.";
$input_errors[] = gettext("Forward Delay needs to be an integer between 4 and 30.");
if ($_POST['hellotime'] && !is_numeric($_POST['hellotime']))
$input_errors[] = "Hello time for STP needs to be an integer between 1 and 2.";
$input_errors[] = gettext("Hello time for STP needs to be an integer between 1 and 2.");
if ($_POST['priority'] && !is_numeric($_POST['priority']))
$input_errors[] = "Priority for STP needs to be an integer between 0 and 61440.";
$input_errors[] = gettext("Priority for STP needs to be an integer between 0 and 61440.");
if ($_POST['holdcnt'] && !is_numeric($_POST['holdcnt']))
$input_errors[] = "Transmit Hold Count for STP needs to be an integer between 1 and 10.";
$input_errors[] = gettext("Transmit Hold Count for STP needs to be an integer between 1 and 10.");
foreach ($ifacelist as $ifn => $ifdescr) {
if ($_POST[$ifn] <> "" && !is_numeric($_POST[$ifn]))
$input_errors[] = "{$ifdescr} interface priority for STP needs to be an integer between 0 and 240.";
$input_errors[] = "{$ifdescr} " . gettext("interface priority for STP needs to be an integer between 0 and 240.");
}
$i = 0;
foreach ($ifacelist as $ifn => $ifdescr) {
if ($_POST["{$ifn}{$i}"] <> "" && !is_numeric($_POST["{$ifn}{$i}"]))
$input_errors[] = "{$ifdescr} interface path cost for STP needs to be an integer between 1 and 200000000.";
$input_errors[] = "{$ifdescr} " . gettext("interface path cost for STP needs to be an integer between 1 and 200000000.");
$i++;
}
if (!is_array($_POST['members']) || count($_POST['members']) < 2)
$input_errors[] = "You must select at least 2 member interfaces for a bridge.";
$input_errors[] = gettext("You must select at least 2 member interfaces for a bridge.");
if (is_array($_POST['members'])) {
foreach($_POST['members'] as $ifmembers) {
if (is_array($config['interfaces'][$ifmembers]['wireless']) &&
$config['interfaces'][$ifmembers]['wireless']['mode'] != "hostap")
$input_errors[] = "Bridging a wireless interface is only possible in hostap mode.";
$input_errors[] = gettext("Bridging a wireless interface is only possible in hostap mode.");
if ($_POST['span'] != "none" && $_POST['span'] == $ifmembers)
$input_errors[] = "Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue.";
$input_errors[] = gettext("Span interface cannot be part of the bridge. Remove the span interface from bridge members to continue.");
}
}
@ -199,7 +199,7 @@ if ($_POST) {
$bridge['bridgeif'] = $_POST['bridgeif'];
$bridge['bridgeif'] = interface_bridge_configure($bridge);
if ($bridge['bridgeif'] == "" || !stristr($bridge['bridgeif'], "bridge"))
$input_errors[] = "Error occured creating interface, please retry.";
$input_errors[] = gettext("Error occured creating interface, please retry.");
else {
if (isset($id) && $a_bridges[$id])
$a_bridges[$id] = $bridge;
@ -219,7 +219,7 @@ if ($_POST) {
}
}
$pgtitle = array("Firewall","Bridge","Edit");
$pgtitle = array(gettext("Firewall"),gettext("Bridge"),gettext("Edit"));
include("head.inc");
?>
@ -246,10 +246,10 @@ function show_source_port_range() {
<form action="interfaces_bridge_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td colspan="2" valign="top" class="listtopic">Bridge configuration</td>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Bridge configuration"); ?></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Member interfaces</td>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Member interfaces"); ?></td>
<td width="78%" class="vtable">
<select name="members[]" multiple="true" class="formselect" size="3">
<?php
@ -262,11 +262,11 @@ function show_source_port_range() {
?>
</select>
<br/>
<span class="vexpl">Interfaces participating in the bridge.</span>
<span class="vexpl"><?=gettext("Interfaces participating in the bridge."); ?></span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Description</td>
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable">
<input type="text" name="descr" id="descr" class="formfld unknown" size="50" value="<?=$pconfig['descr'];?>">
</td>
@ -281,10 +281,10 @@ function show_source_port_range() {
<td valign="top" class="vncell" align="middle">RSTP/STP </td>
<td class="vtable">
<input type="checkbox" name="enablestp" id="enablestp" <?php if ($pconfig['enablestp']) echo "checked";?>>
<span class="vexpl"><strong>Enable spanning tree options for this bridge. </strong></span>
<span class="vexpl"><strong><?=gettext("Enable spanning tree options for this bridge."); ?> </strong></span>
<br/><br/>
<table id="stpoptions" name="stpoptions" border="0" cellpadding="6" cellspacing="0">
<tr><td valign="top" class="vncell" width="20%">Protocol</td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Protocol"); ?></td>
<td class="vtable" width="80%">
<select name="proto" id="proto">
<?php
@ -297,9 +297,9 @@ function show_source_port_range() {
?>
</select>
<br/>
<span class="vexpl">Protocol used for spanning tree. </span></td>
<span class="vexpl"><?=gettext("Protocol used for spanning tree."); ?> </span></td>
</td></tr>
<tr> <td valign="top" class="vncell" width="20%">STP interfaces</td>
<tr> <td valign="top" class="vncell" width="20%"><?=gettext("STP interfaces"); ?></td>
<td class="vtable" width="80%">
<select name="stp[]" class="formselect" multiple="true" size="3">
<?php
@ -312,61 +312,61 @@ function show_source_port_range() {
?>
</select>
<br/>
<span class="vexpl" >
Enable Spanning Tree Protocol on interface. The if_bridge(4)
<span class="vexpl" >
<?=gettext("Enable Spanning Tree Protocol on interface. The if_bridge(4)
driver has support for the IEEE 802.1D Spanning Tree Protocol
(STP). STP is used to detect and remove loops in a
network topology.
network topology."); ?>
</span>
</td></tr>
<tr><td valign="top" class="vncell" width="20%">Valid time</td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Valid time"); ?></td>
<td class="vtable" width="80%">
<input name="maxage" type="text" class="formfld unkown" id="maxage" size="8" value="<?=$pconfig['maxage'];?>"> seconds
<input name="maxage" type="text" class="formfld unkown" id="maxage" size="8" value="<?=$pconfig['maxage'];?>"> <?=gettext("seconds"); ?>
<br/>
<span class="vexpl">
Set the time that a Spanning Tree Protocol configuration is
<?=gettext("Set the time that a Spanning Tree Protocol configuration is
valid. The default is 20 seconds. The minimum is 6 seconds and
the maximum is 40 seconds.
the maximum is 40 seconds."); ?>
</span>
</td></tr>
<tr><td valign="top" class="vncell" width="20%">Forward time </td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Forward time"); ?> </td>
<td class="vtable" width="80%">
<input name="fwdelay" type="text" class="formfld unkown" id="fwdelay" size="8" value="<?=$pconfig['fwdelay'];?>"> seconds
<input name="fwdelay" type="text" class="formfld unkown" id="fwdelay" size="8" value="<?=$pconfig['fwdelay'];?>"> <?=gettext("seconds"); ?>
<br/>
<span class="vexpl">
Set the time that must pass before an interface begins forwarding
packets when Spanning Tree is enabled. The default is 15 seconds. The minimum is 4 seconds and the maximum is 30 seconds.
<?=gettext("Set the time that must pass before an interface begins forwarding
packets when Spanning Tree is enabled. The default is 15 seconds. The minimum is 4 seconds and the maximum is 30 seconds."); ?>
</span>
</td></tr>
<tr><td valign="top" class="vncell" width="20%">Hello time</td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Hello time"); ?></td>
<td class="vtable" width="80%">
<input name="hellotime" type="text" class="formfld unkown" size="8" id="hellotime" value="<?=$pconfig['hellotime'];?>"> seconds
<input name="hellotime" type="text" class="formfld unkown" size="8" id="hellotime" value="<?=$pconfig['hellotime'];?>"> <?=gettext("seconds"); ?>
<br/>
<span class="vexpl">
Set the time between broadcasting of Spanning Tree Protocol configuration messages. The hello time may only be changed when
operating in legacy STP mode. The default is 2 seconds. The minimum is 1 second and the maximum is 2 seconds.
<?=gettext("Set the time between broadcasting of Spanning Tree Protocol configuration messages. The hello time may only be changed when
operating in legacy STP mode. The default is 2 seconds. The minimum is 1 second and the maximum is 2 seconds."); ?>
</span>
</td></tr>
<tr><td valign="top" class="vncell" width="20%">Priority</td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td>
<td class="vtable" width="80%">
<input name="priority" type="text" class="formfld unkown" id="priority" value="<?=$pconfig['priority'];?>">
<br/>
<span class="vexpl">
Set the bridge priority for Spanning Tree. The default is 32768.
The minimum is 0 and the maximum is 61440.
<?=gettext("Set the bridge priority for Spanning Tree. The default is 32768.
The minimum is 0 and the maximum is 61440."); ?>
</span>
</td></tr>
<tr><td valign="top" class="vncell" width="20%">Hold count</td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Hold count"); ?></td>
<td class="vtable" width="80%">
<input name="holdcnt" type="text" class="formfld unkown" id="holdcnt" value="<?=$pconfig['holdcnt'];?>">
<br/>
<span class="vexpl">
Set the transmit hold count for Spanning Tree. This is the num-
<?=gettext("Set the transmit hold count for Spanning Tree. This is the num-
ber of packets transmitted before being rate limited. The
default is 6. The minimum is 1 and the maximum is 10.
default is 6. The minimum is 1 and the maximum is 10."); ?>
</span>
</td></tr>
<tr><td valign="top" class="vncell" width="20%">Priority</td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Priority"); ?></td>
<td class="vtable" width="80%">
<table>
<?php foreach ($ifacelist as $ifn => $ifdescr)
@ -375,11 +375,11 @@ function show_source_port_range() {
</table>
<br/>
<span class="vexpl" >
Set the Spanning Tree priority of interface to value. The
default is 128. The minimum is 0 and the maximum is 240.
<?=gettext("Set the Spanning Tree priority of interface to value. The
default is 128. The minimum is 0 and the maximum is 240."); ?>
</span>
</td></tr>
<tr><td valign="top" class="vncell" width="20%">Path cost</td>
<tr><td valign="top" class="vncell" width="20%"><?=gettext("Path cost"); ?></td>
<td class="vtable" width="80%">
<table>
<?php $i = 0; foreach ($ifacelist as $ifn => $ifdescr)
@ -388,40 +388,40 @@ function show_source_port_range() {
</table>
<br/>
<span class="vexpl" >
Set the Spanning Tree path cost of interface to value. The
<?=gettext("Set the Spanning Tree path cost of interface to value. The
default is calculated from the link speed. To change a previously selected path cost back to automatic, set the cost to 0.
The minimum is 1 and the maximum is 200000000.
The minimum is 1 and the maximum is 200000000."); ?>
</span>
</td></tr>
</table>
</tr>
<tr style="display:none" id="sprtable2" name="sprtable2">
<td valign="top" class="vncell">Cache size</td>
<td valign="top" class="vncell"><?=gettext("Cache size"); ?></td>
<td class="vtable">
<input name="maxaddr" size="10" type="text" class="formfld unkown" id="maxaddr" value="<?=$pconfig['maxaddr'];?>"> entries
<br/><span class="vexpl">
Set the size of the bridge address cache to size. The default is
100 entries.
<?=gettext("Set the size of the bridge address cache to size. The default is
100 entries."); ?>
</span>
</td>
</tr>
<tr style="display:none" id="sprtable3" name="sprtable3">
<td valign="top" class="vncell">Cache entry expire time</td>
<td valign="top" class="vncell"><?=gettext("Cache entry expire time"); ?></td>
<td>
<input name="timeout" type="text" class="formfld unkown" id="timeout" size="10" value="<?=$pconfig['timeout'];?>"> seconds
<br/><span class="vexpl">
Set the timeout of address cache entries to this number of seconds. If
<?=gettext("Set the timeout of address cache entries to this number of seconds. If
seconds is zero, then address cache entries will not be expired.
The default is 240 seconds.
The default is 240 seconds."); ?>
</span>
</td>
</tr>
<tr style="display:none" id="sprtable4" name="sprtable4">
<td valign="top" class="vncell">Span port</td>
<td valign="top" class="vncell"><?=gettext("Span port"); ?></td>
<td class="vtable">
<select name="span" class="formselect" id="span">
<option value="none" selected>None</option>
<option value="none" selected><?=gettext("None"); ?></option>
<?php
foreach ($ifacelist as $ifn => $ifdescr) {
echo "<option value=\"{$ifn}\"";
@ -432,21 +432,21 @@ Set the size of the bridge address cache to size. The default is
?>
</select>
<br/><span class="vexpl">
Add the interface named by interface as a span port on the
<?=gettext("Add the interface named by interface as a span port on the
bridge. Span ports transmit a copy of every frame received by
the bridge. This is most useful for snooping a bridged network
passively on another host connected to one of the span ports of
the bridge.
the bridge."); ?>
</span>
<p class="vexpl"><span class="red"><strong>
Note:<br>
<?=gettext("Note:"); ?><br>
</strong></span>
The span interface cannot be part of the bridge member interfaces.
<?=gettext("The span interface cannot be part of the bridge member interfaces."); ?>
</span>
</td>
</tr>
<tr style="display:none" id="sprtable5" name="sprtable5">
<td valign="top" class="vncell">Edge ports</td>
<td valign="top" class="vncell"><?=gettext("Edge ports"); ?></td>
<td class="vtable">
<select name="edge[]" class="formselect" multiple="true" size="3">
<?php
@ -460,13 +460,13 @@ Set the size of the bridge address cache to size. The default is
</select>
<br>
<span class="vexpl">
Set interface as an edge port. An edge port connects directly to
<?=gettext("Set interface as an edge port. An edge port connects directly to
end stations and cannot create bridging loops in the network; this
allows it to transition straight to forwarding.
allows it to transition straight to forwarding."); ?>
</span></td>
</tr>
<tr style="display:none" id="sprtable6" name="sprtable6">
<td valign="top" class="vncell">Auto Edge ports</td>
<td valign="top" class="vncell"><?=gettext("Auto Edge ports"); ?></td>
<td class="vtable">
<select name="autoedge[]" class="formselect" multiple="true" size="3">
<?php
@ -480,16 +480,16 @@ Set the size of the bridge address cache to size. The default is
</select>
<br>
<span class="vexpl">
Allow interface to automatically detect edge status. This is the
default for all interfaces added to a bridge.
<?=gettext("Allow interface to automatically detect edge status. This is the
default for all interfaces added to a bridge."); ?>
<p class="vexpl"><span class="red"><strong>
Note:<br>
<?=gettext("Note:"); ?><br>
</strong></span>
This will disable the autoedge status of interfaces.
<?=gettext("This will disable the autoedge status of interfaces."); ?>
</span></td>
</tr>
<tr style="display:none" id="sprtable7" name="sprtable7">
<td valign="top" class="vncell">PTP ports</td>
<td valign="top" class="vncell"><?=gettext("PTP ports"); ?></td>
<td class="vtable">
<select name="ptp[]" class="formselect" multiple="true" size="3">
<?php
@ -503,13 +503,13 @@ Set the size of the bridge address cache to size. The default is
</select>
<br>
<span class="vexpl">
Set the interface as a point-to-point link. This is required for
<?=gettext("Set the interface as a point-to-point link. This is required for
straight transitions to forwarding and should be enabled on a
direct link to another RSTP-capable switch.
direct link to another RSTP-capable switch."); ?>
</span></td>
</tr>
<tr style="display:none" id="sprtable8" name="sprtable8">
<td valign="top" class="vncell">Auto PTP ports</td>
<td valign="top" class="vncell"><?=gettext("Auto PTP ports"); ?></td>
<td class="vtable">
<select name="autoptp[]" class="formselect" multiple="true" size="3">
<?php
@ -523,17 +523,17 @@ Set the size of the bridge address cache to size. The default is
</select>
<br>
<span class="vexpl">
Automatically detect the point-to-point status on interface by
<?=gettext("Automatically detect the point-to-point status on interface by
checking the full duplex link status. This is the default for
interfaces added to the bridge.
interfaces added to the bridge."); ?>
<p class="vexpl"><span class="red"><strong>
Note:<br>
<?=gettext("Note:"); ?><br>
</strong></span>
The interfaces selected here will be removed from default autoedge status.
<?=gettext("The interfaces selected here will be removed from default autoedge status."); ?>
</span></td>
</tr>
<tr style="display:none" id="sprtable9" name="sprtable9">
<td valign="top" class="vncell">Sticky ports</td>
<td valign="top" class="vncell"><?=gettext("Sticky ports"); ?></td>
<td class="vtable">
<select name="static[]" class="formselect" multiple="true" size="3">
<?php
@ -547,14 +547,14 @@ Set the size of the bridge address cache to size. The default is
</select>
<br>
<span class="vexpl">
Mark an interface as a "sticky" interface. Dynamically learned
<?=gettext("Mark an interface as a \"sticky\" interface. Dynamically learned
address entries are treated as static once entered into the
cache. Sticky entries are never aged out of the cache or
replaced, even if the address is seen on a different interface.
replaced, even if the address is seen on a different interface."); ?>
</span></td>
</tr>
<tr style="display:none" id="sprtable10" name="sprtable10">
<td valign="top" class="vncell">Private ports</td>
<td valign="top" class="vncell"><?=gettext("Private ports"); ?></td>
<td class="vtable">
<select name="private[]" class="formselect" multiple="true" size="3">
<?php
@ -568,15 +568,15 @@ Set the size of the bridge address cache to size. The default is
</select>
<br>
<span class="vexpl">
Mark an interface as a "private" interface. A private interface does not forward any traffic to any other port that is also
a private interface.
<?=gettext("Mark an interface as a \"private\" interface. A private interface does not forward any traffic to any other port that is also
a private interface."); ?>
</span></td>
</tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input type="hidden" name="bridgeif" value="<?=$pconfig['bridgeif']; ?>">
<input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" value="Cancel" onclick="history.back()">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> <input type="button" value="<?=gettext("Cancel"); ?>" onclick="history.back()">
<?php if (isset($id) && $a_bridges[$id]): ?>
<input name="id" type="hidden" value="<?=$id;?>">
<?php endif; ?>