WatchlistEditorBuildRemoveLine allows subscribers to modify $tools array.
However, it's hard to know exactly which link is which: $tools is just an array
of HTML links.
By adding a descriptive key, it'd be easier to unset or modify a specific link.
AFAICT, there currently are no subscribers to this hook in WMF extensions (Flow
will be coming up with one soon), so this change should be safe.
Change-Id: Id3f69db1aab7d3e3761318d7f8588ae63a0bc6a6
private function buildRemoveLine( $title ) {
$link = Linker::link( $title );
private function buildRemoveLine( $title ) {
$link = Linker::link( $title );
- $tools[] = Linker::link( $title->getTalkPage(), $this->msg( 'talkpagelinktext' )->escaped() );
+ $tools['talk'] = Linker::link( $title->getTalkPage(), $this->msg( 'talkpagelinktext' )->escaped() );
if ( $title->exists() ) {
if ( $title->exists() ) {
- $tools[] = Linker::linkKnown(
+ $tools['history'] = Linker::linkKnown(
$title,
$this->msg( 'history_short' )->escaped(),
array(),
$title,
$this->msg( 'history_short' )->escaped(),
array(),
}
if ( $title->getNamespace() == NS_USER && !$title->isSubpage() ) {
}
if ( $title->getNamespace() == NS_USER && !$title->isSubpage() ) {
- $tools[] = Linker::linkKnown(
+ $tools['contributions'] = Linker::linkKnown(
SpecialPage::getTitleFor( 'Contributions', $title->getText() ),
$this->msg( 'contributions' )->escaped()
);
SpecialPage::getTitleFor( 'Contributions', $title->getText() ),
$this->msg( 'contributions' )->escaped()
);