mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Move template logic to includes + code cleanup
This commit is contained in:
@@ -800,7 +800,6 @@ function getTooltip($msg, $id, $visible = true, $data_html = false)
|
||||
{
|
||||
($visible) ? $opt1 = 'visible' : $opt1 = 'invisible';
|
||||
($data_html) ? $opt2 = 'data-html="true"' : $opt2 = 'data-html="false"';
|
||||
$tooltip = '<i class="fas fa-question-circle text-muted ' .$opt1.'" id="' .$id. '" data-toggle="tooltip" ' .$opt2. ' data-placement="auto" title="' . _($msg). '"></i>';
|
||||
return $tooltip;
|
||||
echo '<i class="fas fa-question-circle text-muted ' .$opt1.'" id="' .$id. '" data-toggle="tooltip" ' .$opt2. ' data-placement="auto" title="' . _($msg). '"></i>';
|
||||
}
|
||||
|
||||
|
@@ -109,6 +109,30 @@ function DisplayHostAPDConfig()
|
||||
$txpower = $_POST['txpower'];
|
||||
}
|
||||
|
||||
$countries_5Ghz_max48ch = RASPI_5GHZ_ISO_ALPHA2;
|
||||
$selectedHwMode = $arrConfig['hw_mode'];
|
||||
if (isset($arrConfig['ieee80211n'])) {
|
||||
if (strval($arrConfig['ieee80211n']) === '1') {
|
||||
$selectedHwMode = 'n';
|
||||
}
|
||||
}
|
||||
if (isset($arrConfig['ieee80211ac'])) {
|
||||
if (strval($arrConfig['ieee80211ac']) === '1') {
|
||||
$selectedHwMode = 'ac';
|
||||
}
|
||||
}
|
||||
if (isset($arrConfig['ieee80211w'])) {
|
||||
if (strval($arrConfig['ieee80211w']) === '2') {
|
||||
$selectedHwMode = 'w';
|
||||
}
|
||||
}
|
||||
if (!in_array($arrConfig['country_code'], $countries_5Ghz_max48ch)) {
|
||||
$hwModeDisabled = 'ac';
|
||||
if ($selectedHwMode === $hwModeDisabled) {
|
||||
unset($selectedHwMode);
|
||||
}
|
||||
}
|
||||
|
||||
echo renderTemplate(
|
||||
"hostapd", compact(
|
||||
"status",
|
||||
@@ -124,7 +148,9 @@ function DisplayHostAPDConfig()
|
||||
"arrTxPower",
|
||||
"txpower",
|
||||
"arrHostapdConf",
|
||||
"operatingSystem"
|
||||
"operatingSystem",
|
||||
"selectedHwMode",
|
||||
"hwModeDisabled"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user