* Added new 'OutputPageAfterGetHeadLinksArray' hook, allowing extensions to
modify the return value of OutputPage#getHeadLinksArray in order to add,
remove or otherwise alter the elements to be output in the page <head>.
+* (T28934) The 'HistoryPageToolLinks' hook allows extensions to append
+ additional links to the subtitle of a history page.
=== External library changes in 1.32 ===
* …
$prevRev: Revision object, next in line in page history, or null
$user: Current user object
+'HistoryPageToolLinks': Add one or more links to revision history page subtitle.
+$context: IContextSource (object)
+$linkRenderer: LinkRenderer instance
+&$links: Array of HTML strings
+
'HTMLFileCache::useFileCache': Override whether a page should be cached in file
cache.
$context: An IContextSource object with information about the request being
protected function getDescription() {
// Creation of a subtitle link pointing to [[Special:Log]]
- return MediaWikiServices::getInstance()->getLinkRenderer()->makeKnownLink(
+ $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
+ $subtitle = $linkRenderer->makeKnownLink(
SpecialPage::getTitleFor( 'Log' ),
$this->msg( 'viewpagelogs' )->text(),
[],
[ 'page' => $this->getTitle()->getPrefixedText() ]
);
+
+ $links = [];
+ // Allow extensions to add more links
+ Hooks::run( 'HistoryPageToolLinks', [ $this->getContext(), $linkRenderer, &$links ] );
+ if ( $links ) {
+ $subtitle .= ''
+ . $this->msg( 'word-separator' )->escaped()
+ . $this->msg( 'parentheses' )
+ ->rawParams( $this->getLanguage()->pipeList( $links ) )
+ ->escaped();
+ }
+ return $subtitle;
}
/**