| ||||||||||
Navigation Home Page
Click here to expand or collapse... Every You, Every Me (Youtube release)
Upcoming BL Series (Start date) Click here to expand or collapse... Top Form (Thu 20 Mar 2025)
Click here to expand or collapse... Art Of Love (OFFLINE)
Beautiful Scars (Episode 4 finale OFFLINE)
Boyband (No International release)
Friend Forever/Our Love Is Sick (OFFLINE)
Great Men Academy (OFFLINE)
Healing Thingyan (OFFLINE)
Hehe & He (Season 3 - on hiatus)
Hook Up (Season 2) (OFFLINE)
If I Love A Boy (OFFLINE)
Indigo (OFFLINE)
Jack And Jill (OFFLINE)
Lakan (OFFLINE)
Make A Wish [Philippines] (OFFLINE)
Make A Wish [Thailand] (No International release)
Missing Piece (OFFLINE)
My Secret Love (OFFLINE)
Quaranthings (OFFLINE)
Roommate (Season 1 OFFLINE)
Sugar Dog Life (No International release)
Truly Very Yours (Season 1) (OFFLINE)
Unguarded (Season 3) (OFFLINE)
Venus In The Sky (Youtube release)
Click here to expand or collapse...Click here to expand or collapse... Destined/Fated (OFFLINE)
Infinity (OFFLINE)
Kiss The Night (OFFLINE)
Overlooked Love (OFFLINE)
The Next Door Crush (OFFLINE)
The Whisperer (EP10 Finale never released)
Unexpected (OFFLINE)
Click here to expand or collapse... = Cambodia = China = Hong Kong = India |
Custom Actionsadministrators (intermediate) With cookbook recipes, it is possible to define custom page actions for PmWiki. The correspondent code is executed whenever a parameter [[MyGroup/MyPage ?action=myaction]]
With such an action, you can alter the display and treatment of the current page - like in standard actions as Whereas a Custom Markup is primarily intended to generate a meaningful text replacement on the current page, a page action is triggered by a url parameter and thus can be used in links as a call to a PHP function, acting on the current page or wiki wide, for instance like:
However, if you want to use PmWiki's built-in functions for custom actions you have to be aware of the fact that cookbook recipes are included in The following example shows how to set up a custom action $HandleActions['myaction'] = 'HandleMyAction'; # if url contains action=myaction call HandleMyAction timely $HandleAuth['myaction'] = 'admin'; # authorization level $auth for HandleMyAction function HandleMyAction($pagename, $auth) { # parameters (signature) of handler function required by PmWiki global $Author; # get hold of current author name, e.g. for page history $old = RetrieveAuthPage('MyGroup.MyOtherPage', $auth); # get all information from page MyGroup.MyOtherPage $new = $old; # copy the page information to stay (e.g. page history) $new['text'] = "x".$old['text']; # ... some manipulation of the old wiki mark-up $Author='myactionbot'; # author name to appear in the page history for this manipulation $pn='MyGroup.MyOtherPage'; # need to call UpdatePage with variables (by reference) only UpdatePage($pn,$old,$new); # alter the actual wiki page HandleBrowse($pagename); # display the page specified in the url (e.g. MyGroup.MyPage) } Notes:
Category: PmWiki Developer
This page may have a more recent version on pmwiki.org: PmWiki:CustomActions, and a talk page: PmWiki:CustomActions-Talk. | |||||||||
View
Edit
History
Attach
Print
Page last modified on August 19, 2022, at 03:25 PM |