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
This commit is contained in:
parent
f08682bed9
commit
f8850765de
1 changed files with 13 additions and 0 deletions
|
@ -12,3 +12,16 @@
|
||||||
if (!defined('_ECRIRE_INC_VERSION')) {
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
return;
|
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);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue