&$transform: whether or not to expand variables and templates
in the message (bool)
-'OldChangesListRecentChangesLine': Customize entire Recent Changes line.
+'OldChangesListRecentChangesLine': Customize entire Recent Changes line,
+or return false to omit the line from RecentChanges and Watchlist special pages.
&$changeslist: The OldChangesList instance.
&$s: HTML of the form "<li>...</li>" containing one RC entry.
&$rc: The RecentChange object.
* @param $rc RecentChange, passed by reference
* @param $watched Bool (default false)
* @param $linenumber Int (default null)
- * @return string
+ *
+ * @return string|bool
*/
public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
global $wgRCShowChangedSize;
$classes[] = Sanitizer::escapeClass( 'watchlist-'.$rc->mAttribs['rc_namespace'].'-'.$rc->mAttribs['rc_title'] );
}
- wfRunHooks( 'OldChangesListRecentChangesLine', array(&$this, &$s, $rc) );
+ if ( !wfRunHooks( 'OldChangesListRecentChangesLine', array( &$this, &$s, $rc ) ) ) {
+ wfProfileOut( __METHOD__ );
+ return false;
+ }
wfProfileOut( __METHOD__ );
return "$dateheader<li class=\"".implode( ' ', $classes )."\">".$s."</li>\n";
}
$rc->numberofWatchingusers = $watcherCache[$obj->rc_namespace][$obj->rc_title];
}
- $s .= $list->recentChangesLine( $rc, !empty( $obj->wl_user ), $counter );
- --$limit;
+
+ $changeLine = $list->recentChangesLine( $rc, !empty( $obj->wl_user ), $counter );
+ if ( $changeLine !== false ) {
+ $s .= $changeLine;
+ --$limit;
+ }
}
$s .= $list->endRecentChangesList();
$this->getOutput()->addHTML( $s );
$rc->numberofWatchingusers = 0;
}
- $s .= $list->recentChangesLine( $rc, $updated, $counter );
+ $changeLine = $list->recentChangesLine( $rc, $updated, $counter );
+ if ( $changeLine !== false ) {
+ $s .= $changeLine;
+ }
}
$s .= $list->endRecentChangesList();