X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=docs%2Fhooks.txt;h=cd1af96cb65ca0fe9cbd722fc4a337e8aa1e8733;hb=81428046c0d14b84b27a00733258bf008d2e8088;hp=8905d7eec4c5186442d9e86be65161998b691d37;hpb=346b2ff04695f9482d17afa19addc4fa827081eb;p=lhc%2Fweb%2Fwiklou.git diff --git a/docs/hooks.txt b/docs/hooks.txt index 8905d7eec4..cd1af96cb6 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -295,7 +295,7 @@ ob_get_clean(). $title: Title under which the revisions were imported $origTitle: Title provided by the XML file $revCount: Number of revisions in the XML file -$sRevCount: Number of sucessfully imported revisions +$sRevCount: Number of successfully imported revisions $pageInfo: associative array of page information 'AfterFinalPageOutput': Nearly at the end of OutputPage::output() but @@ -355,6 +355,7 @@ $text : the new text of the article (has yet to be saved) 'APIGetAllowedParams': Use this hook to modify a module's parameters. &$module: ApiBase Module object &$params: Array of parameters +$flags: int zero or OR-ed flags like ApiBase::GET_VALUES_FOR_HELP 'APIGetDescription': Use this hook to modify a module's description. &$module: ApiBase Module object @@ -365,7 +366,7 @@ descriptions. &$module: ApiBase Module object &$desc: Array of parameter descriptions -'APIGetResultProperties': Use this hook to mofify the propertiesin a module's +'APIGetResultProperties': Use this hook to modify the properties in a module's result. &$module: ApiBase Module object &$properties: Array of properties @@ -521,7 +522,7 @@ $row: row (object) returned from the database server 'ArticlePageDataBefore': Before loading data of an article from the database. $wikiPage: WikiPage (object) that data will be loaded -$fields: fileds (array) to load from the database +$fields: fields (array) to load from the database 'ArticlePrepareTextForEdit': Called when preparing text to be saved. $wikiPage: the WikiPage being saved @@ -616,14 +617,14 @@ $article: target article (object) 'ArticleViewCustom': Allows to output the text of the article in a different format than wikitext. DEPRECATED, use ArticleContentViewCustom instead. Note -that it is preferrable to implement proper handing for a custom data type using +that it is preferable to implement proper handing for a custom data type using the ContentHandler facility. $text: text of the page $title: title of the page $output: reference to $wgOut 'ArticleContentViewCustom': Allows to output the text of the article in a -different format than wikitext. Note that it is preferrable to implement proper +different format than wikitext. Note that it is preferable to implement proper handing for a custom data type using the ContentHandler facility. $content: content of the page, as a Content object $title: title of the page @@ -634,7 +635,7 @@ in from an external authentication method. $user: User object created locally 'AuthPluginSetup': Update or replace authentication plugin object ($wgAuth). -Gives a chance for an extension to set it programattically to a variable class. +Gives a chance for an extension to set it programmatically to a variable class. &$auth: the $wgAuth object, probably a stub 'AutopromoteCondition': Check autopromote condition for user. @@ -643,7 +644,7 @@ $args: arguments $user: user $result: result of checking autopromote condition -'BacklinkCacheGetPrefix': Allows to set prefix for a spefific link table. +'BacklinkCacheGetPrefix': Allows to set prefix for a specific link table. $table: table name &$prefix: prefix @@ -744,6 +745,14 @@ $output: OutputPage object in use the defaults. &$namespaces: Array of namespace numbers with corresponding canonical names +'CategoryAfterPageAdded': After a page is added to a category. +$category: Category that page was added to +$wikiPage: WikiPage that was added + +'CategoryAfterPageRemoved': After a page is removed from a category. +$category: Category that page was removed from +$wikiPage: WikiPage that was removed + 'CategoryPageView': Before viewing a categorypage in CategoryPage::view. $catpage: CategoryPage instance @@ -769,7 +778,7 @@ $collationName: Name of the collation in question successfully. $user: user (object) whose email is being confirmed -'ContentHandlerDefaultModelFor': Called when the default content model is determiend +'ContentHandlerDefaultModelFor': Called when the default content model is determined for a given title. May be used to assign a different model for that title. $title: the Title in question &$model: the model name. Use with CONTENT_MODEL_XXX constants. @@ -954,27 +963,27 @@ $title: title of page being edited 'EditPageGetDiffText': DEPRECATED. Use EditPageGetDiffContent instead. Allow modifying the wikitext that will be used in "Show changes". Note that it is -preferrable to implement diff handling for different data types using the +preferable to implement diff handling for different data types using the ContentHandler facility. $editPage: EditPage object &$newtext: wikitext that will be used as "your version" 'EditPageGetDiffContent': Allow modifying the wikitext that will be used in -"Show changes". Note that it is preferrable to implement diff handling for +"Show changes". Note that it is preferable to implement diff handling for different data types using the ContentHandler facility. $editPage: EditPage object &$newtext: wikitext that will be used as "your version" 'EditPageGetPreviewText': DEPRECATED. Use EditPageGetPreviewContent instead. -Allow modifying the wikitext that will be previewed. Note that it is preferrable -to implement previews for different data types using the COntentHandler +Allow modifying the wikitext that will be previewed. Note that it is preferable +to implement previews for different data types using the ContentHandler facility. $editPage: EditPage object &$toparse: wikitext that will be parsed 'EditPageGetPreviewContent': Allow modifying the wikitext that will be -previewed. Note that it is preferrable to implement previews for different data -types using the COntentHandler facility. +previewed. Note that it is preferable to implement previews for different data +types using the ContentHandler facility. $editPage: EditPage object &$content: Content object to be previewed (may be replaced by hook function) @@ -1151,7 +1160,7 @@ $title: Title object of page &$url: string value as output (out parameter, can modify) 'GetMetadataVersion': Modify the image metadata version currently in use. This -is used when requesting image metadata from a ForiegnApiRepo. Media handlers +is used when requesting image metadata from a ForeignApiRepo. Media handlers that need to have versioned metadata should add an element to the end of the version array of the form 'handler_name=version'. Most media handlers won't need to do this unless they broke backwards compatibility with a previous version of @@ -1215,7 +1224,7 @@ page is built. $imagePage: ImagePage object ($this) &$html: HTML for the hook to add -'ImagePageFileHistoryLine': Called when a file history line is contructed. +'ImagePageFileHistoryLine': Called when a file history line is constructed. $file: the file $line: the HTML of the history line $css: the line CSS class @@ -1338,13 +1347,13 @@ CanonicalNamespaces for that. $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions: associative array of magic words synonyms -$lang: laguage code (string) +$lang: language code (string) 'LanguageGetSpecialPageAliases': DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases: associative array of magic words synonyms -$lang: laguage code (string) +$lang: language code (string) 'LanguageGetTranslatedLanguageNames': Provide translated language names. &$names: array of language code => language name @@ -1375,8 +1384,8 @@ $target: the Title object that the link is pointing to $options: the options. Will always include either 'known' or 'broken', and may include 'noclasses'. &$html: the final (raw HTML) contents of the tag, after processing. -&$attribs: the final HTML attributes of the tag, after processing, in asso- - ciative array form. +&$attribs: the final HTML attributes of the tag, after processing, in + associative array form. &$ret: the value to return if your hook returns false. 'LinkerMakeExternalImage': At the end of Linker::makeExternalImage() just @@ -1401,13 +1410,13 @@ actual update. each link table insert. For example, pagelinks, imagelinks, externallinks. $linksUpdate: LinksUpdate object $table: the table to insert links to -$insertions: an arry of links to insert +$insertions: an array of links to insert 'LinksUpdateComplete': At the end of LinksUpdate::doUpdate() when updating, including delete and insert, has completed for all link tables &$linksUpdate: the LinksUpdate object -'LinksUpdateConstructed': At the end of LinksUpdate() is contruction. +'LinksUpdateConstructed': At the end of LinksUpdate() is construction. &$linksUpdate: the LinksUpdate object 'ListDefinedTags': When trying to find all defined tags. @@ -1481,7 +1490,7 @@ $time: timestamp of the log entry (added in 1.12) script. $refreshLinks: RefreshLinks object -'MagicWordwgVariableIDs': When definig new magic words IDs. +'MagicWordwgVariableIDs': When defining new magic words IDs. $variableIDs: array of strings 'MakeGlobalVariablesScript': Called right before Skin::makeVariablesScript is @@ -1492,7 +1501,7 @@ ResourceLoaderGetConfigVars instead. Skin::makeVariablesScript $out: The OutputPage which called the hook, can be used to get the real title. -'MarkPatrolled': Aefore an edit is marked patrolled. +'MarkPatrolled': Before an edit is marked patrolled. $rcid: ID of the revision to be marked patrolled $user: the user (object) marking the revision as patrolled $wcOnlySysopsCanPatrol: config setting indicating whether the user needs to be a @@ -1689,7 +1698,7 @@ $stripState: stripState used (object) 'ParserAfterTidy': Called after Parser::tidy() in Parser::parse() $parser: Parser object being used -$text: text that'll be returned +$text: text that will be returned 'ParserBeforeInternalParse': Called at the beginning of Parser::internalParse(). $parser: Parser object @@ -1732,7 +1741,7 @@ $time: actual time (timestamp) 'ParserGetVariableValueVarCache': use this to change the value of the variable cache or return false to not use it. $parser: Parser object -$varCache: varaiable cache (array) +$varCache: variable cache (array) 'ParserLimitReport': Called at the end of Parser:parse() when the parser will include comments about size of the text parsed. @@ -1807,7 +1816,7 @@ $oldaddr: old email address (string) $newaddr: new email address (string) 'PrefsPasswordAudit': Called when user changes his password. -$user: User (object) changing his passoword +$user: User (object) changing his password $newPass: new password $error: error (string) 'badretype', 'wrongpassword', 'error' or 'success' @@ -2170,7 +2179,7 @@ go to the existing page. $t: title object searched for &$params: an array of the default message name and page title (as parameter) -'SpecialSearchGo': Valled when user clicked the "Go". +'SpecialSearchGo': Called when user clicked the "Go". &$title: title object generated from the text entered by the user &$term: the search term entered by the user @@ -2199,6 +2208,22 @@ $search: SpecialSearch special page object $profile: String: current search profile $engine: the search engine +'SpecialSearchResultsPrepend': Called immediately before returning HTML +on the search results page. Useful for including an external search +provider. To disable the output of MediaWiki search output, return +false. +$specialSearch: SpecialSearch object ($this) +$output: $wgOut +$term: Search term specified by the user + +'SpecialSearchResultsAppend': Called after all search results HTML has +been output. Note that in some cases, this hook will not be called (no +results, too many results, SpecialSearchResultsPrepend returned false, +etc). +$specialSearch: SpecialSearch object ($this) +$output: $wgOut +$term: Search term specified by the user + 'SpecialSearchResults': Called before search result display when there are matches. $term: string of search term @@ -2248,7 +2273,7 @@ $output: OutputPage object 'ThumbnailBeforeProduceHTML': Called before an image HTML is about to be rendered (by ThumbnailImage:toHtml method). $thumbnail: the ThumbnailImage object -&$attribs: image attibute array +&$attribs: image attribute array &$linkAttribs: image link attribute array 'TitleArrayFromResult': Called when creating an TitleArray object from a @@ -2268,7 +2293,7 @@ $result: Boolean; whether MediaWiki currently thinks this is a CSS/JS page. Title::isCssOrJsPage(). 'TitleIsAlwaysKnown': Called when determining if a page exists. Allows -overriding default behaviour for determining if a page exists. If $isKnown is +overriding default behavior for determining if a page exists. If $isKnown is kept as null, regular checks happen. If it's a boolean, this value is returned by the isKnown method. $title: Title object that is being checked @@ -2283,7 +2308,7 @@ $result: Boolean; whether MediaWiki currently thinks this page is movable. Title::isMovable(). 'TitleIsWikitextPage': Called when determining if a page is a wikitext or should -be handled by seperate handler (via ArticleViewCustom). +be handled by separate handler (via ArticleViewCustom). $title: Title object that is being checked $result: Boolean; whether MediaWiki currently thinks this is a wikitext page. Hooks may change this value to override the return value of @@ -2324,7 +2349,7 @@ $title: Title object of the page that we're about to undelete $title: title object related to the revision $rev: revision (object) that will be viewed -'UnknownAction': An unknown "action" has occured (useful for defining your own +'UnknownAction': An unknown "action" has occurred (useful for defining your own actions). $action: action name $article: article "acted on" @@ -2421,7 +2446,7 @@ $user: User (object) whose permission is being checked 'UserClearNewTalkNotification': Called when clearing the "You have new messages!" message, return false to not delete it. -$user: User (object) that'll clear the message +$user: User (object) that will clear the message 'UserComparePasswords': Called when checking passwords, return false to override the default password checks. @@ -2462,9 +2487,9 @@ $user: User object &$email: email, change this to override local email 'UserGetEmailAuthenticationTimestamp': Called when getting the timestamp of -email authentification. +email authentication. $user: User object -&$timestamp: timestamp, change this to override local email authentification +&$timestamp: timestamp, change this to override local email authentication timestamp 'UserGetImplicitGroups': Called in User::getImplicitGroups(). @@ -2472,7 +2497,8 @@ $user: User object 'UserGetLanguageObject': Called when getting user's interface language object. $user: User object -&$code: Langauge code that will be used to create the object +&$code: Language code that will be used to create the object +$context: RequestContext object 'UserGetReservedNames': Allows to modify $wgReservedUsernames at run time. &$reservedUsernames: $wgReservedUsernames @@ -2509,7 +2535,7 @@ $user: user object 'UserLoadFromSession': Called to authenticate users on external/environmental means; occurs before session is loaded. $user: user object being loaded -&$result: set this to a boolean value to abort the normal authentification +&$result: set this to a boolean value to abort the normal authentication process 'UserLoadOptions': When user options/preferences are being loaded from the @@ -2564,10 +2590,10 @@ $user: User object &$email: new email, change this to override new email address 'UserSetEmailAuthenticationTimestamp': Called when setting the timestamp of -email authentification. +email authentication. $user: User object &$timestamp: new timestamp, change this to override local email -authentification timestamp +authentication timestamp 'UserToolLinksEdit': Called when generating a list of user tool links, e.g. "Foobar (Talk | Contribs | Block)".