Liens entre objets et passage de paramè tres (critère de filtre)

nicod_ <[email protected]>
Newsgroups gmane.comp.web.spip.devel
Message-ID <[email protected]>
Yop,

j'utilise des liens entre objets depuis le pipeline affiche_milieu, avec 
un classique :

recuperer_fond('prive/objets/editer/liens', array(
   'table_source' => 'patate',
   'objet' => $e['type'],
   'lien' => 'patate',
   'id_objet' => $flux['args'][$e['id_table_objet']]
));

Ça va donc chercher un squelette patates_associer.html qui liste les 
objets associables.

Mais j'aimerais y passer un critère pour filtrer la liste, un type par 
exemple :

recuperer_fond('prive/objets/editer/liens', array(
  (...)
   'type' => 'machin'
));

Mais ça ne passe pas jusqu'au bout (dans patates_associer.html) parce 
que prive/objets/editer/liens.html ne passe pas l'env qu'il reçoit :
https://git.spip.net/spip/spip/src/branch/master/prive/objets/editer/liens.html#L3

alors que prive/objets/editer/liens.php est bien sensé récupérer un 
tableau d'options, lui :
https://git.spip.net/spip/spip/src/branch/master/prive/formulaires/editer_liens.php#L80
et le retourner :
https://git.spip.net/spip/spip/src/branch/master/prive/formulaires/editer_liens.php#L153

Du coup, j'ai fait une surcharge de prive/objets/editer/liens.html de 
mon côté, avec :

#FORMULAIRE_EDITER_LIENS{#ENV{table_source},#ENV{objet},#ENV{id_objet},#ENV**|unserialize}
au lieu de
#FORMULAIRE_EDITER_LIENS{#ENV{table_source},#ENV{objet},#ENV{id_objet},#ENV{editable}|=={non}|?{'',' 
'}}

Qu'en pensez vous ?

Il y aurait une autre méthode ?


-- 
nicod_
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.