r74800 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74799‎ | r74800 | r74801 >
Date:22:13, 14 October 2010
Author:platonides
Status:ok
Tags:
Comment:
Follow up r74725. Also add $lang parameter to EditSectionLink.
Document the changes in hooks.txt
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -637,8 +637,9 @@
638638 the link, like "&section=$section"
639639 $tooltip: The default tooltip. Escape with htmlspecialchars() before using.
640640 By default, this is wrapped in the 'editsectionhint' message.
641 -$result: The HTML to return, prefilled with the default plus whatever other
 641+&$result: The HTML to return, prefilled with the default plus whatever other
642642 changes earlier hooks have made
 643+$lang: The language code to use for the link in the wfMsg* functions
643644
644645 'EditFilter': Perform checks on an edit
645646 $editor: Edit form (see includes/EditPage.php)
@@ -737,7 +738,8 @@
738739 $title: Title being linked to
739740 $section: Section to link to
740741 $link: Default link
741 -$result: Result (alter this to override the generated links)
 742+&$result: Result (alter this to override the generated links)
 743+$lang: The language code to use for the link in the wfMsg* functions
742744
743745 'EmailConfirmed': When checking that the user's email address is "confirmed"
744746 $user: User being checked
Index: trunk/phase3/includes/Linker.php
@@ -1395,7 +1395,7 @@
13961396 $attribs = " title=\"$attribs\"";
13971397 }
13981398 $result = null;
1399 - wfRunHooks( 'EditSectionLink', array( &$this, $nt, $section, $attribs, $link, &$result ) );
 1399+ wfRunHooks( 'EditSectionLink', array( &$this, $nt, $section, $attribs, $link, &$result, $lang ) );
14001400 if ( !is_null( $result ) ) {
14011401 # For reverse compatibility, add the brackets *after* the hook is
14021402 # run, and even add them to hook-provided text. (This is the main
@@ -1410,7 +1410,7 @@
14111411 $result = wfMsgExt( 'editsection-brackets', array( 'escape', 'replaceafter', 'language' => $lang ), $link );
14121412 $result = "<span class=\"editsection\">$result</span>";
14131413
1414 - wfRunHooks( 'DoEditSectionLink', array( $this, $nt, $section, $tooltip, &$result , $lang) );
 1414+ wfRunHooks( 'DoEditSectionLink', array( $this, $nt, $section, $tooltip, &$result, $lang ) );
14151415 return $result;
14161416 }
14171417

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r74725Added $lang parameter to DoEditSectionLink hook. Allows extensions that add ...jdpond18:45, 13 October 2010

Status & tagging log