Commit f6014c36 authored by Franco Fichtner's avatar Franco Fichtner

vlan: more refactoring

parent 189ae898
......@@ -135,6 +135,20 @@ function interfaces_loopback_configure($verbose = false)
}
}
function interfaces_vlan_priorities()
{
return array(
1 => gettext('Background (1, lowest)'),
0 => gettext('Best Effort (0, default)'),
2 => gettext('Excellent Effort (2)'),
3 => gettext('Critical Applications (3)'),
4 => gettext('Video (4)'),
5 => gettext('Voice (5)'),
6 => gettext('Internetwork Control (6)'),
7 => gettext('Network Control (7, highest)'),
);
}
function interfaces_vlan_configure($realif = '', $verbose = false)
{
global $config;
......
......@@ -122,7 +122,8 @@ $main_buttons = array(
<thead>
<tr>
<th><?=gettext("Interface");?></th>
<th><?=gettext("VLAN tag");?></th>
<th><?=gettext("Tag");?></th>
<th><?=gettext("PCP");?></th>
<th><?=gettext("Description");?></th>
<th>&nbsp;</th>
</tr>
......@@ -134,6 +135,7 @@ $main_buttons = array(
<tr>
<td><?=$vlan['if'];?></td>
<td><?=$vlan['tag'];?></td>
<td><?= isset($vlan['pcp']) ? $vlan['pcp'] : 0 ?></td>
<td><?=$vlan['descr'];?></td>
<td>
<a href="interfaces_vlan_edit.php?id=<?=$i;?>" class="btn btn-xs btn-default" data-toggle="tooltip" title="<?=gettext("edit interface");?>">
......
......@@ -206,23 +206,11 @@ include("head.inc");
</div>
</td>
</tr>
<?
$priorities = array(
1 => gettext('Background (1, lowest)'),
0 => gettext('Best Effort (0, default)'),
2 => gettext('Excellent Effort (2)'),
3 => gettext('Critical Applications (3)'),
4 => gettext('Video (4)'),
5 => gettext('Voice (5)'),
6 => gettext('Internetwork Control (6)'),
7 => gettext('Network Control (7, highest)'),
);
?>
<tr>
<td><a id="help_for_pcp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("VLAN priority");?></td>
<td>
<select name="pcp">
<? foreach ($priorities as $pcp => $priority): ?>
<? foreach (interfaces_vlan_priorities() as $pcp => $priority): ?>
<option value="<?=$pcp;?>"<?=($pconfig['pcp'] == $pcp ? ' selected="selected"' : '');?>><?=htmlspecialchars($priority);?></option>
<? endforeach ?>
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment