Commit 1ed6b998 authored by Franco Fichtner's avatar Franco Fichtner

interfaces: assorted UI tweaks and corrections

parent 331d5a8f
......@@ -162,7 +162,7 @@ $main_buttons = array(
$i++;
endforeach; ?>
<tr>
<td colspan="4">
<td colspan="5">
<?= gettext("Not all drivers/NICs support 802.1Q QinQ tagging properly. On cards that do not explicitly support it, QinQ tagging will still work, but the reduced MTU may cause problems.");?>
</td>
</tr>
......
......@@ -40,8 +40,8 @@ if (!isset($config['qinqs']['qinqentry']) || !is_array($config['qinqs']['qinqent
$a_qinqs = &$config['qinqs']['qinqentry'];
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// read form data
if (!empty($a_qinqs[$_GET['id']])) {
$id = 0;
if (isset($_GET['id']) && !empty($a_qinqs[$_GET['id']])) {
$id = $_GET['id'];
}
$pconfig['if'] = isset($a_qinqs[$id]['if']) ? $a_qinqs[$id]['if'] : null;
......@@ -50,7 +50,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['descr'] = isset($a_qinqs[$id]['descr']) ? $a_qinqs[$id]['descr'] : null;
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
// validate / save form data
if (!empty($a_qinqs[$_POST['id']])) {
if (isset($_POST['id']) && !empty($a_qinqs[$_POST['id']])) {
$id = $_POST['id'];
}
$input_errors = array();
......@@ -72,7 +72,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$input_errors[] = gettext("QinQ level already exists for this interface, edit it!");
}
}
if (is_array($config['vlans']['vlan'])) {
if (isset($config['vlans']['vlan'])) {
foreach ($config['vlans']['vlan'] as $vlan) {
if ($vlan['tag'] == $pconfig['tag'] && $vlan['if'] == $pconfig['if']) {
$input_errors[] = gettext("A normal VLAN exists with this tag please remove it to use this tag for QinQ first level.");
......@@ -214,7 +214,7 @@ include("head.inc");
<td>
<input name="submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" />
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_qinq.php');?>'" />
<?php if (isset($id) && $a_qinqs[$id]): ?>
<?php if (isset($id) && isset($a_qinqs[$id])): ?>
<input name="id" type="hidden" value="<?=$id;?>" />
<?php endif; ?>
</td>
......
......@@ -140,67 +140,63 @@ include("head.inc");
<div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12">
<div class="content-box">
<div class="content-box-main">
<div class="table-responsive">
<form method="post" name="iform" id="iform">
<table class="table table-striped">
<thead>
<tr>
<td width="22%"><strong><?=gettext("Wireless clone configuration");?></strong></td>
<td width="78%" align="right">
<small><?=gettext("full help"); ?> </small>
<i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i>
&nbsp;
</td>
</tr>
</thead>
<tbody>
<tr>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Parent interface");?></td>
<td>
<select name="if" class="selectpicker">
<div class="content-box tab-content">
<form method="post" name="iform" id="iform">
<table class="table table-striped">
<thead>
<tr>
<td width="22%"><strong><?=gettext("Wireless clone configuration");?></strong></td>
<td width="78%" align="right">
<small><?=gettext("full help"); ?> </small>
<i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i>
&nbsp;
</td>
</tr>
</thead>
<tbody>
<tr>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Parent interface");?></td>
<td>
<select name="if" class="selectpicker">
<?php
foreach (get_interface_list() as $ifn => $ifinfo):
if (match_wireless_interface($ifn)):
if (strstr($ifn, '_wlan')) {
continue;
}?>
<option value="<?=$ifn;?>" <?=$ifn == $pconfig['if'] ? "selected=\"selected\"" : "";?>>
<?=htmlspecialchars($ifn . " (" . $ifinfo['mac'] . ")");?>
</option>
foreach (get_interface_list() as $ifn => $ifinfo):
if (match_wireless_interface($ifn)):
if (strstr($ifn, '_wlan')) {
continue;
}?>
<option value="<?=$ifn;?>" <?=$ifn == $pconfig['if'] ? "selected=\"selected\"" : "";?>>
<?=htmlspecialchars($ifn . " (" . $ifinfo['mac'] . ")");?>
</option>
<?php
endif;
endforeach;?>
</select>
</td>
</tr>
<tr>
<td><a id="help_for_descr" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Description");?></td>
<td>
<input name="descr" type="text" value="<?=$pconfig['descr'];?>" />
<div class="hidden" for="help_for_descr">
<?=gettext("You may enter a description here for your reference (not parsed).");?>
</div>
</div>
</tr>
<tr>
<td></td>
<td>
<input type="hidden" name="mode" value="<?=isset($pconfig['mode']) ? $pconfig['mode'] : 'bss' ?>" />
<input type="hidden" name="cloneif" value="<?=$pconfig['cloneif']; ?>" />
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" />
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_wireless.php');?>'" />
<?php if (isset($id)): ?>
<input name="id" type="hidden" value="<?=$id;?>" />
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
endif;
endforeach;?>
</select>
</td>
</tr>
<tr>
<td><a id="help_for_descr" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Description");?></td>
<td>
<input name="descr" type="text" value="<?=$pconfig['descr'];?>" />
<div class="hidden" for="help_for_descr">
<?=gettext("You may enter a description here for your reference (not parsed).");?>
</div>
</div>
</tr>
<tr>
<td></td>
<td>
<input type="hidden" name="mode" value="<?=isset($pconfig['mode']) ? $pconfig['mode'] : 'bss' ?>" />
<input type="hidden" name="cloneif" value="<?=$pconfig['cloneif']; ?>" />
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" />
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_wireless.php');?>'" />
<?php if (isset($id)): ?>
<input name="id" type="hidden" value="<?=$id;?>" />
<?php endif; ?>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</section>
</div>
......
......@@ -474,11 +474,11 @@ include("head.inc");
<table class="table table-striped">
<tr>
<td>
<?php printf(gettext("Using dial-on-demand will bring the connection up again if any packet ".
<?= gettext("Using dial-on-demand will bring the connection up again if any packet ".
"triggers it. To substantiate this point: disconnecting manually ".
"will %snot%s prevent dial-on-demand from making connections ".
"to the outside! Don't use dial-on-demand if you want to make sure that the line ".
"is kept disconnected."),'<strong>','</strong>')?>
"will not prevent dial-on-demand from making connections ".
"to the outside. Don't use dial-on-demand if you want to make sure that the line ".
"is kept disconnected.") ?>
</td>
</tr>
</table>
......
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