popup message
This commit is contained in:
@@ -60,4 +60,4 @@ require_once(__DIR__ . '/../../languages/en/general.php');
|
|||||||
|
|
||||||
//include("generalsettings.php");
|
//include("generalsettings.php");
|
||||||
require_once __DIR__ . '/permissions_helper.php';
|
require_once __DIR__ . '/permissions_helper.php';
|
||||||
?>
|
require_once(__DIR__ . '/popup-moved.php');
|
||||||
|
|||||||
@@ -0,0 +1,158 @@
|
|||||||
|
<?php
|
||||||
|
// popup-moved.php — Avviso di trasferimento webapp
|
||||||
|
// Attivo solo se nel .env: POPUP_MOVED_ENABLED=true
|
||||||
|
|
||||||
|
// --- Trova il .env risalendo le cartelle ---
|
||||||
|
$envPath = null;
|
||||||
|
$dir = __DIR__;
|
||||||
|
for ($i = 0; $i < 6; $i++) {
|
||||||
|
if (is_readable($dir . '/.env')) {
|
||||||
|
$envPath = $dir . '/.env';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$dir = dirname($dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
$enabled = false;
|
||||||
|
$url = 'https://zibo-gestionale.cesoft.io/';
|
||||||
|
|
||||||
|
if ($envPath !== null) {
|
||||||
|
foreach (file($envPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) as $line) {
|
||||||
|
$line = trim($line);
|
||||||
|
if ($line === '' || $line[0] === '#' || strpos($line, '=') === false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
list($k, $v) = explode('=', $line, 2);
|
||||||
|
$k = trim($k);
|
||||||
|
$v = trim($v, " \t\"'");
|
||||||
|
if ($k === 'POPUP_MOVED_ENABLED') {
|
||||||
|
$enabled = in_array(strtolower($v), ['true', '1', 'on', 'yes'], true);
|
||||||
|
}
|
||||||
|
if ($k === 'POPUP_MOVED_URL' && $v !== '') {
|
||||||
|
$url = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- Se disattivato, esci subito senza stampare nulla ---
|
||||||
|
if (!$enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$urlSafe = htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
|
||||||
|
?>
|
||||||
|
<style>
|
||||||
|
#zibo-moved-overlay {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
background: rgba(15, 23, 42, .72);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 99999;
|
||||||
|
font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
|
||||||
|
backdrop-filter: blur(3px);
|
||||||
|
}
|
||||||
|
|
||||||
|
#zibo-moved-box {
|
||||||
|
background: #fff;
|
||||||
|
max-width: 460px;
|
||||||
|
width: calc(100% - 40px);
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 36px 32px;
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
|
||||||
|
animation: ziboIn .25s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes ziboIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(12px)
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: none
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#zibo-moved-box .zibo-ico {
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
margin: 0 auto 18px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #eef4ff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#zibo-moved-box h2 {
|
||||||
|
margin: 0 0 10px;
|
||||||
|
font-size: 22px;
|
||||||
|
color: #0f172a;
|
||||||
|
}
|
||||||
|
|
||||||
|
#zibo-moved-box p {
|
||||||
|
margin: 0 0 8px;
|
||||||
|
color: #475569;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
#zibo-moved-box .zibo-url {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 6px 0 22px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #2563eb;
|
||||||
|
word-break: break-all;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#zibo-moved-box .zibo-btn-go {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
background: #2563eb;
|
||||||
|
color: #fff;
|
||||||
|
border: none;
|
||||||
|
padding: 14px;
|
||||||
|
border-radius: 10px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: background .15s;
|
||||||
|
}
|
||||||
|
|
||||||
|
#zibo-moved-box .zibo-btn-go:hover {
|
||||||
|
background: #1d4ed8;
|
||||||
|
}
|
||||||
|
|
||||||
|
#zibo-moved-box .zibo-stay {
|
||||||
|
margin-top: 14px;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
color: #94a3b8;
|
||||||
|
font-size: 13px;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#zibo-moved-box .zibo-stay:hover {
|
||||||
|
color: #64748b;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div id="zibo-moved-overlay">
|
||||||
|
<div id="zibo-moved-box">
|
||||||
|
<div class="zibo-ico">🚀</div>
|
||||||
|
<h2>La webapp è stata spostata</h2>
|
||||||
|
<p>L'applicazione è ora disponibile al nuovo indirizzo ufficiale:</p>
|
||||||
|
<a class="zibo-url" href="<?php echo $urlSafe; ?>"><?php echo $urlSafe; ?></a>
|
||||||
|
<a class="zibo-btn-go" href="<?php echo $urlSafe; ?>">Vai al nuovo sito</a>
|
||||||
|
<button class="zibo-stay" onclick="document.getElementById('zibo-moved-overlay').style.display='none'">
|
||||||
|
Resta su questo sito (sconsigliato — non è più aggiornato)
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user