DokuWiki

It's better when it's simple

用户工具

站点工具


侧边栏

翻译跟原始页面比较起来显得有些陈旧,所以可能失效。 查看更新
本页面的其他翻译?:

了解DokuWiki

进阶使用

商用

我们的社区


Facebook, Twitter 或其他社交网络上关注我们.

zh:devel:event:action_act_preprocess

ACTION_ACT_PREPROCESS

Description:
处理 ?do= actions
DefaultAction:
Dokuwiki's own processing of the $ACT value
Preventable:
yes
Added:
2006-04-25

This event allows you to catch any action mode passed to the DokuWiki dispatcher act_dispatch() in inc/actions.php before it begins to process the $ACT variable itself.

The AFTER action is never performed on a successful save.

Passed Data

The passed Doku_Event has the field $data.

$data is a string or array containing the $ACT value (the do variable in the query string - uncleaned). See act_clean() for an example of cleaning.

Add a BEFORE event handler to process your action. Check the $data field for the correct action name. Also use an unique action name to avoid collisions.

Use preventDefault() to skip DokuWiki's processing of the action. $data is a reference to the $ACT variable, so assigning another action string to the $data field will be noticed outside your event handler.

The AFTER event handler lets you handle actions after performing DokuWiki's default action handling (attention: can be eventually skipped by preventDefault()) . Due to handling of actions by plugins and DokuWiki itself the AFTER event handler can be reached with another action than you expect at first sight. Please be aware it.

Plugins handling this event

The following plugins are known to handle this event and their source code may be a good start for understanding and implementing a handler yourself.

See also

zh/devel/event/action_act_preprocess.txt · 最后更改: 2017-08-15 04:36 由 223.74.246.91