From f8850765defa9f6ede2dcf19d2a7671b7dca5bf1 Mon Sep 17 00:00:00 2001 From: tofulm Date: Sat, 21 Mar 2020 09:01:22 +0100 Subject: [PATCH] =?UTF-8?q?Surcharge=20de=20#URL=5FDOCUMENT=20:=20si=20le?= =?UTF-8?q?=20document=20=C3=A0=20son=20champ=20protected=20=C3=A0=20oui,?= =?UTF-8?q?=20l'url=20est=20de=20la=20forme=20:=20spip.php=3Faction=3Dchar?= =?UTF-8?q?ger=5Fdocument&id=5Fdocument=3D542?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bigform_options.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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); +}