jenkins-bot has submitted this change and it was merged. Change subject: Add WhatLinksHereProps hook, to allow extensions to annotate WhatLinksHere entries. ......................................................................
Add WhatLinksHereProps hook, to allow extensions to annotate WhatLinksHere entries. Needed by change 110090 Change-Id: I679abfbbdbd56498ec87579b4fe4e49ad486c84c --- M RELEASE-NOTES-1.24 M docs/hooks.txt M includes/specials/SpecialWhatlinkshere.php 3 files changed, 13 insertions(+), 3 deletions(-) Approvals: EBernhardson: Looks good to me, approved jenkins-bot: Verified diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index fd422fa..c0bb285 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -11,6 +11,8 @@ === Configuration changes in 1.24 === === New features in 1.24 === +* Added a new hook, "WhatLinksHereProps", to allow extensions to annotate + WhatLinksHere entries. === Bug fixes in 1.24 === * (bug 62258) A bug was fixed in File::getUnscaledThumb when a height diff --git a/docs/hooks.txt b/docs/hooks.txt index 80f388b..688e0cd 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2922,6 +2922,12 @@ &$expire: Cookie expiration, as for PHP's setcookie() $options: Options passed to WebResponse::setcookie() +'WhatLinksHereProps': Allows annotations to be added to WhatLinksHere +$row: The DB row of the entry. +$title: The Title of the page where the link comes FROM +$target: The Title of the page where the link goes TO +&$props: Array of HTML strings to display after the title. + 'WikiExporter::dumpStableQuery': Get the SELECT query for "stable" revisions dumps. One, and only one hook should set this, and return false. &$tables: Database tables to use in the SELECT query diff --git a/includes/specials/SpecialWhatlinkshere.php b/includes/specials/SpecialWhatlinkshere.php index 0587649..6488810 100644 --- a/includes/specials/SpecialWhatlinkshere.php +++ b/includes/specials/SpecialWhatlinkshere.php @@ -265,11 +265,11 @@ $nt = Title::makeTitle( $row->page_namespace, $row->page_title ); if ( $row->rd_from && $level < 2 ) { - $out->addHTML( $this->listItem( $row, $nt, true ) ); + $out->addHTML( $this->listItem( $row, $nt, $target, true ) ); $this->showIndirectLinks( $level + 1, $nt, $wgMaxRedirectLinksRetrieved ); $out->addHTML( Xml::closeElement( 'li' ) ); } else { - $out->addHTML( $this->listItem( $row, $nt ) ); + $out->addHTML( $this->listItem( $row, $nt, $target ) ); } } @@ -286,7 +286,7 @@ return Xml::openElement( 'ul', ( $level ? array() : array( 'id' => 'mw-whatlinkshere-list' ) ) ); } - protected function listItem( $row, $nt, $notClose = false ) { + protected function listItem( $row, $nt, $target, $notClose = false ) { $dirmark = $this->getLanguage()->getDirMark(); # local message cache @@ -326,6 +326,8 @@ $props[] = $msgcache['isimage']; } + wfRunHooks( 'WhatLinksHereProps', array( $row, $nt, $target, &$props ) ); + if ( count( $props ) ) { $propsText = $this->msg( 'parentheses' ) ->rawParams( implode( $msgcache['semicolon-separator'], $props ) )->escaped(); -- To view, visit https://gerrit.wikimedia.org/r/115860 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I679abfbbdbd56498ec87579b4fe4e49ad486c84c Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Werdna <agarr...@wikimedia.org> Gerrit-Reviewer: Anomie <bjor...@wikimedia.org> Gerrit-Reviewer: EBernhardson <ebernhard...@wikimedia.org> Gerrit-Reviewer: Spage <sp...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits