Esempio n. 1
0
 public function execute($par)
 {
     //big table, big wikiHow page
     global $wgHooks;
     $wgHooks['ShowSideBar'][] = array('SpecialListFiles::removeSideBarCallback');
     $this->setHeaders();
     $this->outputHeader();
     if ($this->including()) {
         $userName = $par;
         $search = '';
         $showAll = false;
     } else {
         $userName = $this->getRequest()->getText('user', $par);
         $search = $this->getRequest()->getText('ilsearch', '');
         $showAll = $this->getRequest()->getBool('ilshowall', false);
     }
     $pager = new ImageListPager($this->getContext(), $userName, $search, $this->including(), $showAll);
     if ($this->including()) {
         $html = $pager->getBody();
     } else {
         $form = $pager->getForm();
         $body = $pager->getBody();
         $nav = $pager->getNavigationBar();
         $html = "{$form}<br />\n{$body}<br />\n{$nav}";
     }
     $this->getOutput()->addHTML($html);
 }
Esempio n. 2
0
	public function execute( $par ) {
		$this->setHeaders();
		$this->outputHeader();

		if ( $this->including() ) {
			$userName = $par;
			$search = '';
		} else {
			$userName = $this->getRequest()->getText( 'user', $par );
			$search = $this->getRequest()->getText( 'ilsearch', '' );
			$showAll = $this->getRequest()->getBool( 'ilshowall', false );
		}

		$pager = new ImageListPager(
			$this->getContext(),
			$userName,
			$search,
			$this->including(),
			$showAll
		);

		if ( $this->including() ) {
			$html = $pager->getBody();
		} else {
			$form = $pager->getForm();
			$body = $pager->getBody();
			$nav = $pager->getNavigationBar();
			$html = "$form<br />\n$body<br />\n$nav";
		}
		$this->getOutput()->addHTML( $html );
	}
Esempio n. 3
0
/**
 *
 */
function wfSpecialListfiles()
{
    global $wgOut;
    $pager = new ImageListPager();
    $limit = $pager->getForm();
    $body = $pager->getBody();
    $nav = $pager->getNavigationBar();
    $wgOut->addHTML("{$limit}<br />\n{$body}<br />\n{$nav}");
}
/**
 *
 */
function wfSpecialImagelist()
{
    global $wgOut;
    $pager = new ImageListPager();
    $limit = $pager->getForm();
    $body = $pager->getBody();
    $nav = $pager->getNavigationBar();
    $wgOut->addHTML($limit . '<br/>' . $body . '<br/>' . $nav);
}
Esempio n. 5
0
/**
 *
 */
function wfSpecialImagelist()
{
    global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgMiserMode;
    $pager = new ImageListPager();
    $limit = $pager->getForm();
    $body = $pager->getBody();
    $nav = $pager->getNavigationBar();
    $wgOut->addHTML("\n\t\t{$limit}\n\t\t<br/>\n\t\t{$body}\n\t\t{$nav}");
}
 function getQueryInfo()
 {
     $queryInfo = parent::getQueryInfo();
     $ndx = array_search(self::ADD_ATTACHMENT, $queryInfo['fields']);
     if ($ndx != false) {
         unset($queryInfo['fields'][$ndx]);
     }
     return $queryInfo;
 }
Esempio n. 7
0
 public function execute($par)
 {
     $this->setHeaders();
     $this->outputHeader();
     if ($this->including()) {
         $userName = $par;
         $search = '';
         $showAll = false;
     } else {
         $userName = $this->getRequest()->getText('user', $par);
         $search = $this->getRequest()->getText('ilsearch', '');
         $showAll = $this->getRequest()->getBool('ilshowall', false);
     }
     $pager = new ImageListPager($this->getContext(), $userName, $search, $this->including(), $showAll);
     $out = $this->getOutput();
     if ($this->including()) {
         $out->addParserOutputContent($pager->getBodyOutput());
     } else {
         $pager->getForm();
         $out->addParserOutputContent($pager->getFullOutput());
     }
 }
Esempio n. 8
0
 public function execute($par)
 {
     global $wgOut, $wgRequest;
     $this->setHeaders();
     $this->outputHeader();
     if ($this->including()) {
         $userName = $par;
         $search = '';
     } else {
         $userName = $wgRequest->getText('user', $par);
         $search = $wgRequest->getText('ilsearch', '');
     }
     $pager = new ImageListPager($userName, $search, $this->including());
     if ($this->including()) {
         $html = $pager->getBody();
     } else {
         $form = $pager->getForm();
         $body = $pager->getBody();
         $nav = $pager->getNavigationBar();
         $html = "{$form}<br />\n{$body}<br />\n{$nav}";
     }
     $wgOut->addHTML($html);
 }
 function execute($par)
 {
     global $wgOut;
     $cacheManager = new \PageAttachment\Cache\CacheManager();
     $pageFactory = new \PageAttachment\Session\PageFactory($cacheManager);
     $security = new \PageAttachment\Security\SecurityManager();
     $session = new \PageAttachment\Session\Session($security, $pageFactory);
     $attachToPage = $session->getAttachToPage();
     if (isset($attachToPage) && $attachToPage->getId() > 0) {
         $pageTitle = $attachToPage->getPageTitle();
         $protectedPage = $attachToPage->isProtected();
         if (!$security->isBrowseSearchAttachAllowed($protectedPage)) {
             if ($security->isBrowseSearchAttachRequireLogin() && !$security->isLoggedIn()) {
                 $session->setStatusMessage('YouMustBeLoggedInToBrowseSearchAttach');
             } else {
                 $session->setStatusMessage('BrowseSearchAttachIsNotPermitted');
             }
             $wgOut->redirect($attachToPage->getRedirectURL());
         } else {
             $context = $this->getContext();
             $userName = $this->getRequest()->getText('user', $par);
             $search = $this->getRequest()->getText('ilsearch', '');
             $this->setHeaders();
             $pager = new ImageListPager($context, $userName, $search);
             $limit = $pager->getForm();
             $body = $pager->getBody();
             $nav = $pager->getNavigationBar();
             $msgAttachToPageName = \wfMsg('AttachToPageName', $pageTitle);
             $wgOut->addHTML("{$limit}<br />\n{$body}<br />\n{$nav}");
         }
     } else {
         $session->setStatusMessage('UnableToDetermineAttachToPage');
         $title = \Title::newFromText(\wfMsgForContent('mainpage'));
         $wgOut->redirect($title->getFullURL());
     }
 }
 /**
  * @expectedException MWException
  * @expectedExceptionMessage invalid_field
  * @covers ImageListPager::formatValue
  */
 public function testFormatValuesThrowException()
 {
     $page = new ImageListPager(RequestContext::getMain());
     $page->formatValue('invalid_field', 'invalid_value');
 }