Пример #1
0
 public function execute($par)
 {
     $this->setHeaders();
     $this->outputHeader();
     $this->getOutput()->addModuleStyles('mediawiki.special');
     // Purge expired entries on one in every 10 queries
     if (!mt_rand(0, 10)) {
         Title::purgeExpiredRestrictions();
     }
     $request = $this->getRequest();
     $type = $request->getVal($this->IdType);
     $level = $request->getVal($this->IdLevel);
     $sizetype = $request->getVal('sizetype');
     $size = $request->getIntOrNull('size');
     $ns = $request->getIntOrNull('namespace');
     $indefOnly = $request->getBool('indefonly') ? 1 : 0;
     $cascadeOnly = $request->getBool('cascadeonly') ? 1 : 0;
     $noRedirect = $request->getBool('noredirect') ? 1 : 0;
     $pager = new ProtectedPagesPager($this, array(), $type, $level, $ns, $sizetype, $size, $indefOnly, $cascadeOnly, $noRedirect);
     $this->getOutput()->addHTML($this->showOptions($ns, $type, $level, $sizetype, $size, $indefOnly, $cascadeOnly, $noRedirect));
     if ($pager->getNumRows()) {
         $this->getOutput()->addParserOutputContent($pager->getFullOutput());
     } else {
         $this->getOutput()->addWikiMsg('protectedpagesempty');
     }
 }
Пример #2
0
 public function execute($par)
 {
     $this->setHeaders();
     $this->outputHeader();
     $this->getOutput()->addModuleStyles('mediawiki.special');
     $request = $this->getRequest();
     $type = $request->getVal($this->IdType);
     $level = $request->getVal($this->IdLevel);
     $sizetype = $request->getVal('sizetype');
     $size = $request->getIntOrNull('size');
     $ns = $request->getIntOrNull('namespace');
     $indefOnly = $request->getBool('indefonly') ? 1 : 0;
     $cascadeOnly = $request->getBool('cascadeonly') ? 1 : 0;
     $noRedirect = $request->getBool('noredirect') ? 1 : 0;
     $pager = new ProtectedPagesPager($this, [], $type, $level, $ns, $sizetype, $size, $indefOnly, $cascadeOnly, $noRedirect, $this->getLinkRenderer());
     $this->getOutput()->addHTML($this->showOptions($ns, $type, $level, $sizetype, $size, $indefOnly, $cascadeOnly, $noRedirect));
     if ($pager->getNumRows()) {
         $this->getOutput()->addParserOutputContent($pager->getFullOutput());
     } else {
         $this->getOutput()->addWikiMsg('protectedpagesempty');
     }
 }