fixing message in switching networks, show network-logos instead of single logo, if wanted in setup.php. Simply define DMRplus and BrandMeister-Logo instead of logo to get it working

This commit is contained in:
dg9vh 2016-11-07 08:23:05 +01:00
parent 769cd5bbf8
commit e95a0c7392
5 changed files with 30 additions and 4 deletions

View file

@ -51,6 +51,13 @@ function getDMRNetwork() {
return $network; return $network;
} }
function getDMRNetwork2() {
$fp = fopen('../config/DMRNetwork.txt', 'r');
$network = fread($fp, filesize("../config/DMRNetwork.txt"));
fclose($fp);
return $network;
}
function getDMRMasterState() { function getDMRMasterState() {
$logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log"; $logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
$logLines = explode("\n", `egrep -h "(DMR, Logged into the master successfully)|(DMR, Closing DMR Network)" $logPath`); $logLines = explode("\n", `egrep -h "(DMR, Logged into the master successfully)|(DMR, Closing DMR Network)" $logPath`);

View file

@ -53,9 +53,20 @@ include "version.php";
} }
?></h4> ?></h4>
<?php <?php
if (LOGO !== "") { $logourl = "";
if (getDMRNetwork() == "BrandMeister") {
$logourl = BRANDMEISTERLOGO;
}
if (getDMRNetwork() == "DMRplus") {
$logourl = DMRPLUSLOGO;
}
if ($logourl == "") {
$logourl = LOGO;
}
if ($logourl !== "") {
?> ?>
<div id="Logo" style="position:absolute;top:-43px;right:10px;"><img src="<?php echo LOGO ?>" width="250px" style="width:250px; border-radius:10px;box-shadow:2px 2px 2px #808080; padding:1px;background:#FFFFFF;border:1px solid #808080;" border="0" hspace="10" vspace="10" align="absmiddle"></div> <div id="Logo" style="position:absolute;top:-43px;right:10px;"><img src="<?php echo $logourl ?>" width="250px" style="width:250px; border-radius:10px;box-shadow:2px 2px 2px #808080; padding:1px;background:#FFFFFF;border:1px solid #808080;" border="0" hspace="10" vspace="10" align="absmiddle"></div>
<?php <?php
} }
?> ?>

View file

@ -70,7 +70,7 @@ if ($_GET['network'] == "BRANDMEISTER") {
// exec( "sudo killall MMDVMHost && sudo ".MMDVMHOSTPATH."/MMDVMHost ".MMDVMINIPATH."/".MMDVMINIFILENAME." &" ); // exec( "sudo killall MMDVMHost && sudo ".MMDVMHOSTPATH."/MMDVMHost ".MMDVMINIPATH."/".MMDVMINIFILENAME." &" );
} }
?> ?>
<div class="alert alert-info" role="alert">Switching network to <b><?php echo getDMRNetwork() ?></b><br>Restarting in new selected network in progress</div> <div class="alert alert-info" role="alert">Switching network to <b><?php echo getDMRNetwork2() ?></b><br>Restarting in new selected network in progress</div>
<div class="panel panel-info"> <div class="panel panel-info">

View file

@ -185,6 +185,14 @@ get_tz_options(constant("TIMEZONE"), "Timezone", '');
<span class="input-group-addon" id="LOGO" style="width: 300px">URL to Logo</span> <span class="input-group-addon" id="LOGO" style="width: 300px">URL to Logo</span>
<input type="text" value="<?php echo constant("LOGO") ?>" name="LOGO" class="form-control" placeholder="http://your-logo" aria-describedby="LOGO"> <input type="text" value="<?php echo constant("LOGO") ?>" name="LOGO" class="form-control" placeholder="http://your-logo" aria-describedby="LOGO">
</div> </div>
<div class="input-group">
<span class="input-group-addon" id="DMRPLUSLOGO" style="width: 300px">URL to DMRplus-Logo</span>
<input type="text" value="<?php echo constant("DMRPLUSLOGO") ?>" name="DMRPLUSLOGO" class="form-control" placeholder="http://your-logo" aria-describedby="DMRPLUSLOGO">
</div>
<div class="input-group">
<span class="input-group-addon" id="BRANDMEISTERLOGO" style="width: 300px">URL to BrandMeister-Logo</span>
<input type="text" value="<?php echo constant("BRANDMEISTERLOGO") ?>" name="BRANDMEISTERLOGO" class="form-control" placeholder="http://your-logo" aria-describedby="BRANDMEISTERLOGO">
</div>
<div class="input-group"> <div class="input-group">
<span class="input-group-addon" id="REFRESHAFTER" style="width: 300px">Refresh page after in seconds</span> <span class="input-group-addon" id="REFRESHAFTER" style="width: 300px">Refresh page after in seconds</span>
<input type="text" value="<?php echo constant("REFRESHAFTER") ?>" name="REFRESHAFTER" class="form-control" placeholder="60" aria-describedby="REFRESHAFTER" required data-fv-notempty-message="Value is required"> <input type="text" value="<?php echo constant("REFRESHAFTER") ?>" name="REFRESHAFTER" class="form-control" placeholder="60" aria-describedby="REFRESHAFTER" required data-fv-notempty-message="Value is required">

View file

@ -1,3 +1,3 @@
<?php <?php
define("VERSION", "20161104-1"); define("VERSION", "20161107-1");
?> ?>