function show() { global $wgRequest, $wgOut, $wgLang, $wgUser; $filter = $this->mFilter; if ($filter) { $wgOut->setPageTitle(wfMsg('abusefilter-history', $filter)); } else { $wgOut->setPageTitle(wfMsg('abusefilter-filter-log')); } # Check perms if ($filter && !$wgUser->isAllowed('abusefilter-modify') && AbuseFilter::filterHidden($filter)) { $wgOut->addWikiMsg('abusefilter-history-error-hidden'); return; } # Useful links $sk = $wgUser->getSkin(); $links = array(); if ($filter) { $links['abusefilter-history-backedit'] = $this->getTitle($filter); } foreach ($links as $msg => $title) { $links[$msg] = $sk->link($title, wfMsgExt($msg, 'parseinline')); } $backlinks = $wgLang->pipeList($links); $wgOut->addHTML(Xml::tags('p', null, $backlinks)); # For user $user = $wgRequest->getText('user'); if ($user) { $wgOut->setSubtitle(wfMsg('abusefilter-history-foruser', $sk->userLink(1, $user), $user)); } // Add filtering of changes et al. $fields['abusefilter-history-select-user'] = Xml::input('user', 45, $user); $filterForm = Xml::buildForm($fields, 'abusefilter-history-select-submit'); $filterForm .= "\n" . Xml::hidden('title', $this->getTitle("history/{$filter}")); $filterForm = Xml::tags('form', array('action' => $this->getTitle("history/{$filter}")->getLocalURL(), 'method' => 'get'), $filterForm); $filterForm = Xml::fieldset(wfMsg('abusefilter-history-select-legend'), $filterForm); $wgOut->addHTML($filterForm); $pager = new AbuseFilterHistoryPager($filter, $this, $user); $table = $pager->getBody(); $wgOut->addHTML($pager->getNavigationBar() . $table . $pager->getNavigationBar()); }
function show() { $out = $this->getOutput(); $filter = $this->mFilter; if ($filter) { $out->setPageTitle($this->msg('abusefilter-history', $filter)); } else { $out->setPageTitle($this->msg('abusefilter-filter-log')); } # Check perms if ($filter && !$this->getUser()->isAllowed('abusefilter-modify') && AbuseFilter::filterHidden($filter)) { $out->addWikiMsg('abusefilter-history-error-hidden'); return; } # Useful links $links = array(); if ($filter) { $links['abusefilter-history-backedit'] = $this->getTitle($filter); } foreach ($links as $msg => $title) { $links[$msg] = Linker::link($title, $this->msg($msg)->parse()); } $backlinks = $this->getLanguage()->pipeList($links); $out->addHTML(Xml::tags('p', null, $backlinks)); # For user $user = User::getCanonicalName($this->getRequest()->getText('user'), 'valid'); if ($user) { $out->addSubtitle($this->msg('abusefilter-history-foruser', Linker::userLink(1, $user), $user)->text()); } // Add filtering of changes et al. $fields['abusefilter-history-select-user'] = Xml::input('user', 45, $user); $filterForm = Xml::buildForm($fields, 'abusefilter-history-select-submit'); $filterForm .= "\n" . Html::hidden('title', $this->getTitle("history/{$filter}")); $filterForm = Xml::tags('form', array('action' => $this->getTitle("history/{$filter}")->getLocalURL(), 'method' => 'get'), $filterForm); $filterForm = Xml::fieldset($this->msg('abusefilter-history-select-legend')->text(), $filterForm); $out->addHTML($filterForm); $pager = new AbuseFilterHistoryPager($filter, $this, $user); $table = $pager->getBody(); $out->addHTML($pager->getNavigationBar() . $table . $pager->getNavigationBar()); }