Limitations of the API for dynamic tags
Fil asked me to post a ticket about http://passingcuriosity.com/2009/dynamic-tags-fake-arguments-ast-mangling-in-spip/.
I'm trying to pass information from the Champ object $p given to balise_MY_TAG() to balise_MY_TAG_stat(). The only way I can see to pass information like this is to add a new Texte object to $p->param. If this is the correct technique, I think that SPIP should include a function to "add a new parameter to an AST object".
If this is not the correct way to pass information into the balise_stat() and balise_dyn() functions, then I think that calculer_balise_dynamique() needs to take an array of "extra data" as a fourth parameter.
I've attached a patch that makes this change. The patch did what I expect it to, but I haven't tested it too much -- I'm not familiar enough with SPIP's internals to tell what it could break.