bigform/bigform_options.php
tofulm f8850765de Surcharge de #URL_DOCUMENT : si le document à son champ protected à oui,
l'url est de la forme : spip.php?action=charger_document&id_document=542
2020-03-21 09:01:22 +01:00

27 lines
632 B
PHP

<?php
/**
* Options au chargement du plugin BigForm
*
* @plugin BigForm
* @copyright 2019
* @author tofulm
* @licence GNU/GPL
* @package SPIP\Bigform\Options
*/
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
// https://code.spip.net/@urls_propres2_dist
function urls_propres2($i, &$entite, $args = '', $ancre = '') {
if ($entite === 'document' and intval($i)) {
if (sql_countsel('spip_documents',['id_document='.$i, 'protected="oui"'])) {
return generer_url_action('charger_document','id_document='.$i);
}
}
$f = charger_fonction('propres', 'urls');
return $f($i, $entite, $args, $ancre);
}