gamutable/gamutable_fonctions.php
tofulm 8ba264d69b pour les pdfs, on passe par une action afin de pouvoir avoir tous les
cas possibles. Le gros problème a été de gérer la génération du pdf et
surtout son telechargement.
la solution :
- le fichier action cree le pdf et le place dans
  IMG/gamutable_pdf/xxxxxxxxxx.mdf (nom du fichier hashé)
- on ajoute un cron dans 20 secondes pour supprimer ce fichier
- TODO, mainteannt jouer avec l'action !
2022-09-27 15:01:52 +02:00

59 lines
1.1 KiB
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) {
if (typeof app !== 'undefined') {
app.rechargerJson(id);
}
$.modalboxclose();
}
if (id === 9999999999) {
if (typeof app !== 'undefined') {
app.rechargerJson();
}
$.modalboxclose();
}
delete id;
</script>
EOJS;
return $html;
}
function gamutable_recharger_tableau($id_objet = 9999999999){
$html = <<<EOJS
<script type="text/javascript">
id = "$id_objet";
id = parseInt(id);
if (id > 0 && id < 9999999999) {
if (typeof app !== 'undefined') {
app.rechargerJson(id);
}
}
if (id === 9999999999) {
if (typeof app !== 'undefined') {
app.rechargerJson();
}
}
delete id;
</script>
EOJS;
return $html;
}