本文整理汇总了PHP中Xml::buildForm方法的典型用法代码示例。如果您正苦于以下问题:PHP Xml::buildForm方法的具体用法?PHP Xml::buildForm怎么用?PHP Xml::buildForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xml
的用法示例。
在下文中一共展示了Xml::buildForm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
function show()
{
global $wgOut, $wgUser, $wgRequest;
AbuseFilter::disableConditionLimit();
if (!$wgUser->isAllowed('abusefilter-modify')) {
$wgOut->addWikiMsg('abusefilter-mustbeeditor');
return;
}
$this->loadParameters();
$wgOut->setPageTitle(wfMsg('abusefilter-test'));
$wgOut->addWikiMsg('abusefilter-test-intro', self::$mChangeLimit);
$output = '';
$output .= AbuseFilter::buildEditBox($this->mFilter, 'wpTestFilter') . "\n";
$output .= Xml::inputLabel(wfMsg('abusefilter-test-load-filter'), 'wpInsertFilter', 'mw-abusefilter-load-filter', 10, '') . ' ' . Xml::element('input', array('type' => 'button', 'value' => wfMsg('abusefilter-test-load'), 'id' => 'mw-abusefilter-load'));
$output = Xml::tags('div', array('id' => 'mw-abusefilter-test-editor'), $output);
$output .= Xml::tags('p', null, Xml::checkLabel(wfMsg('abusefilter-test-shownegative'), 'wpShowNegative', 'wpShowNegative', $this->mShowNegative));
// Selectory stuff
$selectFields = array();
$selectFields['abusefilter-test-user'] = Xml::input('wpTestUser', 45, $this->mTestUser);
$selectFields['abusefilter-test-period-start'] = Xml::input('wpTestPeriodStart', 45, $this->mTestPeriodStart);
$selectFields['abusefilter-test-period-end'] = Xml::input('wpTestPeriodEnd', 45, $this->mTestPeriodEnd);
$selectFields['abusefilter-test-page'] = Xml::input('wpTestPage', 45, $this->mTestPage);
$output .= Xml::buildForm($selectFields, 'abusefilter-test-submit');
$output .= Html::hidden('title', $this->getTitle('test')->getPrefixedText());
$output = Xml::tags('form', array('action' => $this->getTitle('test')->getLocalURL(), 'method' => 'post'), $output);
$output = Xml::fieldset(wfMsg('abusefilter-test-legend'), $output);
$wgOut->addHTML($output);
if ($wgRequest->wasPosted()) {
$this->doTest();
}
}
示例2: showList
function showList($conds = array('af_deleted' => 0), $optarray = array())
{
global $wgAbuseFilterCentralDB, $wgAbuseFilterIsCentral;
$output = '';
$output .= Xml::element('h2', null, $this->msg('abusefilter-list')->parse());
$pager = new AbuseFilterPager($this, $conds);
$deleted = $optarray['deleted'];
$hidedisabled = $optarray['hidedisabled'];
$scope = $optarray['scope'];
# Options form
$fields = array();
$fields['abusefilter-list-options-deleted'] = Xml::radioLabel($this->msg('abusefilter-list-options-deleted-show')->text(), 'deletedfilters', 'show', 'mw-abusefilter-deletedfilters-show', $deleted == 'show') . Xml::radioLabel($this->msg('abusefilter-list-options-deleted-hide')->text(), 'deletedfilters', 'hide', 'mw-abusefilter-deletedfilters-hide', $deleted == 'hide') . Xml::radioLabel($this->msg('abusefilter-list-options-deleted-only')->text(), 'deletedfilters', 'only', 'mw-abusefilter-deletedfilters-only', $deleted == 'only');
if (isset($wgAbuseFilterCentralDB) && !$wgAbuseFilterIsCentral) {
$fields['abusefilter-list-options-scope'] = Xml::radioLabel($this->msg('abusefilter-list-options-scope-local')->text(), 'rulescope', 'local', 'mw-abusefilter-rulescope-local', $scope == 'local') . Xml::radioLabel($this->msg('abusefilter-list-options-scope-global')->text(), 'rulescope', 'global', 'mw-abusefilter-rulescope-global', $scope == 'global');
}
$fields['abusefilter-list-options-disabled'] = Xml::checkLabel($this->msg('abusefilter-list-options-hidedisabled')->text(), 'hidedisabled', 'mw-abusefilter-disabledfilters-hide', $hidedisabled);
$fields['abusefilter-list-limit'] = $pager->getLimitSelect();
$options = Xml::buildForm($fields, 'abusefilter-list-options-submit');
$options .= Html::hidden('title', $this->getTitle()->getPrefixedText());
$options = Xml::tags('form', array('method' => 'get', 'action' => $this->getTitle()->getFullURL()), $options);
$options = Xml::fieldset($this->msg('abusefilter-list-options')->text(), $options);
$output .= $options;
if (isset($wgAbuseFilterCentralDB) && !$wgAbuseFilterIsCentral && $scope == 'global') {
$globalPager = new GlobalAbuseFilterPager($this, $conds);
$output .= $globalPager->getNavigationBar() . $globalPager->getBody() . $globalPager->getNavigationBar();
} else {
$output .= $pager->getNavigationBar() . $pager->getBody() . $pager->getNavigationBar();
}
$this->getOutput()->addHTML($output);
}
示例3: show
function show($params)
{
global $wgOut, $wgUser, $wgLang;
$dqi = DeleteQueueItem::newFromId($params[1]);
if (!$dqi) {
$wgOut->setPageTitle(wfMsg('deletequeue-case-no-case-title'));
$wgOut->addWikiMsg('deletequeue-case-no-case', $params[1]);
return;
}
$wgOut->setPageTitle(wfMsg('deletequeue-case-title'));
$wgOut->addWikiMsg('deletequeue-case-intro');
if (wfTimestamp(TS_UNIX, $dqi->getExpiry()) < time() && $wgUser->isAllowed($dqi->getQueue() . '-review')) {
$wgOut->addWikiMsg('deletequeue-case-needs-review', $this->getTitle("case/" . $params[1] . "/review"));
}
// Show basic data
$sk = $wgUser->getSkin();
$fields = array();
$fields['deletequeue-case-page'] = $sk->link($this->getTitle());
$fields['deletequeue-case-reason'] = DeleteQueueInterface::formatReason(null, $dqi->getReason());
$expiry = $dqi->getExpiry();
if ($expiry) {
$fields['deletequeue-case-expiry'] = $wgLang->timeanddate($expiry);
}
$fields['deletequeue-case-votes'] = $dqi->formatVoteCount();
$wgOut->addHTML(Xml::element('h2', null, wfMsg('deletequeue-case-details')) . Xml::buildForm($fields) . Xml::element('h2', null, wfMsg('deletequeue-case-votes')));
$article = $dqi->getArticle();
$this->showVotes($article, $dqi);
}
示例4: showList
function showList()
{
global $wgOut, $wgScript;
$errors = array();
// Validate search IP
$ip = $this->mSearchIP;
if (!IP::isIPAddress($ip) && strlen($ip)) {
$errors[] = array('globalblocking-list-ipinvalid', $ip);
$ip = '';
}
$wgOut->addWikiMsg('globalblocking-list-intro');
// Build the search form
$searchForm = '';
$searchForm .= Xml::openElement('fieldset') . Xml::element('legend', null, wfMsg('globalblocking-search-legend'));
$searchForm .= Xml::openElement('form', array('method' => 'get', 'action' => $wgScript, 'name' => 'globalblocklist-search'));
$searchForm .= Html::hidden('title', SpecialPage::getTitleFor('GlobalBlockList')->getPrefixedText());
if (is_array($errors) && count($errors) > 0) {
$errorstr = '';
foreach ($errors as $error) {
if (is_array($error)) {
$msg = array_shift($error);
} else {
$msg = $error;
$error = array();
}
$errorstr .= Xml::tags('li', null, wfMsgExt($msg, array('parseinline'), $error));
}
$wgOut->addWikiMsg('globalblocking-unblock-errors', count($errors));
$wgOut->addHTML(Xml::tags('ul', array('class' => 'error'), $errorstr));
}
$fields = array();
$fields['globalblocking-search-ip'] = Xml::input('ip', 45, $ip);
$searchForm .= Xml::buildForm($fields, 'globalblocking-search-submit');
$searchForm .= Xml::closeElement('form') . Xml::closeElement('fieldset');
$wgOut->addHTML($searchForm);
// Build a list of blocks.
$conds = array();
if (strlen($ip)) {
list($range_start, $range_end) = IP::parseRange($ip);
if ($range_start != $range_end) {
// They searched for a range. Match that exact range only
$conds = array('gb_address' => $ip);
} else {
// They searched for an IP. Match any range covering that IP
$hex_ip = IP::toHex($ip);
$ip_pattern = substr($hex_ip, 0, 4) . '%';
// Don't bother checking blocks out of this /16.
$dbr = wfGetDB(DB_SLAVE);
$conds = array('gb_range_end>=' . $dbr->addQuotes($hex_ip), 'gb_range_start<=' . $dbr->addQuotes($hex_ip), 'gb_range_start like ' . $dbr->addQuotes($ip_pattern), 'gb_expiry>' . $dbr->addQuotes($dbr->timestamp(wfTimestampNow())));
}
}
$pager = new GlobalBlockListPager($this, $conds);
$body = $pager->getBody();
if ($body != '') {
$wgOut->addHTML($pager->getNavigationBar() . Html::rawElement('ul', array(), $body) . $pager->getNavigationBar());
} else {
$wgOut->wrapWikiMsg("<div class='mw-globalblocking-noresults'>\n\$1</div>\n", array('globalblocking-list-noresults'));
}
}
示例5: show
public function show($params)
{
global $wgOut;
$wgOut->setPageTitle(wfMsg('deletequeue'));
$this->loadSearch();
// Intro text
$wgOut->addWikiMsg('deletequeue-list-text');
// Search box
$searchBox = array();
// // Queue selector
$selector = Xml::openElement('select', array('name' => 'queue')) . "\n";
$queues = array('speedy', 'prod', 'deletediscuss');
$attribs = array('value' => '');
if (in_array($this->mQueue, $queues)) {
$attribs['selected'] = 'selected';
}
$selector .= Xml::element('option', $attribs, wfMsg('deletequeue-list-anyqueue'));
foreach ($queues as $queue) {
$attribs = array('value' => $queue);
if ($this->mQueue == $queue) {
$attribs['selected'] = 'selected';
}
$selector .= Xml::element('option', $attribs, wfMsg("deletequeue-queue-{$queue}"));
}
$selector .= Xml::closeElement('select');
$searchBox['deletequeue-list-queue'] = $selector;
$searchBox['deletequeue-list-status'] = Xml::checkLabel(wfMsg('deletequeue-list-expired'), 'expired', 'mw-dq-expired', $this->mExpired);
$searchBox = Xml::buildForm($searchBox, 'deletequeue-list-search');
$searchBox .= Html::Hidden('title', $this->getTitle()->getPrefixedText());
$searchBox = Xml::tags('form', array('action' => $this->getTitle()->getFullURL(), 'method' => 'get'), $searchBox);
$searchBox = Xml::fieldset(wfMsg('deletequeue-list-search-legend'), $searchBox);
$wgOut->addHTML($searchBox);
$conds = array('dq_active' => 1);
if ($this->mQueue) {
$conds['dq_queue'] = $this->mQueue;
}
if ($this->mExpired) {
$dbr = wfGetDB(DB_SLAVE);
$conds[] = 'dq_expiry<' . $dbr->addQuotes($dbr->timestamp(wfTimestampNow()));
}
// Headers
$body = '';
$headers = array('page', 'queue', 'votes', 'expiry', 'discusspage');
foreach ($headers as $header) {
$body .= Xml::element('th', null, wfMsg("deletequeue-list-header-{$header}")) . "\n";
}
$body = Xml::tags('tr', null, $body);
// The list itself
$pager = new DeleteQueuePager($conds);
$body .= $pager->getBody();
$body = Xml::tags('table', array('class' => 'wikitable'), $body);
$wgOut->addHTML($pager->getNavigationBar() . $body . $pager->getNavigationBar());
}
示例6: searchForm
function searchForm()
{
$output = Html::element('legend', null, $this->msg('majorchanges-log-filter')->text());
$fields = array();
// Search conditions
$fields['majorchanges-log-user-filter'] = Html::input('wpUserFilter', $this->mUserFilter);
$fields['majorchanges-log-title-filter'] = Html::input('wpTitleFilter', $this->mTitleFilter);
/*
$fields['majorchanges-log-tag-filter'] =
Html::input( 'wpRevTagFilter', $this->mRevTagFilter );
*/
$fields['majorchanges-log-mode-filter'] = $this->getModeFilter();
$output .= Xml::tags('form', array('method' => 'get', 'action' => $this->getPageTitle()->getLocalURL()), Xml::buildForm($fields, 'htmlform-submit') . Html::hidden('title', $this->getPageTitle()->getPrefixedDBkey()));
$output = Xml::tags('fieldset', null, $output);
$this->getOutput()->addHTML($output);
}
示例7: searchForm
function searchForm()
{
$output = Xml::element('legend', null, wfMsg('abusefilter-log-search'));
$fields = array();
// Search conditions
$fields['abusefilter-log-search-user'] = Xml::input('wpSearchUser', 45, $this->mSearchUser);
if (self::canSeeDetails()) {
$fields['abusefilter-log-search-filter'] = Xml::input('wpSearchFilter', 45, $this->mSearchFilter);
}
$fields['abusefilter-log-search-title'] = Xml::input('wpSearchTitle', 45, $this->mSearchTitle);
$form = Html::hidden('title', $this->getTitle()->getPrefixedText());
$form .= Xml::buildForm($fields, 'abusefilter-log-search-submit');
$output .= Xml::tags('form', array('method' => 'get', 'action' => $this->getTitle()->getLocalURL()), $form);
$output = Xml::tags('fieldset', null, $output);
$this->getOutput()->addHTML($output);
}
示例8: show
function show()
{
$filter = $this->mPage->mFilter;
global $wgUser, $wgRequest, $wgOut;
$sk = $wgUser->getSkin();
if (!$wgUser->isAllowed('abusefilter-revert')) {
$wgOut->permissionRequired('abusefilter-revert');
return;
}
$this->loadParameters();
if ($this->attemptRevert()) {
return;
}
$wgOut->addWikiMsg('abusefilter-revert-intro', $filter);
$wgOut->setPageTitle(wfMsg('abusefilter-revert-title', $filter));
// First, the search form.
$searchFields = array();
$searchFields['abusefilter-revert-filter'] = Xml::element('strong', null, $filter);
$searchFields['abusefilter-revert-periodstart'] = Xml::input('wpPeriodStart', 45, $this->origPeriodStart);
$searchFields['abusefilter-revert-periodend'] = Xml::input('wpPeriodEnd', 45, $this->origPeriodEnd);
$searchForm = Xml::buildForm($searchFields, 'abusefilter-revert-search');
$searchForm .= "\n" . Xml::hidden('submit', 1);
$searchForm = Xml::tags('form', array('action' => $this->getTitle("revert/{$filter}")->getLocalURL(), 'method' => 'POST'), $searchForm);
$searchForm = Xml::fieldset(wfMsg('abusefilter-revert-search-legend'), $searchForm);
$wgOut->addHTML($searchForm);
if ($this->mSubmit) {
// Add a summary of everything that will be reversed.
$wgOut->addWikiMsg('abusefilter-revert-preview-intro');
// Look up all of them.
$results = $this->doLookup();
$list = array();
foreach ($results as $result) {
$displayActions = array();
global $wgLang;
$displayActions = array_map(array('AbuseFilter', 'getActionDisplay'), $result['actions']);
$msg = wfMsgExt('abusefilter-revert-preview-item', array('parseinline', 'replaceafter'), array($wgLang->timeanddate($result['timestamp'], true), $sk->userLink($result['userid'], $result['user']), $result['action'], $sk->link($result['title']), $wgLang->commaList($displayActions), $sk->link(SpecialPage::getTitleFor('AbuseLog'), wfMsgNoTrans('abusefilter-log-detailslink'), array(), array('details' => $result['id']))));
$list[] = Xml::tags('li', null, $msg);
}
$wgOut->addHTML(Xml::tags('ul', null, implode("\n", $list)));
// Add a button down the bottom.
$confirmForm = Xml::hidden('editToken', $wgUser->editToken("abusefilter-revert-{$filter}")) . Xml::hidden('title', $this->getTitle("revert/{$filter}")->getPrefixedText()) . Xml::hidden('wpPeriodStart', $this->origPeriodStart) . Xml::hidden('wpPeriodEnd', $this->origPeriodEnd) . Xml::inputLabel(wfMsg('abusefilter-revert-reasonfield'), 'wpReason', 'wpReason', 45) . "\n" . Xml::submitButton(wfMsg('abusefilter-revert-confirm'));
$confirmForm = Xml::tags('form', array('action' => $this->getTitle("revert/{$filter}")->getLocalURL(), 'method' => 'post'), $confirmForm);
$wgOut->addHTML($confirmForm);
}
}
示例9: process
/**
* Process the 'delvote' action.
* @param Article $article The article to endorse/object to deletion of.
*/
public function process($article)
{
global $wgRequest, $wgOut, $wgUser;
$errs = $article->mTitle->getUserPermissionsErrors('deletequeue-vote', $wgUser);
if (count($errs) > 0) {
$wgOut->showPermissionsErrorPage($errs);
return;
}
$dqi = DeleteQueueItem::newFromArticle($article);
$wgOut->setPageTitle(wfMsg('deletequeue-vote-title', $article->mTitle->getPrefixedText()));
// Load form data
$token = $wgRequest->getVal('wpEditToken');
$action = $wgRequest->getVal('wpVote');
$comments = $wgRequest->getText('wpComments');
if ($wgUser->matchEditToken($token) && in_array($action, array('endorse', 'object'))) {
$dqi->addVote($action, $comments);
if ($action == 'object' && $dqi->getQueue() == 'prod') {
$dbw = wfGetDB(DB_MASTER);
$dbw->begin();
$dqi->setQueue('deletediscuss', $dqi->getReason());
$lp = new LogPage('delete');
$lp->addEntry('requeue', $article->mTitle, $comments, array(wfMsgForContent('deletequeue-queue-prod'), wfMsgForContent("deletequeue-queue-deletediscuss")));
$dbw->commit();
$wgOut->addWikiMsg('deletequeue-vote-requeued', wfMsgNoTrans('deletequeue-queue-deletediscuss'));
} else {
$wgOut->addWikiMsg("deletequeue-vote-success-{$action}");
}
return;
}
$wgOut->addWikiMsg('deletequeue-vote-text', $article->mTitle->getPrefixedText(), $dqi->getReason());
// Add main form.
$fields = array();
$options = Xml::tags('p', null, Xml::radioLabel(wfMsg('deletequeue-vote-endorse'), 'wpVote', 'endorse', 'mw-deletequeue-vote-endorse'));
$options .= Xml::tags('p', null, Xml::radioLabel(wfMsg('deletequeue-vote-object'), 'wpVote', 'object', 'mw-deletequeue-vote-object'));
$fields['deletequeue-vote-action'] = $options;
$fields['deletequeue-vote-reason'] = Xml::input('wpComments', 45, $comments);
$article_id = $article->getId();
$title = $this->getTitle("vote/{$article_id}");
$form = Xml::buildForm($fields, 'deletequeue-vote-submit') . Html::Hidden('wpEditToken', $wgUser->editToken()) . Html::Hidden('title', $title->getPrefixedText());
$form = Xml::tags('form', array('action' => $title->getLocalURL(), 'method' => 'POST'), $form);
$form = Xml::fieldset(wfMsg('deletequeue-vote-legend'), $form);
$wgOut->addHTML($form);
}
示例10: showSearch
function showSearch()
{
// Add selector
$selector = '';
$selectFields = array();
# Same fields as in Test
$selectFields['abusefilter-test-user'] = Xml::input('wpSearchUser', 45, $this->mSearchUser);
$selectFields['abusefilter-test-period-start'] = Xml::input('wpSearchPeriodStart', 45, $this->mSearchPeriodStart);
$selectFields['abusefilter-test-period-end'] = Xml::input('wpSearchPeriodEnd', 45, $this->mSearchPeriodEnd);
$selector .= Xml::buildForm($selectFields, 'abusefilter-examine-submit');
$selector .= Html::hidden('submit', 1);
$selector .= Html::hidden('title', $this->getTitle('examine')->getPrefixedText());
$selector = Xml::tags('form', array('action' => $this->getTitle('examine')->getLocalURL(), 'method' => 'get'), $selector);
$selector = Xml::fieldset($this->msg('abusefilter-examine-legend')->text(), $selector);
$this->getOutput()->addHTML($selector);
if ($this->mSubmit) {
$this->showResults();
}
}
示例11: wfSpecialRemoveRestrictions
function wfSpecialRemoveRestrictions()
{
global $wgOut, $wgRequest, $wgUser, $wgLang;
$sk = $wgUser->getSkin();
$title = SpecialPage::getTitleFor('RemoveRestrictions');
$id = $wgRequest->getVal('id');
if (!is_numeric($id)) {
$wgOut->addWikiMsg('removerestrictions-noid');
return;
}
UserRestriction::purgeExpired();
$r = UserRestriction::newFromId($id, true);
if (!$r) {
$wgOut->addWikiMsg('removerestrictions-wrongid');
return;
}
$form = array();
$form['removerestrictions-user'] = $sk->userLink($r->getSubjectId(), $r->getSubjectText()) . $sk->userToolLinks($r->getSubjectId(), $r->getSubjectText());
$form['removerestrictions-type'] = UserRestriction::formatType($r->getType());
if ($r->isPage()) {
$form['removerestrictions-page'] = $sk->link($r->getPage());
}
if ($r->isNamespace()) {
$form['removerestrictions-namespace'] = $wgLang->getDisplayNsText($r->getNamespace());
}
$form['removerestrictions-reason'] = Xml::input('reason');
$result = null;
if ($wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getVal('edittoken'))) {
$result = wfSpecialRemoveRestrictionsProcess($r);
}
$wgOut->addWikiMsg('removerestrictions-intro');
$wgOut->addHTML(Xml::fieldset(wfMsgHtml('removerestrictions-legend')));
if ($result) {
$wgOut->addHTML('<strong class="success">' . wfMsgExt('removerestrictions-success', 'parseinline', $r->getSubjectText()) . '</strong>');
}
$wgOut->addHTML(Xml::openElement('form', array('action' => $title->getLocalUrl(array('id' => $id)), 'method' => 'post')));
$wgOut->addHTML(Xml::buildForm($form, 'removerestrictions-submit'));
$wgOut->addHTML(Xml::hidden('id', $r->getId()));
$wgOut->addHTML(Xml::hidden('title', $title->getPrefixedDbKey()));
$wgOut->addHTML(Xml::hidden('edittoken', $wgUser->editToken()));
$wgOut->addHTML("</form></fieldset>");
}
示例12: showList
function showList($conds = array('af_deleted' => 0), $optarray = array())
{
$output = '';
$output .= Xml::element('h2', null, wfMsgExt('abusefilter-list', array('parseinline')));
$pager = new AbuseFilterPager($this, $conds);
$deleted = $optarray['deleted'];
$hidedisabled = $optarray['hidedisabled'];
# Options form
$fields = array();
$fields['abusefilter-list-options-deleted'] = Xml::radioLabel(wfMsg('abusefilter-list-options-deleted-show'), 'deletedfilters', 'show', 'mw-abusefilter-deletedfilters-show', $deleted == 'show') . Xml::radioLabel(wfMsg('abusefilter-list-options-deleted-hide'), 'deletedfilters', 'hide', 'mw-abusefilter-deletedfilters-hide', $deleted == 'hide') . Xml::radioLabel(wfMsg('abusefilter-list-options-deleted-only'), 'deletedfilters', 'only', 'mw-abusefilter-deletedfilters-only', $deleted == 'only');
$fields['abusefilter-list-options-disabled'] = Xml::checkLabel(wfMsg('abusefilter-list-options-hidedisabled'), 'hidedisabled', 'mw-abusefilter-disabledfilters-hide', $hidedisabled);
$fields['abusefilter-list-limit'] = $pager->getLimitSelect();
$options = Xml::buildForm($fields, 'abusefilter-list-options-submit');
$options .= Html::hidden('title', $this->getTitle()->getPrefixedText());
$options = Xml::tags('form', array('method' => 'get', 'action' => $this->getTitle()->getFullURL()), $options);
$options = Xml::fieldset(wfMsg('abusefilter-list-options'), $options);
$output .= $options;
$output .= $pager->getNavigationBar() . $pager->getBody() . $pager->getNavigationBar();
$this->getOutput()->addHTML($output);
}
示例13: show
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());
}
示例14: displayNavigation
private function displayNavigation()
{
global $wgOut;
$groupSelector = new XmlSelect('group', 'group-select');
// pull groups
$groups = MessageGroups::singleton()->getGroups();
foreach ($groups as $group) {
if (!$group->isMeta()) {
continue;
}
$groupSelector->addOption($group->getLabel(), $group->getId());
}
$fields = array();
$fields['transstats-choose-group'] = $groupSelector->getHTML();
$fields['transstats-breakdown'] = Xml::check('breakdown', false);
$out = Xml::openElement('form');
$out .= Xml::buildForm($fields);
$out .= Xml::submitButton(wfMsg('transstats-submit'));
$out .= Xml::closeElement('form');
$wgOut->addHTML($out);
}
示例15: show
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());
}