Example #1
0
 /**
  * Main execution point
  *
  * @param string $subpage
  */
 function execute($subpage)
 {
     // Anons don't get a watchlist
     $this->requireLogin('watchlistanontext');
     $output = $this->getOutput();
     $request = $this->getRequest();
     $this->addHelpLink('Help:Watching pages');
     $output->addModules(array('mediawiki.special.changeslist.visitedstatus'));
     $mode = SpecialEditWatchlist::getMode($request, $subpage);
     if ($mode !== false) {
         if ($mode === SpecialEditWatchlist::EDIT_RAW) {
             $title = SpecialPage::getTitleFor('EditWatchlist', 'raw');
         } elseif ($mode === SpecialEditWatchlist::EDIT_CLEAR) {
             $title = SpecialPage::getTitleFor('EditWatchlist', 'clear');
         } else {
             $title = SpecialPage::getTitleFor('EditWatchlist');
         }
         $output->redirect($title->getLocalURL());
         return;
     }
     $this->checkPermissions();
     $user = $this->getUser();
     $opts = $this->getOptions();
     $config = $this->getConfig();
     if (($config->get('EnotifWatchlist') || $config->get('ShowUpdatedMarker')) && $request->getVal('reset') && $request->wasPosted()) {
         $user->clearAllNotifications();
         $output->redirect($this->getPageTitle()->getFullURL($opts->getChangedValues()));
         return;
     }
     parent::execute($subpage);
 }
 /**
  * Main execution point
  *
  * @param string $subpage
  */
 function execute($subpage)
 {
     global $wgEnotifWatchlist, $wgShowUpdatedMarker;
     // Anons don't get a watchlist
     $this->requireLogin('watchlistanontext');
     $output = $this->getOutput();
     $request = $this->getRequest();
     $mode = SpecialEditWatchlist::getMode($request, $subpage);
     if ($mode !== false) {
         if ($mode === SpecialEditWatchlist::EDIT_RAW) {
             $title = SpecialPage::getTitleFor('EditWatchlist', 'raw');
         } elseif ($mode === SpecialEditWatchlist::EDIT_CLEAR) {
             $title = SpecialPage::getTitleFor('EditWatchlist', 'clear');
         } else {
             $title = SpecialPage::getTitleFor('EditWatchlist');
         }
         $output->redirect($title->getLocalURL());
         return;
     }
     $this->checkPermissions();
     $user = $this->getUser();
     $opts = $this->getOptions();
     if (($wgEnotifWatchlist || $wgShowUpdatedMarker) && $request->getVal('reset') && $request->wasPosted()) {
         $user->clearAllNotifications();
         $output->redirect($this->getPageTitle()->getFullURL($opts->getChangedValues()));
         return;
     }
     parent::execute($subpage);
 }
 /**
  * Main execution point
  *
  * @param string $subpage
  */
 public function execute($subpage)
 {
     // 10 seconds server-side caching max
     $this->getOutput()->setSquidMaxage(10);
     // Check if the client has a cached version
     $lastmod = $this->checkLastModified($this->feedFormat);
     if ($lastmod === false) {
         return;
     }
     parent::execute($subpage);
 }
 /**
  * Main execution point
  *
  * @param string $subpage
  */
 public function execute($subpage)
 {
     // Backwards-compatibility: redirect to new feed URLs
     $feedFormat = $this->getRequest()->getVal('feed');
     if (!$this->including() && $feedFormat) {
         $query = $this->getFeedQuery();
         $query['feedformat'] = $feedFormat === 'atom' ? 'atom' : 'rss';
         $this->getOutput()->redirect(wfAppendQuery(wfScript('api'), $query));
         return;
     }
     // 10 seconds server-side caching max
     $this->getOutput()->setSquidMaxage(10);
     // Check if the client has a cached version
     $lastmod = $this->checkLastModified();
     if ($lastmod === false) {
         return;
     }
     parent::execute($subpage);
 }
 /**
  * Main execution point
  *
  * @param string $subpage
  */
 public function execute($subpage)
 {
     // Backwards-compatibility: redirect to new feed URLs
     $feedFormat = $this->getRequest()->getVal('feed');
     if (!$this->including() && $feedFormat) {
         $query = $this->getFeedQuery();
         $query['feedformat'] = $feedFormat === 'atom' ? 'atom' : 'rss';
         $this->getOutput()->redirect(wfAppendQuery(wfScript('api'), $query));
         return;
     }
     // 10 seconds server-side caching max
     $this->getOutput()->setCdnMaxage(10);
     // Check if the client has a cached version
     $lastmod = $this->checkLastModified();
     if ($lastmod === false) {
         return;
     }
     $this->addHelpLink('//meta.wikimedia.org/wiki/Special:MyLanguage/Help:Recent_changes', true);
     parent::execute($subpage);
 }