Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
changes related to #130 and added missing strings into internationali…
Browse files Browse the repository at this point in the history
…sations...
  • Loading branch information
dg9vh committed Mar 23, 2017
1 parent f8be14d commit 07c1d86
Show file tree
Hide file tree
Showing 17 changed files with 831 additions and 46 deletions.
21 changes: 21 additions & 0 deletions config/networks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
$networks_json = '{
"DMRPLUS":{
"label":"Multimode DMRplus",
"ini":"DMRPLUS",
"logo":"http://db0lm.de/wp-content/uploads/2015/10/DMR-Plus-300x109.png"
},
"BRANDMEISTER":{
"label":"Multimode BrandMeister",
"ini":"BRANDMEISTER",
"logo":"https://s3.amazonaws.com/files.qrz.com/a/pd1ra/dmr_brandmeister.jpg"
},
"DSTAR":{
"label":"Singlemode D-STAR",
"ini":"DSTAR",
"logo":""
}
}';

$networks = json_decode($networks_json, true);
?>
10 changes: 10 additions & 0 deletions include/tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,14 @@ function encode($hex) {
else
return "";
}

function recursive_array_search($needle,$haystack) {
foreach($haystack as $key=>$value) {
$current_key=$key;
if($needle===$value OR (is_array($value) && recursive_array_search($needle,$value) !== false)) {
return $current_key;
}
}
return false;
}
?>
45 changes: 34 additions & 11 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
setlocale(LC_ALL, LANG_LOCALE.'.'.$codeset);
textdomain('messages');


include("config/networks.php");
include "include/tools.php";
startStopwatch();
showLapTime("Start of page");
Expand Down Expand Up @@ -69,24 +71,37 @@
?>:</small> <?php echo getCallsign($mmdvmconfigs) ?></h1>
<h4>MMDVMHost by G4KLX Version: <?php echo getMMDVMHostVersion() ?><br>Firmware: <?php echo getFirmwareVersion() ?>
<?php
if (strlen(getDMRNetwork()) > 0 ) {
echo "<br>";
echo _("DMR-Network: ").getDMRNetwork();
if (defined("JSONNETWORK")) {
$key = recursive_array_search(getDMRNetwork(),$networks);
$network = $networks[$key];
echo "<br>";
echo _("Configuration").": ".$network['label'];

} else {
if (strlen(getDMRNetwork()) > 0 ) {
echo "<br>";
echo _("DMR-Network: ").getDMRNetwork();
}
}
?></h4>
<?php
$logourl = "";
if (getDMRNetwork() == "BrandMeister") {
if (constant('BRANDMEISTERLOGO') !== NULL) {
$logourl = BRANDMEISTERLOGO;
if (defined("JSONNETWORK")) {
$key = recursive_array_search(getDMRNetwork(),$networks);
$network = $networks[$key];
$logourl = $network['logo'];
} else {
if (getDMRNetwork() == "BrandMeister") {
if (constant('BRANDMEISTERLOGO') !== NULL) {
$logourl = BRANDMEISTERLOGO;
}
}
}
if (getDMRNetwork() == "DMRplus") {
if (constant('DMRPLUSLOGO') !== NULL) {
$logourl = DMRPLUSLOGO;
if (getDMRNetwork() == "DMRplus") {
if (constant('DMRPLUSLOGO') !== NULL) {
$logourl = DMRPLUSLOGO;
}
}
}

if ($logourl == "") {
$logourl = LOGO;
}
Expand All @@ -108,10 +123,18 @@
<?php
}
if (defined("ENABLENETWORKSWITCHING")) {
if (defined("JSONNETWORK")) {
echo ' <br>';
foreach ($networks as $network) {
echo ' <button onclick="window.location.href=\'./scripts/switchnetwork.php?network='.$network['ini'].'\'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-link" aria-hidden="true"></span>&nbsp;'.$network['label'].'</button>';
}

} else {
?>
<button onclick="window.location.href='./scripts/switchnetwork.php?network=DMRPLUS'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&nbsp;<?php echo _("DMRplus"); ?></button>
<button onclick="window.location.href='./scripts/switchnetwork.php?network=BRANDMEISTER'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-fire" aria-hidden="true"></span>&nbsp;<?php echo _("BrandMeister"); ?></button>
<?php
}
}
checkSetup();
// Here you can feel free to disable info-sections by commenting out with // before include
Expand Down
8 changes: 8 additions & 0 deletions locale/da_DK/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -720,3 +720,11 @@ msgstr "YSFGateway er ikke startet"
#: include/functions.php:830
msgid "DMRIDs.dat not correct!"
msgstr "DMRIDs.dat er ikke rigtigt"

#: index.php:78
msgid "Configuration"
msgstr ""

#: setup.php:209
msgid "Use networks.php instead of configuration below"
msgstr ""
Binary file modified locale/de_DE/LC_MESSAGES/messages.mo
Binary file not shown.
8 changes: 8 additions & 0 deletions locale/de_DE/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -717,3 +717,11 @@ msgstr "YSFGateway läuft nicht"
#: include/functions.php:830
msgid "DMRIDs.dat not correct!"
msgstr "DMRIDs.dat nicht korrekt!"

#: index.php:78
msgid "Configuration"
msgstr "Konfiguration"

#: setup.php:209
msgid "Use networks.php instead of configuration below"
msgstr "Nutze networks.php statt d. Konfig. unten"
Loading

0 comments on commit 07c1d86

Please sign in to comment.