I think it's reasonable for link "colours" to depend on the page on
which they are shown. It seems similar to how self-links are handled.
The $colours variable is not cached, so title-specific link colours
will not "leak" to other titles.
Used in ProofreadPage in Ic910c2c33a6f1f8a70d9a122fbd2128428f29bd5.
Bug: T199288
Change-Id: I7378102a3e06544e9e695b255982c9bb0cfbf3a2
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.
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.
+* The 'GetLinkColours' hook now receives an additional $title parameter,
+ the Title object of the page being parsed, on which the links will be shown.
=== External library changes in 1.32 ===
* …
=== External library changes in 1.32 ===
* …
$linkcolour_ids: array of prefixed DB keys of the pages linked to,
indexed by page_id.
&$colours: (output) array of CSS classes, indexed by prefixed DB keys
$linkcolour_ids: array of prefixed DB keys of the pages linked to,
indexed by page_id.
&$colours: (output) array of CSS classes, indexed by prefixed DB keys
+$title: Title object of the page being parsed, on which the links will be shown
'GetLocalURL': Modify local URLs as output into page links. Note that if you are
working with internal urls (non-interwiki) then it may be preferable to work
'GetLocalURL': Modify local URLs as output into page links. Note that if you are
working with internal urls (non-interwiki) then it may be preferable to work
}
if ( count( $linkcolour_ids ) ) {
// pass an array of page_ids to an extension
}
if ( count( $linkcolour_ids ) ) {
// pass an array of page_ids to an extension
- Hooks::run( 'GetLinkColours', [ $linkcolour_ids, &$colours ] );
+ Hooks::run( 'GetLinkColours', [ $linkcolour_ids, &$colours, $this->parent->getTitle() ] );
}
# Do a second query for different language variants of links and categories
}
# Do a second query for different language variants of links and categories
- Hooks::run( 'GetLinkColours', [ $linkcolour_ids, &$colours ] );
+ Hooks::run( 'GetLinkColours', [ $linkcolour_ids, &$colours, $this->parent->getTitle() ] );
// rebuild the categories in original order (if there are replacements)
if ( count( $varCategories ) > 0 ) {
// rebuild the categories in original order (if there are replacements)
if ( count( $varCategories ) > 0 ) {