38 lines
808 B
PHP
38 lines
808 B
PHP
<?php
|
|
/**
|
|
* Utilisations de pipelines par GamuForm
|
|
*
|
|
* @plugin GamuForm
|
|
* @copyright 2020
|
|
* @author tofulm
|
|
* @licence GNU/GPL
|
|
* @package SPIP\GamuForm\Pipelines
|
|
*/
|
|
|
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
|
return;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Optimiser la base de données
|
|
*
|
|
* Supprime les liens orphelins de l'objet vers quelqu'un et de quelqu'un vers l'objet.
|
|
* Supprime les objets à la poubelle.
|
|
*
|
|
* @pipeline optimiser_base_disparus
|
|
* @param array $flux Données du pipeline
|
|
* @return array Données du pipeline
|
|
*/
|
|
function GamuForm_optimiser_base_disparus($flux) {
|
|
|
|
include_spip('action/editer_liens');
|
|
$flux['data'] += objet_optimiser_liens(array('gamuform'=>'*'), '*');
|
|
|
|
sql_delete('spip_gamuforms', "statut='poubelle' AND maj < " . $flux['args']['date']);
|
|
|
|
return $flux;
|
|
}
|