41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Utilisations de pipelines par GamuTable
|
|
*
|
|
* @plugin GamuTable
|
|
* @copyright 2020
|
|
* @author tofulm
|
|
* @licence GNU/GPL
|
|
* @package SPIP\Gamutable\Pipelines
|
|
*/
|
|
|
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
|
return;
|
|
}
|
|
|
|
function gamutable_formulaire_admin($flux) {
|
|
include_spip('inc/autoriser');
|
|
if (autoriser("purger","gamutable")) {
|
|
$btn = recuperer_fond('inclure/calculer_gamutable');
|
|
$flux['data'] = preg_replace('%(<!--extra-->)%is', $btn.'$1', $flux['data']);
|
|
}
|
|
|
|
return $flux;
|
|
}
|
|
|
|
|
|
function gamutable_affichage_final($flux) {
|
|
include_spip('inc/autoriser');
|
|
if (autoriser("purger","gamutable") and test_plugin_actif('minibando')) {
|
|
$p = stripos($flux, '</body>');
|
|
if ($p) {
|
|
$url_relecture = parametre_url(self(), 'var_mode', 'gamutable', '&');
|
|
$label = "Mode gamuTable";
|
|
$js = "jQuery('#minibando_bouton_debug ul').append('<li><a class=\"spip-admin-boutons \" href=\"$url_relecture\">$label</a></li>');";
|
|
$js = "jQuery(function(){ $js });";
|
|
$js = "<script>$js</script>";
|
|
$flux = substr_replace($flux, $js, $p, 0);
|
|
}
|
|
}
|
|
return $flux;
|
|
}
|