/**
  * Renders the view/edit (normal) mode of the watchlist.
  */
 protected function executeViewEditWatchlist()
 {
     $ns = NS_MAIN;
     $html = '';
     $total = 0;
     $images = array();
     $watchlist = $this->getWatchlistInfo();
     if (isset($watchlist[$ns])) {
         $allPages = $watchlist[$ns];
         $from = $this->getNextPage($allPages);
         $allPages = $this->getPagesToDisplay($allPages);
     } else {
         $allPages = array();
         $from = false;
     }
     // Begin rendering of watchlist.
     $watchlist = array($ns => $allPages);
     if (!MobileContext::singleton()->imagesDisabled()) {
         Hooks::run('SpecialMobileEditWatchlist::images', array($this->getContext(), &$watchlist, &$images));
     }
     // create list of pages
     $mobilePages = new MobileCollection();
     $pageKeys = array_keys($watchlist[$ns]);
     foreach ($pageKeys as $dbkey) {
         if (isset($images[$ns][$dbkey])) {
             $page = new MobilePage(Title::makeTitleSafe($ns, $dbkey), wfFindFile($images[$ns][$dbkey]));
         } else {
             $page = new MobilePage(Title::makeTitleSafe($ns, $dbkey));
         }
         $mobilePages->add($page);
     }
     if (count($mobilePages) === 0) {
         $html = SpecialMobileWatchlist::getEmptyListHtml(false, $this->getLanguage());
     } else {
         $html = $this->getViewHtml($mobilePages);
     }
     if ($from) {
         // show more link if there are more items to show
         $qs = array('from' => $from);
         $html .= Html::element('a', array('class' => MobileUI::anchorClass('progressive', 'more'), 'href' => SpecialPage::getTitleFor('EditWatchlist')->getLocalURL($qs)), $this->msg('mobile-frontend-watchlist-more'));
     }
     $out = $this->getOutput();
     $out->addHtml($html);
     $out->addModules('skins.minerva.special.watchlist.scripts');
     $out->addModuleStyles(array('skins.minerva.special.styles', 'skins.minerva.special.watchlist.styles', 'mobile.pagelist.styles', 'mobile.pagesummary.styles', 'mobile.special.pagefeed.styles'));
 }