[dokuwiki] Re: Is an Action plugin convenient for my goal?

  • From: Myron Turner <turnermm02@xxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 08 Apr 2010 10:11:38 -0500

lilive wrote:
Hi,
I've got no answers. Perhaps my English is really horrible. So I try again a last time, with shorts sentences. Thank you for your comprehension. It's just because I'm stuck.

So:

- I want to make a new button: "Announce this page"
- This button must be displayed in "show" mode only for the creator of the page, and for the administrators.
- Pressing this button, a html form must be displayed
- In this form, there is a text area
- The author write in this text area a presentation text for his page. He can use the dokuwiki syntax.
- The author press the submit button
- The presentation text, the title of the page, the author, are added in a custom RSS feed (or any XML document). This XML will handle the new pages presentations. - A new post is created in a IP.board Forum, with this same presentation text.

I don't know how to do that. I think I have to create a new dokuwiki mode, like "show", "edit", ...
Am I wrong?
Perhaps an action plugin can do it, but I can't figure how to do.

Thank you very much for any help,

Olivier.


It doesn't seem to me that this needs a plugin.
To begin with, the first part of your project is simple enough. You can add a button to the page for certain users by checking the global $USERINFO array:

   http://www.dokuwiki.org/devel:environment#global_variables

You can create a button that looks like DW's buttons--just check your browser's view source for the HTML. In your main.php, you can create a hidden or non-displayed DIV that holds the Form. Click the button to open the form; place a close link on the form to close it.

Your form could then make an Ajax call to a php script on the server which does the work in your RSS or XML. Dokuwiki has built in support for Ajax. See:

http://www.dokuwiki.org/devel:javascript?s[]=tw&s[]=sack#sack_Ajax_library

Google tw-sack if you are not familiar with with the sack library. The tw-sack package comes with easy to use examples.





--
Myron Turner
http://mturner.org/
http://mturner.org/fckgLite
http://www.mturner.org/dwfck/doku.php
http://www.room535.org


--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: