Samuel,
I believe you could have a look at hooks, and in particular at ArticleSave.
You could write a hook function that would take the values from checkboxes
(or any input) that you will find in $wgRequest->myvalue and amend the $text
parameter which is the new content of the article that is about to be saved.
You'll find info about hooks in the source code under docs/hooks.txt or
here:
http://www.mediawiki.org/wiki/Manual:Hooks
and for ArticleSave:
http://www.mediawiki.org/wiki/Manual:Hooks/ArticleSave
Put all that code (the hook declaration and function) in a separate file.php
and include it from your LocalSettings.php for instance (or from your
extension if that's the way you're going).
From your message, it looks like you're modifying
the code in EditPage.php,
which is probably not a good idea, since it will get
overwritten when you
upgrade your mediawiki install. Use hooks instead, they're great!
Post back if this isn't clear (or if it doesn't work).
hope this helps,
Laurent
On 28 May 2010 11:12, Samuel Marchand <sammarch(a)hotmail.fr> wrote:
Hello,
I’m currently working on a internal wiki for a company. They need it to
report problems about pieces. To sort more easily the reports, I have to
categorize them by client, tools, etc…
To help the employees about adding those categories, I’d like to add some
fields which they would complete and which will add automatically the code
“[[category: nameOfTheCat]]” at the end of the article.
I already have found the way to add the fields in EditPage.php, but I
couldn’t find how to implement the script on page’s submission. I there any
function I didn’t see ? Could someone explain me how to add this script ? I
probably misunderstood something about how “addHTML( Xml::…” works.
Regards,
Samuel Marchand
<http://clk.atdmt.com/FRM/go/229960614/direct/01/>
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l