From ce79b69c6fa694c8ed8429d60a0b6c79fa4e5a98 Mon Sep 17 00:00:00 2001 From: Tcharp38 Date: Fri, 8 Dec 2023 14:51:06 +0100 Subject: [PATCH] Network layout: using default image if user one no longer exists --- desktop/php/AbeilleNetworkMap.php | 10 ++++++++++ docs/fr_FR/Changelog.rst | 1 + 2 files changed, 11 insertions(+) diff --git a/desktop/php/AbeilleNetworkMap.php b/desktop/php/AbeilleNetworkMap.php index f079964b4f..5fdc8a4de0 100644 --- a/desktop/php/AbeilleNetworkMap.php +++ b/desktop/php/AbeilleNetworkMap.php @@ -56,6 +56,16 @@ 'mapFile' => 'AbeilleNetworkMap-1200.png' ); } + // Checking that image exists + foreach ($networkMap['levels'] as $levIdx => $lev) { + $path = __DIR__.'/'; + $path .= (isset($lev['mapDir']) ? $lev['mapDir'] : 'images'); + $path .= (isset($lev['mapFile']) ? $lev['mapFile'] : 'AbeilleNetworkMap-1200.png'); + if (!file_exists($path)) { + $networkMap['levels'][$levIdx]['mapDir'] = 'images'; + $networkMap['levels'][$levIdx]['mapFile'] = 'AbeilleNetworkMap-1200.png'; + } + } if (isset($nm['levelChoice'])) $networkMap['levelChoice'] = $nm['levelChoice']; else diff --git a/docs/fr_FR/Changelog.rst b/docs/fr_FR/Changelog.rst index e36db5e5c4..50b1dc2f46 100644 --- a/docs/fr_FR/Changelog.rst +++ b/docs/fr_FR/Changelog.rst @@ -3,6 +3,7 @@ ChangeLog - Interne: Mise-à-jour powerCycleUsb pour récuperer sortie 'dmesg' si erreur. - Interne: AbeilleCmd: Pas de ACK sur requete LQI vers Zigate. +- Placement réseau: Utilisation image par défaut si plan n'existe plus. 231207-BETA-2 -------------