Fix. Display modules form if FS does not start.

This commit is contained in:
Alexey Melnichuk 2016-01-22 13:05:13 +03:00
parent 9d5c1314bf
commit 36741f96cc
2 changed files with 68 additions and 9 deletions

View File

@ -44,6 +44,28 @@ $text['label-unload_module']['uk'] = "Вивантажити модуль";
$text['label-unload_module']['sv-se'] = "Ladda av Modul";
$text['label-unload_module']['de-at'] = "Modul deaktivieren";
$text['label-unknown']['en-us'] = "Unknown";
$text['label-unknown']['es-cl'] = "";
$text['label-unknown']['pt-pt'] = "";
$text['label-unknown']['fr-fr'] = "";
$text['label-unknown']['pt-br'] = "";
$text['label-unknown']['he'] = "";
$text['label-unknown']['pl'] = "";
$text['label-unknown']['uk'] = "";
$text['label-unknown']['sv-se'] = "";
$text['label-unknown']['de-at'] = "";
$text['label-none']['en-us'] = "None";
$text['label-none']['es-cl'] = "";
$text['label-none']['pt-pt'] = "";
$text['label-none']['fr-fr'] = "";
$text['label-none']['pt-br'] = "";
$text['label-none']['he'] = "";
$text['label-none']['pl'] = "";
$text['label-none']['uk'] = "";
$text['label-none']['sv-se'] = "";
$text['label-none']['de-at'] = "";
$text['label-stopped']['en-us'] = "Stopped";
$text['label-stopped']['es-cl'] = "Detenido";
$text['label-stopped']['pt-pt'] = "Parado";
@ -220,4 +242,14 @@ $text['description-modules']['uk'] = "Модулі розширюють можл
$text['description-modules']['sv-se'] = "Moduler utökar funktionerna i systemet. Använd den här sidan för att aktivera eller inaktivera moduler.";
$text['description-modules']['de-at'] = "Module erweitern die Funktionalität des Systems. Benutzen Sie diese Seite um Module zu aktivieren oder zu deaktivieren.";
$text['error-event-socket']['en-us'] = "Connection to Event Socket failed.";
$text['error-event-socket']['es-cl'] = "Conexión a Socket de Eventos fallida.";
$text['error-event-socket']['pt-pt'] = "A ligação ao Event Socket falhou.";
$text['error-event-socket']['fr-fr'] = "Connexion à l'Event Socket en echec.";
$text['error-event-socket']['pt-br'] = "A conexão do evento socket falhou";
$text['error-event-socket']['pl'] = "Połączenie do “Event Socket” nie powiodło się";
$text['error-event-socket']['sv-se'] = "Kontakten till 'Event Socket' misslyckades.";
$text['error-event-socket']['uk'] = "Помилка підключення до сокета подій";
$text['error-event-socket']['de-at'] = "Connection to Event Socket failed.";
?>

View File

@ -67,6 +67,27 @@ if (strlen($_GET["a"]) > 0) {
}
}
$esl_alive = false;
if($fp){
$esl_alive = true;
fclose($fp);
}
//Warning if FS not start
if(!$esl_alive){
$msg = "<div align='center'>".$text['error-event-socket']."<br /></div>";
echo "<div align='center'>\n";
echo "<table width='40%'>\n";
echo "<tr>\n";
echo "<th align='left'>".$text['label-message']."</th>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='row_style1'><strong>$msg</strong></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</div>\n";
}
//use the module class to get the list of modules from the db and add any missing modules
$mod = new modules;
$mod->db = $db;
@ -157,18 +178,24 @@ if (strlen($_GET["a"]) > 0) {
echo $row["module_label"];
}
echo " </td>\n";
if ($mod->active($row["module_name"])) {
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-running']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'><a href='modules.php?a=stop&m=".$row["module_name"]."' alt='".$text['label-stop']."'>".$text['label-stop']."</a></td>\n";
}
else {
if ($row['module_enabled']=="true") {
echo " <td valign='top' class='".$row_style[$c]."'><b>".$text['label-stopped']."</b></td>\n";
if($esl_alive) {
if ($mod->active($row["module_name"])) {
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-running']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'><a href='modules.php?a=stop&m=".$row["module_name"]."' alt='".$text['label-stop']."'>".$text['label-stop']."</a></td>\n";
}
else {
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-stopped']." ".$notice."</td>\n";
if ($row['module_enabled']=="true") {
echo " <td valign='top' class='".$row_style[$c]."'><b>".$text['label-stopped']."</b></td>\n";
}
else {
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-stopped']." ".$notice."</td>\n";
}
echo " <td valign='top' class='".$row_style[$c]."'><a href='modules.php?a=start&m=".$row["module_name"]."' alt='".$text['label-start']."'>".$text['label-start']."</a></td>\n";
}
echo " <td valign='top' class='".$row_style[$c]."'><a href='modules.php?a=start&m=".$row["module_name"]."' alt='".$text['label-start']."'>".$text['label-start']."</a></td>\n";
}
else{
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-unknown']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-none']."</td>\n";
}
echo " <td valign='top' class='".$row_style[$c]."'>";
if ($row["module_enabled"] == "true") {