gamutable/gamutable_fonctions.php
tofulm 9da7817029 Amélioration retour formulaire, 2 possibilités
1. Methode 1, la plus simple, seulement le php
- $retours['message_ok'] = gamutable_fermer_modalbox();
2. Methode 2, on modifie le php et le html
- php => $retours['message_ok'] = $id_objet;
- html => <INCLURE{fond=inclure/redirect_form,env}>
2021-03-14 10:31:27 +01:00

33 lines
614 B
PHP

<?php
/**
* Fonctions utiles au plugin GamuTable
*
* @plugin GamuTable
* @copyright 2020
* @author tofulm
* @licence GNU/GPL
* @package SPIP\Gamutable\Fonctions
*/
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
function gamutable_fermer_modalbox($id_objet = 9999999999){
$html = <<<EOJS
<script type="text/javascript">
id = "$id_objet";
id = parseInt(id);
if (id > 0 && id < 9999999999) {
app.rechargerJson(id);
$.modalboxclose();
}
if (id === 9999999999) {
app.rechargerJson();
$.modalboxclose();
}
delete id;
</script>
EOJS;
return $html;
}