feat: compat spip 41 qui n'utilise plus la fonction urls_propres mais generer_url_document
C'est un gros plus, car plus besoin d'avoir une réécriture d'url pour que cela fonctionne Normalement, on garde la compat spip < 41
This commit is contained in:
parent
9aec7e9cda
commit
54aa01ddba
2 changed files with 21 additions and 0 deletions
|
@ -13,6 +13,10 @@ if (!defined('_ECRIRE_INC_VERSION')) {
|
|||
return;
|
||||
}
|
||||
|
||||
function urls_generer_url_document($id_document, $args = '', $ancre = '', $public = null, $connect = '') {
|
||||
$f = charger_fonction('bigform_generer_url_document', 'inc');
|
||||
return $f($id_document, $args, $ancre, $public, $connect);
|
||||
}
|
||||
|
||||
// https://code.spip.net/@urls_propres2_dist
|
||||
function urls_propres2($i, &$entite, $args = '', $ancre = '') {
|
||||
|
|
17
inc/bigform_generer_url_document.php
Normal file
17
inc/bigform_generer_url_document.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
if (!defined('_ECRIRE_INC_VERSION')){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function inc_bigform_generer_url_document_dist($id_document, $args = '', $ancre = '', $public = null, $connect = '') {
|
||||
if (sql_countsel('spip_documents',['id_document='.$id_document, 'protected="oui"'])) {
|
||||
//return generer_url_action('charger_document','id_document='.$id_document);
|
||||
include_spip('inc/securiser_action');
|
||||
return securiser_action_auteur('charger_document',$id_document);
|
||||
}
|
||||
|
||||
include_spip('inc/documents');
|
||||
return generer_url_document_dist($id_document, $args, $ancre);
|
||||
}
|
Loading…
Add table
Reference in a new issue