diff --git a/bigform_options.php b/bigform_options.php index e71e776..0624d40 100644 --- a/bigform_options.php +++ b/bigform_options.php @@ -12,3 +12,16 @@ 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); +}