X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=docs%2Fhooks.txt;h=f47890d8da5cc0db5f9185815862b1f12794cc81;hb=6d9bb5d0d5fd09969b1a0889a9267205b88cc7b6;hp=b48067bfa3a060c23ec239b412bd3a25fbe6addd;hpb=0f520f5e1d273c1de827f6ae84b44b1e76ac7330;p=lhc%2Fweb%2Fwiklou.git diff --git a/docs/hooks.txt b/docs/hooks.txt index b48067bfa3..f47890d8da 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -314,7 +314,7 @@ $output: The OutputPage object where output() was called 'AfterImportPage': When a page import is completed. $title: Title under which the revisions were imported -$origTitle: Title provided by the XML file +$foreignTitle: ForeignTitle object based on data provided by the XML file $revCount: Number of revisions in the XML file $sRevCount: Number of successfully imported revisions $pageInfo: associative array of page information @@ -372,6 +372,17 @@ $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 +'ApiFeedContributions::feedItem': Called to convert the result of ContribsPager +into a FeedItem instance that ApiFeedContributions can consume. Implementors of +this hook may cancel the hook to signal that the item is not viewable in the +provided context. +$row: A row of data from ContribsPager. The set of data returned by ContribsPager + can be adjusted by handling the ContribsPager::reallyDoQuery hook. +$context: An IContextSource implementation. +&$feedItem: Set this to a FeedItem instance if the callback can handle the provided + row. This is provided to the hook as a null, if it is non null then another callback + has already handled the hook. + 'ApiFormatHighlight': Use to syntax-highlight API pretty-printed output. When highlighting, add output to $context->getOutput() and return false. $context: An IContextSource. @@ -892,6 +903,38 @@ $name: name of the special page, e.g. 'Watchlist' &$join_conds: join conditions for the tables $opts: FormOptions for this request +'ChangeTagAfterDelete': Called after a change tag has been deleted (that is, +removed from all revisions and log entries to which it was applied). This gives +extensions a chance to take it off their books. +$tag: name of the tag +&$status: Status object. Add warnings to this as required. There is no point + setting errors, as the deletion has already been partly carried out by this + point. + +'ChangeTagCanCreate': Tell whether a change tag should be able to be created +from the UI (Special:Tags) or via the API. You could use this hook if you want +to reserve a specific "namespace" of tags, or something similar. +$tag: name of the tag +$user: user initiating the action +&$status: Status object. Add your errors using `$status->fatal()` or warnings + using `$status->warning()`. Errors and warnings will be relayed to the user. + If you set an error, the user will be unable to create the tag. + +'ChangeTagCanDelete': Tell whether a change tag should be able to be +deleted from the UI (Special:Tags) or via the API. The default is that tags +defined using the ListDefinedTags hook are not allowed to be deleted unless +specifically allowed. If you wish to allow deletion of the tag, set +`$status = Status::newGood()` to allow deletion, and then `return false` from +the hook function. Ensure you consume the 'ChangeTagAfterDelete' hook to carry +out custom deletion actions. +$tag: name of the tag +$user: user initiating the action +&$status: Status object. See above. + +'ChangeTagsListActive': Allows you to nominate which of the tags your extension +uses are in active use. +&$tags: list of all active tags. Append to this array. + 'LoginUserMigrated': Called during login to allow extensions the opportunity to inform a user that their username doesn't exist for a specific reason, instead of letting the login form give the generic error message that the account does @@ -2234,6 +2277,10 @@ configuration variables to JavaScript. Things that depend on the current page or request state must be added through MakeGlobalVariablesScript instead. &$vars: array( variable name => value ) +'ResourceLoaderGetLessVars': Called in ResourceLoader::getLessVars after variables +from $wgResourceLoaderLESSVars are added. Can be used to add context-based variables. +&$lessVars: array of variables already added + 'ResourceLoaderRegisterModules': Right before modules information is required, such as when responding to a resource loader request or generating HTML output.