From 1b8db29ed538c9370a75d344f91dfd30acbad788 Mon Sep 17 00:00:00 2001 From: Erik Bernhardson Date: Fri, 7 Mar 2014 12:32:27 -0800 Subject: [PATCH] Method to identify if a ChangesList is watchlist or normal There are differences, like grouping, between watchlist and normal rendering that hook recipients need to know about. This exposes if the setWatchlistDivs method has been called which currently happens immediatly after instantiation in SpecialWatchlist Change-Id: Ibc06c6d9b878cad3f5da92cfbe3f650ad3f63efa --- includes/changes/ChangesList.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index b996894088..ca9efc3934 100644 --- a/includes/changes/ChangesList.php +++ b/includes/changes/ChangesList.php @@ -80,6 +80,14 @@ class ChangesList extends ContextSource { $this->watchlist = $value; } + /** + * @return bool true when setWatchlistDivs has been called + * @since 1.23 + */ + public function isWatchlist() { + return (bool)$this->watchlist; + } + /** * As we use the same small set of messages in various methods and that * they are called often, we call them once and save them in $this->message -- 2.20.1