+ /**
+ * Get information about watched status and put it in $watched
+ */
+ private function getWatchedInfo()
+ {
+ global $wgUser;
+
+ if($wgUser->isAnon() || count($this->titles) == 0)
+ return;
+
+ $this->watched = array();
+ $db = $this->getDB();
+
+ $lb = new LinkBatch($this->titles);
+
+ $this->addTables(array('page', 'watchlist'));
+ $this->addFields(array('page_title', 'page_namespace'));
+ $this->addWhere($lb->constructSet('page', $db));
+ $this->addWhere('wl_title=page_title');
+ $this->addWhere('wl_namespace=page_namespace');
+ $this->addWhereFld('wl_user', $wgUser->getID());
+
+ $res = $this->select(__METHOD__);
+
+ while($row = $db->fetchObject($res)) {
+ $this->watched[$row->page_namespace][$row->page_title] = true;
+ }
+ }
+