beautify and unify code

small bugfixes
switch to standard bootstrap
This commit is contained in:
anoy 2016-07-24 18:06:10 +02:00
parent dfc33b0ab9
commit d780e10a60
10 changed files with 1277 additions and 1375 deletions

17
.editorconfig Normal file
View File

@ -0,0 +1,17 @@
# EditorConfig is awesome: http://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
[*.md]
trim_trailing_whitespace = false
[*.js]
indent_size = 2

View File

@ -48,7 +48,7 @@
"logo_alt" => "Freifunk Rhein-Sieg-Kreis Logo", "logo_alt" => "Freifunk Rhein-Sieg-Kreis Logo",
"logo_url" => "images/Freifunk-logo-rhein-sieg-klein-200.png", "logo_url" => "images/Freifunk-logo-rhein-sieg-klein-200.png",
"lang_titel" => "Freifunk Rhein-Sieg Community Auswahl", "lang_titel" => "Freifunk Rhein-Sieg Community Auswahl",
"lang_text" => "Bitte suchen Sie die passende Community aus, indem Sie die Community und gegebenenfalls noch einen Bereich in der Community auswählen.<br />Sie werden dann weitergeleitet auf die eigentliche Firmware Download Seite für die gewähle Community.", "lang_text" => "Bitte suchen Sie die passende Community aus, indem Sie die Community und gegebenenfalls noch einen Bereich in der Community auswählen.<br />Sie werden dann weitergeleitet auf die eigentliche Firmware Download Seite für die gewählte Community.",
"download_path" => "", "download_path" => "",
"sub_auswahl" => "" "sub_auswahl" => ""
), ),
@ -249,4 +249,3 @@
"sub_auswahl" => "" "sub_auswahl" => ""
) )
); );
?>

View File

@ -6,14 +6,14 @@
*/ */
$entwicklung = array( $entwicklung = array(
0 => "beta", "beta",
1 => "broken", "broken",
2 => "experimental", "experimental",
3 => "stable" "stable"
); );
$installation = array( $installation = array(
0 => "factory", "factory",
1 => "sysupgrade" "sysupgrade"
); );
for ($i = 0; $i < count($entwicklung); $i++) { for ($i = 0; $i < count($entwicklung); $i++) {
@ -23,103 +23,103 @@
} }
$hersteller = array( $hersteller = array(
0 => array( array(
"name" => "8devices", "name" => "8devices",
"filename" => "8devices", "filename" => "8devices",
"offset_modell" => 9, "offset_modell" => 9,
"offset_version" => 3 "offset_version" => 3
), ),
1 => array( array(
"name" => "Alfa", "name" => "Alfa",
"filename" => "alfa", "filename" => "alfa",
"offset_modell" => 5, "offset_modell" => 5,
"offset_version" => 4 "offset_version" => 4
), ),
2 => array( array(
"name" => "Allnet", "name" => "Allnet",
"filename" => "allnet", "filename" => "allnet",
"offset_modell" => 7, "offset_modell" => 7,
"offset_version" => 4 "offset_version" => 4
), ),
3 => array( array(
"name" => "Buffalo", "name" => "Buffalo",
"filename" => "buffalo", "filename" => "buffalo",
"offset_modell" => 8, "offset_modell" => 8,
"offset_version" => 4 "offset_version" => 4
), ),
4 => array( array(
"name" => "D-Link", "name" => "D-Link",
"filename" => "d-link", "filename" => "d-link",
"offset_modell" => 7, "offset_modell" => 7,
"offset_version" => -1 "offset_version" => -1
), ),
5 => array( array(
"name" => "GL-Inet", "name" => "GL-Inet",
"filename" => "gl-inet", "filename" => "gl-inet",
"offset_modell" => 8, "offset_modell" => 8,
"offset_version" => -1 "offset_version" => -1
), ),
6 => array( array(
"name" => "LeMaker", "name" => "LeMaker",
"filename" => "lemaker", "filename" => "lemaker",
"offset_modell" => 8, "offset_modell" => 8,
"offset_version" => 4 "offset_version" => 4
), ),
7 => array( array(
"name" => "Linksys", "name" => "Linksys",
"filename" => "linksys", "filename" => "linksys",
"offset_modell" => 8, "offset_modell" => 8,
"offset_version" => 4 "offset_version" => 4
), ),
8 => array( array(
"name" => "Meraki", "name" => "Meraki",
"filename" => "meraki", "filename" => "meraki",
"offset_modell" => 7, "offset_modell" => 7,
"offset_version" => 4 "offset_version" => 4
), ),
9 => array( array(
"name" => "Netgear", "name" => "Netgear",
"filename" => "netgear", "filename" => "netgear",
"offset_modell" => 8, "offset_modell" => 8,
"offset_version" => 4 "offset_version" => 4
), ),
10 => array( array(
"name" => "Onion", "name" => "Onion",
"filename" => "onion", "filename" => "onion",
"offset_modell" => 6, "offset_modell" => 6,
"offset_version" => 4 "offset_version" => 4
), ),
11 => array( array(
"name" => "Openmesh", "name" => "Openmesh",
"filename" => "openmesh", "filename" => "openmesh",
"offset_modell" => 9, "offset_modell" => 9,
"offset_version" => 4 "offset_version" => 4
), ),
12 => array( array(
"name" => "Raspberry Pi", "name" => "Raspberry Pi",
"filename" => "raspberry-pi", "filename" => "raspberry-pi",
"offset_modell" => 13, "offset_modell" => 13,
"offset_version" => 4 "offset_version" => 4
), ),
13 => array( array(
"name" => "TP-Link", "name" => "TP-Link",
"filename" => "tp-link", "filename" => "tp-link",
"offset_modell" => 8, "offset_modell" => 8,
"offset_version" => -1 "offset_version" => -1
), ),
14 => array( array(
"name" => "Ubiquiti", "name" => "Ubiquiti",
"filename" => "ubiquiti", "filename" => "ubiquiti",
"offset_modell" => 9, "offset_modell" => 9,
"offset_version" => 4 "offset_version" => 4
), ),
15 => array( array(
"name" => "Western Digital", "name" => "Western Digital",
"filename" => "-wd-", "filename" => "-wd-",
"offset_modell" => 5, "offset_modell" => 5,
"offset_version" => 4 "offset_version" => 4
), ),
16 => array( array(
"name" => "x86", "name" => "x86",
"filename" => "x86", "filename" => "x86",
"offset_modell" => 4, "offset_modell" => 4,
@ -132,4 +132,3 @@
0 => 0, 0 => 0,
1 => 11 1 => 11
); );
?>

12
css/bootstrap.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -4,16 +4,36 @@
* @license Licensed under GPLv3 * @license Licensed under GPLv3
* *
*/ */
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,400italic");
body {
font-family: "Source Sans Pro","Helvetica Neue",Helvetica,Arial,sans-serif;
color:#555555;
}
.panel-default > .panel-heading {
background-color: #111;
color: #fff;
}
.panel-footer { .panel-footer {
font-size: 80%; font-size: 80%;
} }
.btn {
font-variant: small-caps;
font-weight: bold;
}
.btn-primary { .btn-primary {
background-color: #dc0067 !important; background-color: #dc0067 !important;
border-color: #cc0057 !important; border-color: #cc0057 !important;
} }
.panel-primary > .panel-heading {
background-color: #000000 !important; .img-box {
width: 175px;
height: 175px;
object-fit: contain;
margin: 5px;
} }
@media (min-width: 1200px) { @media (min-width: 1200px) {
.container{ .container{
width:auto; width:auto;

View File

@ -32,4 +32,3 @@ class ffrouter {
$this->stablesysupgradelink = ""; $this->stablesysupgradelink = "";
} }
} }
?>

View File

@ -121,4 +121,3 @@ for( $i=0; $i<count($router); $i++ ) { // Routerbilder einbauen
$router[$i]->imageback = "router_images/keinbild.jpg"; $router[$i]->imageback = "router_images/keinbild.jpg";
} }
} }
?>

View File

@ -4,34 +4,29 @@
* @copyright 2016 Caspar Armster, Freifunk Hennef/Freie Netzwerker e.V. (www.freifunk-hennef.de / www.freie-netzwerker.de) * @copyright 2016 Caspar Armster, Freifunk Hennef/Freie Netzwerker e.V. (www.freifunk-hennef.de / www.freie-netzwerker.de)
* @license Licensed under GPLv3 * @license Licensed under GPLv3
*/ */
error_reporting (E_ALL | E_STRICT); error_reporting (E_ALL ^ E_NOTICE);
ini_set ('display_errors', 'On');
require_once('community-config.inc.php'); require_once('community-config.inc.php');
require_once('config.inc.php'); require_once('config.inc.php');
require_once('ffrouter.class.php'); require_once('ffrouter.class.php');
$community_id = $_REQUEST['id']; $community_id = $_REQUEST['id'];
?>
echo <<<EOT
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title><?php echo $community[$community_id]["head_titel"]?></title>
EOT; <meta name="author" content="Caspar Armster" />
echo("<title>".$community[$community_id]["head_titel"]."</title>");
echo <<<EOT
<meta name="author" content="Caspar Armster">
<link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon"> <link rel="icon" href="favicon.ico" type="image/x-icon">
EOT;
<?php
$firmware_download_path = $community[$community_id]["download_path"]; $firmware_download_path = $community[$community_id]["download_path"];
try { try {
@ -40,455 +35,391 @@ EOT;
echo("Fehler: ".$e->getMessage()); echo("Fehler: ".$e->getMessage());
die(); die();
} }
$router_json = json_encode($router); ?>
$texte_json = json_encode($texte);
echo("\n<script>\n"); <script>
echo("var router_text = '".$router_json."';\n"); <?php
echo("var router_json = JSON.parse(router_text);\n"); echo "var router_json = ".json_encode($router)."\n";
echo("var texte_text = '".$texte_json."';\n"); echo "var texte_json = ".json_encode($texte)."\n";
echo("var texte_json = JSON.parse(texte_text);\n"); echo "var anzahl_hersteller = ".$anzahl_hersteller."\n";
echo("var anzahl_hersteller = ".$anzahl_hersteller.";\n"); $manufacturer = array();
foreach ($hersteller as $i => $value) {
echo("var herstellername = ["); array_push($manufacturer, $value['name']);
for( $i=0; $i<$anzahl_hersteller; $i++) {
echo("\"".$hersteller[$i]['name']."\"");
if( $i != $anzahl_hersteller-1) {
echo(", ");
} }
} echo "var herstellername = ".json_encode($manufacturer)."\n";
echo("];\n"); ?>
echo <<<EOT
function populateA () { function populateA () {
var s1 = document.getElementById("fw-dl-1"); var s1 = document.getElementById('fw-dl-1')
var s2 = document.getElementById("fw-dl-2"); var s2 = document.getElementById('fw-dl-2')
var s3 = document.getElementById("fw-dl-3"); var s3 = document.getElementById('fw-dl-3')
var s4 = document.getElementById("fw-dl-4"); var s4 = document.getElementById('fw-dl-4')
var s5 = document.getElementById("fw-dl-5"); var s5 = document.getElementById('fw-dl-5')
var s6 = document.getElementById("fw-dl-6"); var s6 = document.getElementById('fw-dl-6')
var img_router_front = document.getElementById("img_router_front"); var img_router_front = document.getElementById('img_router_front')
var img_router_back = document.getElementById("img_router_back"); var img_router_back = document.getElementById('img_router_back')
var optionArray = new Array(); var optionArray = [ ]
s2.innerHTML = ""; s2.innerHTML = ''
for(i=0; i<anzahl_hersteller; i++) { for (var i = 0; i < anzahl_hersteller; i++) {
if (s1.value == herstellername[i]) { if (s1.value == herstellername[i]) {
optionArray[0] = "|Modell auswählen"; optionArray[0] = '|Modell auswählen'
var j = 0; var j = 0
while (j < router_json.length) { while (j < router_json.length) {
if (router_json[j].hersteller == herstellername[i]) { if (router_json[j].hersteller == herstellername[i]) {
optionArray[j+1] = router_json[j].modell+"|"+router_json[j].modell; optionArray[j + 1] = router_json[j].modell + '|' + router_json[j].modell
if (j < router_json.length - 1) { if (j < router_json.length - 1) {
while (router_json[j].modell == router_json[j + 1].modell) { while (router_json[j].modell == router_json[j + 1].modell) {
if (j < router_json.length - 1) { if (j < router_json.length - 1) {
j++; j++
} else { } else {
break; break
} }
} }
} }
} }
j++; j++
} }
} }
} }
for (var option in optionArray) { for (var option in optionArray) {
var pair = optionArray[option].split("|"); var pair = optionArray[option].split('|')
var newOption = document.createElement("option"); var newOption = document.createElement('option')
newOption.value = pair[0]; newOption.value = pair[0]
newOption.innerHTML = pair[1]; newOption.innerHTML = pair[1]
s2.options.add(newOption); s2.options.add(newOption)
} }
while (s3.length > 1) { while (s3.length > 1) {
s3.remove(s3.length-1); s3.remove(s3.length - 1)
} }
while (s4.length > 1) { while (s4.length > 1) {
s4.remove(s4.length-1); s4.remove(s4.length - 1)
} }
while (s5.length > 1) { while (s5.length > 1) {
s5.remove(s5.length-1); s5.remove(s5.length - 1)
} }
s6.href = "#"; s6.href = '#'
s6.className = s6.className.replace( /(?:^|\s)disabled(?!\S)/g , '' ); s6.classList.remove('disabled', 'btn-primary', 'btn-danger', 'btn-warning', 'btn-success')
s6.className = s6.className.replace( /(?:^|\s)btn-primary(?!\S)/g , '' ); s6.className.add('btn-primary', 'disabled')
s6.className = s6.className.replace( /(?:^|\s)btn-danger(?!\S)/g , '' ); s6.textContent = 'Download Firmware'
s6.className = s6.className.replace( /(?:^|\s)btn-warning(?!\S)/g , '' ); img_router_front.src = 'router_images/keinbild.jpg'
s6.className = s6.className.replace( /(?:^|\s)btn-success(?!\S)/g , '' ); img_router_back.src = 'router_images/keinbild.jpg'
s6.className += " btn-primary disabled";
s6.innerHTML = "Download Firmware";
img_router_front.src = "router_images/keinbild.jpg";
img_router_back.src = "router_images/keinbild.jpg";
} }
function populateB () { function populateB () {
var s1 = document.getElementById("fw-dl-2"); var s2 = document.getElementById('fw-dl-2')
var s2 = document.getElementById("fw-dl-3"); var s3 = document.getElementById('fw-dl-3')
var s4 = document.getElementById("fw-dl-4"); var s4 = document.getElementById('fw-dl-4')
var s5 = document.getElementById("fw-dl-5"); var s5 = document.getElementById('fw-dl-5')
var s6 = document.getElementById("fw-dl-6"); var s6 = document.getElementById('fw-dl-6')
var img_router_front = document.getElementById("img_router_front"); var img_router_front = document.getElementById('img_router_front')
var img_router_back = document.getElementById("img_router_back"); var img_router_back = document.getElementById('img_router_back')
var optionArray = new Array(); var optionArray = [ ]
optionArray[0] = "|Modell auswählen"; optionArray[0] = '|Modell auswählen'
s2.innerHTML = ""; s3.innerHTML = ''
var i = 0; var i = 0
while (i < router_json.length) { while (i < router_json.length) {
if(router_json[i].modell == s1.value) { if (router_json[i].modell == s2.value) {
optionArray[i+1] = i+"|"+router_json[i].version; optionArray[i + 1] = i + '|' + router_json[i].version
if (i < router_json.length - 1) { if (i < router_json.length - 1) {
while (router_json[i].modell == router_json[i + 1].modell) { while (router_json[i].modell == router_json[i + 1].modell) {
if (i < router_json.length - 1) { if (i < router_json.length - 1) {
i++; i++
optionArray[i+1] = i+"|"+router_json[i].version; optionArray[i + 1] = i + '|' + router_json[i].version
} else { } else {
break; break
} }
} }
} }
} }
i++; i++
} }
for (var option in optionArray) { for (var option in optionArray) {
var pair = optionArray[option].split("|"); var pair = optionArray[option].split('|')
var newOption = document.createElement("option"); var newOption = document.createElement('option')
newOption.value = pair[0]; newOption.value = pair[0]
newOption.innerHTML = pair[1]; newOption.innerHTML = pair[1]
s2.options.add(newOption); s3.options.add(newOption)
} }
while (s4.length > 1) { while (s4.length > 1) {
s4.remove(s4.length-1); s4.remove(s4.length - 1)
} }
while (s5.length > 1) { while (s5.length > 1) {
s5.remove(s5.length-1); s5.remove(s5.length - 1)
} }
s6.href = "#"; s6.href = '#'
s6.className = s6.className.replace( /(?:^|\s)disabled(?!\S)/g , '' ); s6.classList.remove('disabled', 'btn-primary', 'btn-danger', 'btn-warning', 'btn-success')
s6.className = s6.className.replace( /(?:^|\s)btn-primary(?!\S)/g , '' ); s6.className.add('btn-primary', 'disabled')
s6.className = s6.className.replace( /(?:^|\s)btn-danger(?!\S)/g , '' ); s6.textContent = 'Download Firmware'
s6.className = s6.className.replace( /(?:^|\s)btn-warning(?!\S)/g , '' ); img_router_front.src = 'router_images/keinbild.jpg'
s6.className = s6.className.replace( /(?:^|\s)btn-success(?!\S)/g , '' ); img_router_back.src = 'router_images/keinbild.jpg'
s6.className += " btn-primary disabled";
s6.innerHTML = "Download Firmware";
img_router_front.src = "router_images/keinbild.jpg";
img_router_back.src = "router_images/keinbild.jpg";
} }
function populateC () { function populateC () {
var s1 = document.getElementById("fw-dl-3"); var s3 = document.getElementById('fw-dl-3')
var s2 = document.getElementById("fw-dl-4"); var s4 = document.getElementById('fw-dl-4')
var s5 = document.getElementById("fw-dl-5"); var s5 = document.getElementById('fw-dl-5')
var s6 = document.getElementById("fw-dl-6"); var s6 = document.getElementById('fw-dl-6')
var img_router_front = document.getElementById("img_router_front"); var img_router_front = document.getElementById('img_router_front')
var img_router_back = document.getElementById("img_router_back"); var img_router_back = document.getElementById('img_router_back')
var optionArray = new Array(); var optionArray = [ ]
optionArray[0] = "|Erstinstallation?"; optionArray[0] = '|Erstinstallation?'
s2.innerHTML = ""; s4.innerHTML = ''
var newImageFront = router_json[s1.value].imagefront; var newImageFront = router_json[s3.value].imagefront
var newImageBack = router_json[s1.value].imageback; var newImageBack = router_json[s3.value].imageback
var i = 1; var i = 1
if((router_json[s1.value].betafactory == 1) || (router_json[s1.value].brokenfactory == 1) || (router_json[s1.value].experimentalfactory == 1) || (router_json[s1.value].stablefactory == 1)) { if ((router_json[s3.value].betafactory == 1) || (router_json[s3.value].brokenfactory == 1) || (router_json[s3.value].experimentalfactory == 1) || (router_json[s3.value].stablefactory == 1)) {
optionArray[i] = s1.value+"J|Ja"; optionArray[i] = s3.value + 'J|Ja'
i++; i++
} }
if((router_json[s1.value].betasysupgrade == 1) || (router_json[s1.value].brokensysupgrade == 1) || (router_json[s1.value].experimentalsysupgrade == 1) || (router_json[s1.value].stablesysupgrade == 1)) { if ((router_json[s3.value].betasysupgrade == 1) || (router_json[s3.value].brokensysupgrade == 1) || (router_json[s3.value].experimentalsysupgrade == 1) || (router_json[s3.value].stablesysupgrade == 1)) {
optionArray[i] = s1.value+"N|Nein"; optionArray[i] = s3.value + 'N|Nein'
} }
for (var option in optionArray) { for (var option in optionArray) {
var pair = optionArray[option].split("|"); var pair = optionArray[option].split('|')
var newOption = document.createElement("option"); var newOption = document.createElement('option')
newOption.value = pair[0]; newOption.value = pair[0]
newOption.innerHTML = pair[1]; newOption.innerHTML = pair[1]
s2.options.add(newOption); s4.options.add(newOption)
} }
while (s5.length > 1) { while (s5.length > 1) {
s5.remove(s5.length-1); s5.remove(s5.length - 1)
} }
s6.href = "#"; s6.href = '#'
s6.className = s6.className.replace( /(?:^|\s)disabled(?!\S)/g , '' ); s6.classList.remove('disabled', 'btn-primary', 'btn-danger', 'btn-warning', 'btn-success')
s6.className = s6.className.replace( /(?:^|\s)btn-primary(?!\S)/g , '' ); s6.className.add('btn-primary', 'disabled')
s6.className = s6.className.replace( /(?:^|\s)btn-danger(?!\S)/g , '' ); s6.textContent = 'Download Firmware'
s6.className = s6.className.replace( /(?:^|\s)btn-warning(?!\S)/g , '' ); img_router_front.src = newImageFront
s6.className = s6.className.replace( /(?:^|\s)btn-success(?!\S)/g , '' ); img_router_back.src = newImageBack
s6.className += " btn-primary disabled";
s6.innerHTML = "Download Firmware";
img_router_front.src = newImageFront;
img_router_back.src = newImageBack;
} }
function populateD () { function populateD () {
var s1 = document.getElementById("fw-dl-4"); var s4 = document.getElementById('fw-dl-4')
var s2 = document.getElementById("fw-dl-5"); var s5 = document.getElementById('fw-dl-5')
var s6 = document.getElementById("fw-dl-6"); var s6 = document.getElementById('fw-dl-6')
var optionArray = new Array(); var optionArray = [ ]
optionArray[0] = "|Entwicklungsstadium?"; optionArray[0] = '|Entwicklungsstadium?'
s2.innerHTML = ""; s5.innerHTML = ''
var id = parseInt(s1.value.slice(0,s1.value.length)); var id = parseInt(s4.value.slice(0, s4.value.length))
var jein = s1.value.slice(-1); var jein = s4.value.slice(-1)
var i = 1; var i = 1
if(jein == "J") { if (jein == 'J') {
if (router_json[id].betafactory == 1) { if (router_json[id].betafactory == 1) {
optionArray[i] = id+"Jbeta|Beta"; optionArray[i] = id + 'Jbeta|Beta'
i++; i++
} }
if (router_json[id].brokenfactory == 1) { if (router_json[id].brokenfactory == 1) {
optionArray[i] = id+"Jbroken|Broken"; optionArray[i] = id + 'Jbroken|Broken'
i++; i++
} }
if (router_json[id].experimentalfactory == 1) { if (router_json[id].experimentalfactory == 1) {
optionArray[i] = id+"Jexp|Experimental"; optionArray[i] = id + 'Jexp|Experimental'
i++; i++
} }
if (router_json[id].stablefactory == 1) { if (router_json[id].stablefactory == 1) {
optionArray[i] = id+"Jstable|Stable"; optionArray[i] = id + 'Jstable|Stable'
i++; i++
} }
} }
if(jein == "N") { if (jein == 'N') {
if (router_json[id].betasysupgrade == 1) { if (router_json[id].betasysupgrade == 1) {
optionArray[i] = id+"Nbeta|Beta"; optionArray[i] = id + 'Nbeta|Beta'
i++; i++
} }
if (router_json[id].brokensysupgrade == 1) { if (router_json[id].brokensysupgrade == 1) {
optionArray[i] = id+"Nbroken|Broken"; optionArray[i] = id + 'Nbroken|Broken'
i++; i++
} }
if (router_json[id].experimentalsysupgrade == 1) { if (router_json[id].experimentalsysupgrade == 1) {
optionArray[i] = id+"Nexp|Experimental"; optionArray[i] = id + 'Nexp|Experimental'
i++; i++
} }
if (router_json[id].stablesysupgrade == 1) { if (router_json[id].stablesysupgrade == 1) {
optionArray[i] = id+"Nstable|Stable"; optionArray[i] = id + 'Nstable|Stable'
i++; i++
} }
} }
for (var option in optionArray) { for (var option in optionArray) {
var pair = optionArray[option].split("|"); var pair = optionArray[option].split('|')
var newOption = document.createElement("option"); var newOption = document.createElement('option')
newOption.value = pair[0]; newOption.value = pair[0]
newOption.innerHTML = pair[1]; newOption.innerHTML = pair[1]
s2.options.add(newOption); s5.options.add(newOption)
} }
s6.href = "#"; s6.href = '#'
s6.className = s6.className.replace( /(?:^|\s)disabled(?!\S)/g , '' ); s6.classList.remove('disabled', 'btn-primary', 'btn-danger', 'btn-warning', 'btn-success')
s6.className = s6.className.replace( /(?:^|\s)btn-primary(?!\S)/g , '' ); s6.className.add('btn-primary', 'disabled')
s6.className = s6.className.replace( /(?:^|\s)btn-danger(?!\S)/g , '' ); s6.textContent = 'Download Firmware'
s6.className = s6.className.replace( /(?:^|\s)btn-warning(?!\S)/g , '' );
s6.className = s6.className.replace( /(?:^|\s)btn-success(?!\S)/g , '' );
s6.className += " btn-primary disabled";
s6.innerHTML = "Download Firmware";
} }
function populateE () { function populateE () {
var s1 = document.getElementById("fw-dl-5"); var s5 = document.getElementById('fw-dl-5')
var s2 = document.getElementById("fw-dl-6"); var s6 = document.getElementById('fw-dl-6')
s2.innerHTML = ""; var id = 0
if(s1.value.lastIndexOf("Jbeta") != -1) { var link = '#'
var id = parseInt(s1.value.slice(0,s1.value.length-4)); var linkclass = ''
var link = router_json[id].betafactorylink; if (s5.value.lastIndexOf('Jbeta') != -1) {
var linkclass = " btn-warning"; id = parseInt(s5.value.slice(0, s5.value.length - 4))
link = router_json[id].betafactorylink
linkclass = ' btn-warning'
} }
if(s1.value.lastIndexOf("Jbroken") != -1) { if (s5.value.lastIndexOf('Jbroken') != -1) {
var id = parseInt(s1.value.slice(0,s1.value.length-6)); id = parseInt(s5.value.slice(0, s5.value.length - 6))
var link = router_json[id].brokenfactorylink; link = router_json[id].brokenfactorylink
var linkclass = " btn-danger"; linkclass = ' btn-danger'
} }
if(s1.value.lastIndexOf("Jexp") != -1) { if (s5.value.lastIndexOf('Jexp') != -1) {
var id = parseInt(s1.value.slice(0,s1.value.length-3)); id = parseInt(s5.value.slice(0, s5.value.length - 3))
var link = router_json[id].experimentalfactorylink; link = router_json[id].experimentalfactorylink
var linkclass = " btn-warning"; linkclass = ' btn-warning'
} }
if(s1.value.lastIndexOf("Jstable") != -1) { if (s5.value.lastIndexOf('Jstable') != -1) {
var id = parseInt(s1.value.slice(0,s1.value.length-6)); id = parseInt(s5.value.slice(0, s5.value.length - 6))
var link = router_json[id].stablefactorylink; link = router_json[id].stablefactorylink
var linkclass = " btn-success"; linkclass = ' btn-success'
} }
if(s1.value.lastIndexOf("Nbeta") != -1) { if (s5.value.lastIndexOf('Nbeta') != -1) {
var id = parseInt(s1.value.slice(0,s1.value.length-4)); id = parseInt(s5.value.slice(0, s5.value.length - 4))
var link = router_json[id].betasysupgradelink; link = router_json[id].betasysupgradelink
var linkclass = " btn-warning"; linkclass = ' btn-warning'
} }
if(s1.value.lastIndexOf("Nbroken") != -1) { if (s5.value.lastIndexOf('Nbroken') != -1) {
var id = parseInt(s1.value.slice(0,s1.value.length-6)); id = parseInt(s5.value.slice(0, s5.value.length - 6))
var link = router_json[id].brokensysupgradelink; link = router_json[id].brokensysupgradelink
var linkclass = " btn-danger"; linkclass = ' btn-danger'
} }
if(s1.value.lastIndexOf("Nexp") != -1) { if (s5.value.lastIndexOf('Nexp') != -1) {
var id = parseInt(s1.value.slice(0,s1.value.length-3)); id = parseInt(s5.value.slice(0, s5.value.length - 3))
var link = router_json[id].experimentalsysupgradelink; link = router_json[id].experimentalsysupgradelink
var linkclass = " btn-warning"; linkclass = ' btn-warning'
} }
if(s1.value.lastIndexOf("Nstable") != -1) { if (s5.value.lastIndexOf('Nstable') != -1) {
var id = parseInt(s1.value.slice(0,s1.value.length-6)); id = parseInt(s5.value.slice(0, s5.value.length - 6))
var link = router_json[id].stablesysupgradelink; link = router_json[id].stablesysupgradelink
var linkclass = " btn-success"; linkclass = ' btn-success'
} }
s2.href = link; s6.href = link
s2.className = s2.className.replace( /(?:^|\s)disabled(?!\S)/g , '' ); s6.classList.remove('disabled', 'btn-primary', 'btn-danger', 'btn-warning', 'btn-success')
s2.className = s2.className.replace( /(?:^|\s)btn-primary(?!\S)/g , '' ); s6.className.add(linkclass)
s2.className = s2.className.replace( /(?:^|\s)btn-danger(?!\S)/g , '' ); s6.textContent = 'Download Firmware'
s2.className = s2.className.replace( /(?:^|\s)btn-warning(?!\S)/g , '' );
s2.className = s2.className.replace( /(?:^|\s)btn-success(?!\S)/g , '' );
s2.className += linkclass;
s2.innerHTML = "Download Firmware";
} }
</script> </script>
</head> </head>
<body> <body>
<div class="container">
EOT;
for($i=0; $i<$err; $i++) {
echo("<div class=\"alert alert-warning alert-dismissible\" role=\"alert\">\n");
echo(" <span class=\"glyphicon glyphicon-exclamation-sign\" aria-hidden=\"true\"></span>\n");
echo(" <span class=\"sr-only\">Warning:</span>\n");
echo(" <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\n");
echo(" <strong>Warning!</strong> ".$error_text[$i]."\n");
echo("</div>\n");
}
echo <<<EOT
<div class="row">
<div class="col-md-12">
<div class="jumbotron"> <div class="jumbotron">
EOT; <div class="container">
echo("<img src=\"".$community[$community_id]["logo_url"]."\" alt=\"".$community[$community_id]["logo_alt"]."\" style=\"float:right;\">"); <div class="col-xs-12">
echo <<<EOT <img src="<?php echo $community[$community_id]['logo_url']?>" alt="<?php echo $community[$community_id]['logo_alt']?>" class="pull-right img-box" />
<h2> <h2><?php echo $community[$community_id]['head_titel']?></h2>
EOT; <p><?php echo $community[$community_id]['head_text']?></p>
echo($community[$community_id]["head_titel"]);
echo <<<EOT
</h2>
<p> <p>
EOT; <a class="btn btn-primary btn-large" href="<?php echo $community[$community_id]['link_url']?>"><?php echo $community[$community_id]['link_text']?></a>
echo($community[$community_id]["head_text"]);
echo <<<EOT
</p>
<p>
EOT;
echo("<a class=\"btn btn-primary btn-large\" href=\"".$community[$community_id]["link_url"]."\">".$community[$community_id]["link_text"]."</a>");
echo <<<EOT
</p> </p>
</div> </div>
</div> </div>
</div> </div>
<div class="container">
<?php for ($i = 0; $i < $err; $i++): ?>
<div class="alert alert-warning alert-dismissible" role="alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Warning:</span>
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong>Warning!</strong> <?php echo $error_text[$i] ?>
</div>
<?php endfor ?>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="panel panel-primary"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title"><?php echo $community[$community_id]["lang_title"]?></h3>
EOT;
echo($community[$community_id]["lang_titel"]);
echo <<<EOT
</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<img src="router_images/keinbild.jpg" id="img_router_back" alt="Router Rückseite" width=200px" style="float:right;"> <img src="router_images/keinbild.jpg" class="pull-right img-box" id="img_router_back" alt="Router Rückseite" />
<img src="router_images/keinbild.jpg" id="img_router_front" alt="Router Vorderseite" width=200px" style="float:right;"> <img src="router_images/keinbild.jpg" class="pull-right img-box" id="img_router_front" alt="Router Vorderseite" />
EOT; <p><?php echo $community[$community_id]["lang_text"]?></p>
echo($community[$community_id]["lang_text"]);
echo <<<EOT
</div> </div>
<div class="panel-footer"> <div class="panel-footer">
<img src="images/ccbyncsa.png" alt="CC BY-NC-SA" width="60px"> Die Router Bilder sind von Daniel Krah und sind lizensiert unter einer <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" target:"_blank">Creative Commons Namensnennung - Nicht-kommerziell - Weitergabe unter gleichen Bedingungen 4.0 International Lizenz</a> <img src="images/ccbyncsa.png" alt="CC BY-NC-SA" class="pull-left" style="width: 60px; margin-right: 15px;" />
<p>Die Router Bilder sind von Daniel Krah und unter <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" target:"_blank">Creative Commons Namensnennung - Nicht-kommerziell - Weitergabe unter gleichen Bedingungen 4.0 International Lizenz</a> lizensiert.</p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="panel panel-primary"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">Router Hersteller</h3>
Router Hersteller
</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<select id="fw-dl-1" name="fw-dl-1" class="form-control" onchange="populateA()"> <select id="fw-dl-1" name="fw-dl-1" class="form-control" onchange="firmwarePage.onUpdate_1()">
<option value="">Hersteller auswählen</option> <option value="">Hersteller auswählen</option>
EOT; <?php foreach ($hersteller as $value): ?>
for($i=0; $i<$anzahl_hersteller; $i++) { <option value="<?php echo $value['name']?>"><?php echo $value['name']?></option>
echo("<option value=\"".$hersteller[$i]['name']."\">".$hersteller[$i]['name']."</option>"); <?php endforeach ?>
}
echo <<<EOT
</select> </select>
</div>
<div class="panel-footer">
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="panel panel-primary"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">Router Modell</h3>
Router Modell
</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<select id="fw-dl-2" name="fw-dl-2" class="form-control" onchange="populateB()"></select> <select id="fw-dl-2" name="fw-dl-2" class="form-control" onchange="populateB()"></select>
</div> </div>
<div class="panel-footer">
</div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="panel panel-primary"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">Router Version</h3>
Router Version
</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<select id="fw-dl-3" name="fw-dl-3" class="form-control" onchange="populateC()"></select> <select id="fw-dl-3" name="fw-dl-3" class="form-control" onchange="populateC()"></select>
</div> </div>
<div class="panel-footer">
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="panel panel-primary"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">Firmware Erstinstallation</h3>
Firmware Erstinstallation
</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<select id="fw-dl-4" name="fw-dl-4" class="form-control" onchange="populateD()"></select> <select id="fw-dl-4" name="fw-dl-4" class="form-control" onchange="populateD()"></select>
</div> </div>
<div class="panel-footer">
</div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="panel panel-primary"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">Firmware Entwicklungsstadium</h3>
Firmware Entwicklungsstadium
</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<select id="fw-dl-5" name="fw-dl-5" class="form-control" onchange="populateE()"></select> <select id="fw-dl-5" name="fw-dl-5" class="form-control" onchange="populateE()"></select>
</div> </div>
<div class="panel-footer">
</div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="panel panel-primary"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title">Firmware Download</h3>
Firmware Download
</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<a href="#" id="fw-dl-6" name="fw-dl-6" role="button" class="btn btn-primary disabled">Download Firmware</a> <a href="#" id="fw-dl-6" name="fw-dl-6" role="button" class="btn btn-primary btn-block disabled">Download Firmware</a>
</div>
<div class="panel-footer">
Licensed under GPLv3 / Copyright 2016 by Caspar Armster, <a href="http://www.freifunk-hennef.de/">Freifunk Hennef</a> / <a href="http://www.freie-netzwerker.de/">Freie Netzwerker e.V.</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<hr />
<footer>
<div class="col-xs-12 text-muted text-center">
<p>Licensed under GPLv3 / Copyright 2016 by Caspar Armster, <a href="http://www.freifunk-hennef.de/">Freifunk Hennef</a> / <a href="http://www.freie-netzwerker.de/">Freie Netzwerker e.V.</a></p>
</div>
</footer>
</div> </div>
<script src="js/jquery-2.2.3.min.js"></script> <script src="js/jquery-2.2.3.min.js"></script>
<script src="js/bootstrap.min.js"></script> <script src="js/bootstrap.min.js"></script>
<!-- <script src="js/scripts.js"></script> -->
</body> </body>
</html> </html>
EOT;
?>

256
index.php
View File

@ -4,228 +4,170 @@
* @copyright 2016 Caspar Armster, Freifunk Hennef/Freie Netzwerker e.V. (www.freifunk-hennef.de / www.freie-netzwerker.de) * @copyright 2016 Caspar Armster, Freifunk Hennef/Freie Netzwerker e.V. (www.freifunk-hennef.de / www.freie-netzwerker.de)
* @license Licensed under GPLv3 * @license Licensed under GPLv3
*/ */
error_reporting (E_ALL | E_STRICT); error_reporting (E_ALL ^ E_NOTICE);
ini_set ('display_errors', 'On');
require_once('community-config.inc.php'); require_once('community-config.inc.php');
require_once('config.inc.php'); require_once('config.inc.php');
if (count($community) == 1) { if (count($community) == 1) {
header('Location: firmware.php?id=0'); header('Location: firmware.php?id=0');
exit; exit;
} }
echo <<<EOT ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="de"> <html lang="de">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1" />
EOT; <title><?php echo $community[0]["head_titel"]?></title>
echo("<title>".$community[0]["head_titel"]."</title>");
echo <<<EOT
<meta name="author" content="Caspar Armster"> <meta name="author" content="Caspar Armster" />
<link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet"> <link href="css/styles.css" rel="stylesheet">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon"> <link rel="icon" href="favicon.ico" type="image/x-icon">
EOT;
$community_json = json_encode($community); <script>
$texte_json = json_encode($texte); <?php
echo("\n<script>\n"); echo "var community_json = ".json_encode($community)."\n";
echo("var community_text = '".$community_json."';\n"); echo "var texte_json = ".json_encode($texte)."\n";
echo("var community_json = JSON.parse(community_text);\n"); echo "var community_anzahl = ".count($community)."\n";
echo("var texte_text = '".$texte_json."';\n"); ?>
echo("var texte_json = JSON.parse(texte_text);\n");
echo("var community_anzahl = ".count($community).";\n");
echo <<<EOT
function populateA () { function populateA () {
var s1 = document.getElementById("fw-dl-1"); var s1 = document.getElementById('fw-dl-1')
var s2 = document.getElementById("fw-dl-2"); var s2 = document.getElementById('fw-dl-2')
var s3 = document.getElementById("fw-dl-3"); var s3 = document.getElementById('fw-dl-3')
s3.className = s3.className.replace( /(?:^|\s)disabled(?!\S)/g , '' ); s3.classList.remove('disabled', 'btn-primary', 'btn-success')
s3.className = s3.className.replace( /(?:^|\s)btn-primary(?!\S)/g , '' ); var optionArray = []
s3.className = s3.className.replace( /(?:^|\s)btn-success(?!\S)/g , '' ); s2.innerHTML = ''
var optionArray = new Array(); var i = 1
s2.innerHTML = ""; var j = 1
var i=1; var skip_sub = 0
var j=1;
var skip_sub = 0;
while (i < community_anzahl) { while (i < community_anzahl) {
if(s1.value == community_json[i]["name"]) { if (s1.value == community_json[i]['name']) {
if(community_json[i]["sub_auswahl"] != "") { if (community_json[i]['sub_auswahl'] != '') {
optionArray[j] = i+"|"+community_json[i]["sub_auswahl"]; optionArray[j] = i + '|' + community_json[i]['sub_auswahl']
$('#fw-dl-2').prop('disabled', false); $('#fw-dl-2').prop('disabled', false)
optionArray[0] = "|"+texte_json["ebene2_text"]; optionArray[0] = '|' + texte_json['ebene2_text']
} else { } else {
$('#fw-dl-2').prop('disabled', true); $('#fw-dl-2').prop('disabled', true)
optionArray[0] = "|"; optionArray[0] = '|'
var link = "firmware.php?id="+i; var link = 'firmware.php?id=' + i
var linkclass = " btn-success"; var linkclass = 'btn-success'
skip_sub = 1; skip_sub = 1
} }
j++; j++
} }
i++; i++
} }
for (var option in optionArray) { for (var option in optionArray) {
var pair = optionArray[option].split("|"); var pair = optionArray[option].split('|')
var newOption = document.createElement("option"); var newOption = document.createElement('option')
newOption.value = pair[0]; newOption.value = pair[0]
newOption.innerHTML = pair[1]; newOption.innerHTML = pair[1]
s2.options.add(newOption); s2.options.add(newOption)
} }
s3.innerHTML = "";
if (skip_sub == 1) { if (skip_sub == 1) {
s3.href = link; s3.href = link
s3.className += linkclass; s3.classList.add(linkclass)
} else { } else {
s3.href = "#"; s3.href = '#'
s3.className += " btn-primary disabled"; s3.classList.add('btn-primary', 'disabled')
} }
s3.innerHTML = texte_json["ebene3_text"]; s3.textContent = texte_json['ebene3_text']
} }
function populateB () { function populateB () {
var s1 = document.getElementById("fw-dl-1"); var s2 = document.getElementById('fw-dl-2')
var s2 = document.getElementById("fw-dl-2"); var s3 = document.getElementById('fw-dl-3')
var s3 = document.getElementById("fw-dl-3"); s3.classList.remove('disabled', 'btn-primary', 'btn-success')
s3.innerHTML = "";
if (s2.value != 0) { if (s2.value != 0) {
var link = "firmware.php?id="+s2.value; s3.href = 'firmware.php?id=' + s2.value
var linkclass = " btn-success"; s3.classList.add('btn-success')
} }
s3.href = link; s3.href = link
s3.className = s3.className.replace( /(?:^|\s)disabled(?!\S)/g , '' ); s3.textContent = texte_json['ebene3_text']
s3.className = s3.className.replace( /(?:^|\s)btn-primary(?!\S)/g , '' );
s3.className = s3.className.replace( /(?:^|\s)btn-success(?!\S)/g , '' );
s3.className += linkclass;
s3.innerHTML = texte_json["ebene3_text"];
} }
</script> </script>
</head> </head>
<body> <body>
<div class="jumbotron">
<div class="container">
<div class="col-xs-12">
<img src="<?php echo $community[0]['logo_url']?>" alt="<?php echo $community[0]['logo_alt']?>" class="pull-right img-box" />
<h2><?php echo $community[0]['head_titel']?></h2>
<p><?php echo $community[0]['head_text']?></p>
<p>
<a class="btn btn-primary btn-large" href="<?php echo $community[0]['link_url']?>"><?php echo $community[0]['link_text']?></a>
</p>
</div>
</div>
</div>
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="jumbotron"> <div class="panel panel-default">
EOT;
echo("<img src=\"".$community[0]["logo_url"]."\" alt=\"".$community[0]["logo_alt"]."\" style=\"float:right;\">");
echo <<<EOT
<h2>
EOT;
echo($community[0]["head_titel"]);
echo <<<EOT
</h2>
<p>
EOT;
echo($community[0]["head_text"]);
echo <<<EOT
</p>
<p>
EOT;
echo("<a class=\"btn btn-primary btn-large\" href=\"".$community[0]["link_url"]."\">".$community[0]["link_text"]."</a>");
echo <<<EOT
</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title"><?php echo $community[0]["lang_titel"] ?></h3>
EOT;
echo($community[0]["lang_titel"]);
echo <<<EOT
</h3>
</div>
<div class="panel-body">
EOT;
echo($community[0]["lang_text"]);
echo <<<EOT
</div>
<div class="panel-footer">
</div> </div>
<div class="panel-body"><p><?php echo $community[0]["lang_text"] ?></p></div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<div class="panel panel-primary"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title"><?php echo $texte["ebene1_titel"]?></h3>
EOT;
echo($texte["ebene1_titel"]);
echo <<<EOT
</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<select id="fw-dl-1" name="fw-dl-1" class="form-control" onchange="populateA()"> <select id="fw-dl-1" name="fw-dl-1" class="form-control" onchange="populateA()">
EOT; <option value=""><?php echo $texte["ebene1_text"]?></option>
echo("<option value=\"\">".$texte["ebene1_text"]."</option>"); <?php $lastName = "" ?>
for($i=1; $i<count($community); $i++) { <?php foreach ($community as $i => $value): ?>
echo("<option value=\"".$community[$i]['name']."\">".$community[$i]['name']."</option>"); <?php if ($value['name'] != $lastName): ?>
if($i<count($community)-1) { <option value="<?php echo $value['name']?>"><?php echo $value['name']?></option>
while($community[$i]['name'] == $community[$i+1]['name']) { <?php endif ?>
if($i<count($community)-1) { <?php $lastName = $value['name'] ?>
$i++; <?php endforeach ?>
} else {
break;
}
}
}
}
echo <<<EOT
</select> </select>
</div> </div>
<div class="panel-footer"> </div>
</div>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><?php echo $texte["ebene2_titel"]?></h3>
</div>
<div class="panel-body">
<select id="fw-dl-2" name="fw-dl-2" class="form-control" disabled="disabled" onchange="populateB()"></select>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<div class="panel panel-primary"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title"> <h3 class="panel-title"><?php echo $texte["ebene3_titel"]?></h3>
EOT;
echo($texte["ebene2_titel"]);
echo <<<EOT
</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<select id="fw-dl-2" name="fw-dl-2" class="form-control" disabled onchange="populateB()"></select> <a href="#" id="fw-dl-3" name="fw-dl-3" role="button" class="btn btn-primary btn-block disabled"><?php echo $texte["ebene3_text"]?></a>
</div>
<div class="panel-footer">
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">
EOT;
echo($texte["ebene3_titel"]);
echo <<<EOT
</h3>
</div>
<div class="panel-body">
EOT;
echo("<a href=\"#\" id=\"fw-dl-3\" name=\"fw-dl-3\" role=\"button\" class=\"btn btn-primary disabled\">".$texte["ebene3_text"]."</a>");
echo <<<EOT
</div>
<div class="panel-footer">
Licensed under GPLv3 / Copyright 2016 by Caspar Armster, <a href="http://www.freifunk-hennef.de/">Freifunk Hennef</a> / <a href="http://www.freie-netzwerker.de/">Freie Netzwerker e.V.</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<hr />
<footer>
<div class="col-xs-12 text-muted text-center">
<p>Licensed under GPLv3 / Copyright 2016 by Caspar Armster, <a href="http://www.freifunk-hennef.de/">Freifunk Hennef</a> / <a href="http://www.freie-netzwerker.de/">Freie Netzwerker e.V.</a></p>
</div> </div>
</footer>
</div>
<script src="js/jquery-2.2.3.min.js"></script> <script src="js/jquery-2.2.3.min.js"></script>
<script src="js/bootstrap.min.js"></script> <script src="js/bootstrap.min.js"></script>
<!-- <script src="js/scripts.js"></script> -->
</body> </body>
</html> </html>
EOT;
?>

View File

@ -47,6 +47,7 @@ Den Freifunk Hennef Firmware Downloader in ein eigenes Unterverzeichnis des Webs
- $texte ist das Array mit den einzelnen Überschriften/Texten für die Auswahlstufen - $texte ist das Array mit den einzelnen Überschriften/Texten für die Auswahlstufen
- $community ist das Array mit den Metadaten für die Metacommunity und die einzelnen Subcommunites. Wenn hier nur eine Community angegeben wird wird die Communtiyauswahl übersprungen und direkt auf die Firmware Downloader Seite verwiesen. - $community ist das Array mit den Metadaten für die Metacommunity und die einzelnen Subcommunites. Wenn hier nur eine Community angegeben wird wird die Communtiyauswahl übersprungen und direkt auf die Firmware Downloader Seite verwiesen.
```
0 => array( // ID die bei 0 Anfängt und hochgezählt wird 0 => array( // ID die bei 0 Anfängt und hochgezählt wird
"community_id" => 0, // ID der Community, wiederholt sich bei den zusammengehörigen Subcommunities "community_id" => 0, // ID der Community, wiederholt sich bei den zusammengehörigen Subcommunities
"name" => "Name der Community", "name" => "Name der Community",
@ -61,6 +62,7 @@ Den Freifunk Hennef Firmware Downloader in ein eigenes Unterverzeichnis des Webs
"download_path" => "Pfad zur Firmware", // Bleibt bei der Metacommunity leer "download_path" => "Pfad zur Firmware", // Bleibt bei der Metacommunity leer
"sub_auswahl" => "Name der Subcommunity" // Wird nur verwendet wenn die Community Subcommunites/Technologien als Auswahl hat "sub_auswahl" => "Name der Subcommunity" // Wird nur verwendet wenn die Community Subcommunites/Technologien als Auswahl hat
), ),
```
In der config.inc.php sind die Angaben über die Hersteller, Entwicklungsstufen & Art der Firmware Installation. Hier muss man normalerweise nichts anpassen, außer man verwendet Firmwares für Router von Herstellern, die noch nicht integriert sind, dann bitte ich allerdings auch um Kontaktaufnahme (caspar@freifunk-hennef.de, bzw. im github). In der config.inc.php sind die Angaben über die Hersteller, Entwicklungsstufen & Art der Firmware Installation. Hier muss man normalerweise nichts anpassen, außer man verwendet Firmwares für Router von Herstellern, die noch nicht integriert sind, dann bitte ich allerdings auch um Kontaktaufnahme (caspar@freifunk-hennef.de, bzw. im github).
- $entwicklung = Entwicklungsstufen der Firmware (beta/broken/experimental/stable) - (sollte man in Ruhe lassen normalerweise) - $entwicklung = Entwicklungsstufen der Firmware (beta/broken/experimental/stable) - (sollte man in Ruhe lassen normalerweise)