コード例 #1
0
 /**
  * Show a form for filtering namespace and username
  *
  * @param $par String
  * @return String
  */
 public function execute($par)
 {
     $out = $this->getOutput();
     $this->setHeaders();
     $this->outputHeader();
     $this->showNavigation = !$this->including();
     // Maybe changed in setup
     $this->setup($par);
     if (!$this->including()) {
         // Settings
         $this->form();
         $feedType = $this->opts->getValue('feed');
         if ($feedType) {
             $this->feed($feedType);
             return;
         }
         $allValues = $this->opts->getAllValues();
         unset($allValues['feed']);
         $out->setFeedAppendQuery(wfArrayToCgi($allValues));
     }
     $pager = new NewPagesPager($this, $this->opts);
     $pager->mLimit = $this->opts->getValue('limit');
     $pager->mOffset = $this->opts->getValue('offset');
     if ($pager->getNumRows()) {
         $navigation = '';
         if ($this->showNavigation) {
             $navigation = $pager->getNavigationBar();
         }
         $out->addHTML($navigation . $pager->getBody() . $navigation);
     } else {
         $out->addWikiMsg('specialpage-empty');
     }
 }
コード例 #2
0
 /**
  * Show a form for filtering namespace and username
  *
  * @param string $par
  * @return string
  */
 public function execute($par)
 {
     global $wgLang, $wgUser, $wgOut;
     $this->setHeaders();
     $this->outputHeader();
     $this->showNavigation = !$this->including();
     // Maybe changed in setup
     $this->setup($par);
     if (!$this->including()) {
         // Settings
         $this->form();
         $this->setSyndicated();
         $feedType = $this->opts->getValue('feed');
         if ($feedType) {
             return $this->feed($feedType);
         }
     }
     $pager = new NewPagesPager($this, $this->opts);
     $pager->mLimit = $this->opts->getValue('limit');
     $pager->mOffset = $this->opts->getValue('offset');
     if ($pager->getNumRows()) {
         $navigation = '';
         if ($this->showNavigation) {
             $navigation = $pager->getNavigationBar();
         }
         $wgOut->addHTML($navigation . $pager->getBody() . $navigation);
     } else {
         $wgOut->addWikiMsg('specialpage-empty');
     }
 }