Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
Custom Actions in Dokuwiki
delegating the "do"-parameter to a special plugin
Avatar
3AtÜ #1
Member since Mar 2007 · 29 posts
Group memberships: Members
Show profile · Link to this post
Subject: Custom Actions in Dokuwiki
Hi,
I wondered if there is an elegant possibility to handle a special do-parameter with an plugin and provide some parameters with it. I saw, that Esther is doing something similar in her form-plugin, but is there another way?

I have a small form, or even buttons embedded in a page, which trigger an event and provide some extra data to handle by a function on the server.

Hhm, should I register an action plugin to the "ACTION_ACT_PREPROCESS" event and ask in the handler-function for extra $_GET or $_POST data so that I noticed, if one of the wanted buttons is clicked? But wouldn't that slow down Dokuwiki if I have -- maybe -- 10-20 such custom events?

Thank You
chi #2
Member since Jun 2006 · 1851 posts · Location: Munich Germany
Group memberships: Members, Super Mods, Wiki Managers
Show profile · Link to this post
Quote by 3AtÜ:
Hhm, should I register an action plugin to the "ACTION_ACT_PREPROCESS" event and ask in the handler-function for extra $_GET or $_POST data so that I noticed, if one of the wanted buttons is clicked?

Yes, I think that`s the right way to go (you could pass your action as "do" parameter, that`s how DokuWiki does it) and check in your action plugin if your action is triggered (the discussion plugin by Esther is also a good example).

Quote by 3AtÜ:
But wouldn't that slow down Dokuwiki if I have -- maybe -- 10-20 such custom events?

I think that`s heavily depended on what your custom actions actually do.
Please add [SOLVED] to the initial thread subject if you feel your question has been answered.
If my answer doesn't make sense maybe your question didn't either - just visit http://facepalm.org.
Avatar
esther #3
User title: Esther Brunner
Member since May 2006 · 60 posts · Location: Winterthur, Switzerland
Group memberships: Members
Show profile · Link to this post
Yes, I think that`s the right way to go (you could pass your action as "do" parameter, that`s how DokuWiki does it) and check in your action plugin if your action is triggered (the discussion plugin by Esther is also a good example).

The Discussion Plugin uses both methods:

  * to create a new thread page, I use "do=newthread" and handle "ACTION_ACT_PREPROCESS".
  * for comment actions, I handle "TPL_ACT_RENDER" and use a custom "comment=" parameter to show, edit, save, etc. comments.

Find out yourself witch way fits your needs better.

-- esther
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-05-23, 05:18:49 (UTC +02:00)