Method to identify if a ChangesList is watchlist or normal
authorErik Bernhardson <ebernhardson@wikimedia.org>
Fri, 7 Mar 2014 20:32:27 +0000 (12:32 -0800)
committerErik Bernhardson <ebernhardson@wikimedia.org>
Thu, 13 Mar 2014 17:35:56 +0000 (10:35 -0700)
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

index b996894..ca9efc3 100644 (file)
@@ -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