X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=docs%2Fhooks.txt;h=6f76b5c4ed5084fe13e56f9156ca5f7ef8ecb4c9;hb=0104fa1f0c2782a5463cf3feb43b773d1e0e4e57;hp=ab7ccdc8997c53346b655d481f83975312bcbf50;hpb=58f01b0645d5e7801a2bbf9b19ef93887dd8109b;p=lhc%2Fweb%2Fwiklou.git diff --git a/docs/hooks.txt b/docs/hooks.txt index ab7ccdc899..6f76b5c4ed 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -281,6 +281,28 @@ $EditPage : the EditPage object $text : the new text of the article (has yet to be saved) $resultArr : data in this array will be added to the API result +'APIQueryInfoTokens': use this hook to add custom tokens to prop=info. +Every token has an action, which will be used in the intoken parameter +and in the output (actiontoken="..."), and a callback function which +should return the token, or false if the user isn't allowed to obtain +it. The prototype of the callback function is func($pageid, $title) +where $pageid is the page ID of the page the token is requested for +and $title is the associated Title object. In the hook, just add +your callback to the $tokenFunctions array and return true (returning +false makes no sense) +$tokenFunctions: array(action => callback) + +'APIQueryRevisionsTokens': use this hook to add custom tokens to prop=revisions. +Every token has an action, which will be used in the rvtoken parameter +and in the output (actiontoken="..."), and a callback function which +should return the token, or false if the user isn't allowed to obtain +it. The prototype of the callback function is func($pageid, $title, $rev) +where $pageid is the page ID of the page associated to the revision the +token is requested for, $title the associated Title object and $rev the +associated Revision object. In the hook, just add your callback to the +$tokenFunctions array and return true (returning false makes no sense) +$tokenFunctions: array(action => callback) + 'ArticleAfterFetchContent': after fetching content of an article from the database $article: the article (object) being loaded from the database $content: the content (string) of the article