wip: ajout possibilite vidanger le localstorage

This commit is contained in:
Christophe 2025-03-31 15:32:20 +02:00
parent 144aff6164
commit 2c7c5c8f4b
2 changed files with 16 additions and 0 deletions

View file

@ -118,3 +118,13 @@ function gamutable_recharger_tableau($id_objet = 9999999999, $num = null):string
EOJS;
return $html;
}
function gamutable_vider_localstorage():int {
$version_prod = (int) lire_config('gamutable/version_stockage', 1);
$version_demandee = (int) ($GLOBALS['gamutable_version_stockage'] ?? 1);
if ($version_demandee > $version_prod) {
ecrire_config('gamutable/version_stockage', $version_demandee);
return 1;
}
return 0;
}

View file

@ -25,6 +25,9 @@
[(#ENV{fichierVueBloc}|oui)
[(#SET{htmlvuebloc,#INCLURE{fond=#ENV{fichierVueBloc}}|replace{'"',"'"}})]
]
#SET{vider_localstorage,#NULL|gamutable_vider_localstorage}
<div id="vueGamutable">
<BOUCLE_un(CONDITION){si #ENV{apiuri}|oui}>
<div class="container_un">
@ -53,6 +56,7 @@
trier="[(#ENV{trier})]"
langpdf="[(#ENV{langpdf})]"
:id_auteur="[(#SESSION{id_auteur}|intval)]"
:vider_localstorage="#GET{vider_localstorage}"
></gamu-table>
</div>
</div>
@ -90,6 +94,7 @@
trier="[(#ENV{trier_deux})]"
langpdf="[(#ENV{langpdf})]"
:id_auteur="[(#SESSION{id_auteur}|intval)]"
:vider_localstorage="#GET{vider_localstorage}"
></gamu-table>
</div>
</div>
@ -102,6 +107,7 @@
<script src="[(#CHEMIN{js/localforage.min.js}|timestamp)]" type="text/javascript"></script>
[(#CONFIG{gamutable/charger_modalbox}|=={oui}|oui)
<script src="[(#CHEMIN{js/gamubox.js}|timestamp)]" type="text/javascript"></script>
]