本文整理汇总了PHP中Xml::input方法的典型用法代码示例。如果您正苦于以下问题:PHP Xml::input方法的具体用法?PHP Xml::input怎么用?PHP Xml::input使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xml
的用法示例。
在下文中一共展示了Xml::input方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute($parameters)
{
global $wgOut, $wgRequest, $wgDisableTextSearch, $wgScript;
$this->setHeaders();
list($limit, $offset) = wfCheckLimits();
$wgOut->addWikiText(wfMsgForContentNoTrans('proofreadpage_specialpage_text'));
$this->searchList = null;
$this->searchTerm = $wgRequest->getText('key');
$this->suppressSqlOffset = false;
if (!$wgDisableTextSearch) {
$self = $this->getTitle();
$wgOut->addHTML(Xml::openElement('form', array('action' => $wgScript)) . Html::hidden('title', $this->getTitle()->getPrefixedText()) . Xml::input('limit', false, $limit, array('type' => 'hidden')) . Xml::openElement('fieldset') . Xml::element('legend', null, wfMsg('proofreadpage_specialpage_legend')) . Xml::input('key', 20, $this->searchTerm) . ' ' . Xml::submitButton(wfMsg('ilsubmit')) . Xml::closeElement('fieldset') . Xml::closeElement('form'));
if ($this->searchTerm) {
$index_namespace = $this->index_namespace;
$index_ns_index = MWNamespace::getCanonicalIndex(strtolower(str_replace(' ', '_', $index_namespace)));
$searchEngine = SearchEngine::create();
$searchEngine->setLimitOffset($limit, $offset);
$searchEngine->setNamespaces(array($index_ns_index));
$searchEngine->showRedirects = false;
$textMatches = $searchEngine->searchText($this->searchTerm);
$escIndex = preg_quote($index_namespace, '/');
$this->searchList = array();
while ($result = $textMatches->next()) {
$title = $result->getTitle();
if ($title->getNamespace() == $index_ns_index) {
array_push($this->searchList, $title->getDBkey());
}
}
$this->suppressSqlOffset = true;
}
}
parent::execute($parameters);
}
示例2: 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();
}
}
示例3: constructCreateForm
function constructCreateForm()
{
global $wgOut, $wgScript;
global $wgUserProperties, $wgActivityModes;
$wgOut->addHTML(Xml::openElement('form', array('action' => $this->getTitle()->getLocalURL(), 'method' => 'post')));
$wgOut->addHTML(Xml::element('h2', null, wfMsg('nss-create-account-header')) . "\n");
$wgOut->addHTML("<table border=\"1\" id=\"newuser\">\n");
$props = array_merge(array('username', 'email'), $wgUserProperties);
foreach ($props as $i) {
$msg = 'am-' . $i;
$wgOut->addHTML("\t<tr><th>" . (wfEmptyMsg($msg, wfMsg($msg)) ? $i : wfMsgHtml($msg)) . "</th><td>" . Xml::input("am-" . str_replace(' ', '_', $i), 40) . "</td></tr>\n");
}
global $wgActivityModes;
$select = new XmlSelect("am-active");
$select->setDefault('active');
$select->setAttribute('width', '100%');
foreach ($wgActivityModes as $key) {
$select->addOption($key);
}
$wgOut->addHTML("\t<tr><th>" . wfMsgHtml('am-active') . "</th><td>" . $select->getHTML() . "</td></tr>\n");
$wgOut->addHTML("</table>\n");
$wgOut->addHTML("<div id=\"newaccount-submit\">\n" . Html::Hidden('action', 'create') . Xml::checkLabel(wfMsg('nss-no-mail'), 'nss-no-mail', 'nss-no-mail') . "<br />\n" . Xml::element('input', array('type' => 'submit', 'value' => wfMsg('nss-create-account'))) . "</div>\n</form>\n");
$wgOut->addHTML(Xml::openElement('form', array('action' => $this->getTitle()->getLocalURL(), 'method' => 'post')));
$wgOut->addHTML("<div id=\"newaccount-raw\">\n" . Xml::textarea('nss-create-account-raw', '') . "\n" . Html::Hidden('action', 'create-raw') . Xml::checkLabel(wfMsg('nss-no-mail'), 'nss-no-mail', 'nss-no-mail') . "<br />\n" . Xml::element('input', array('type' => 'submit', 'value' => wfMsg('nss-create-account'))) . "</div>\n</form>\n");
}
示例4: showForm
function showForm($err = '')
{
global $wgOut, $wgUser, $wgLang;
$wgOut->setPagetitle(wfMsg("makesysoptitle"));
$wgOut->addWikiText(wfMsg("makesysoptext"));
$titleObj = Title::makeTitle(NS_SPECIAL, "Makesysop");
$action = $titleObj->getLocalUrl("action=submit");
if ($wgUser->isAllowed('userrights')) {
$wgOut->addWikiText(wfMsg('makesysop-see-userrights'));
}
if ("" != $err) {
$wgOut->setSubtitle(wfMsg("formerror"));
$wgOut->addHTML("<p class='error'>{$err}</p>\n");
}
$namedesc = wfMsg("makesysopname");
if (!is_null($this->mUser)) {
$encUser = htmlspecialchars($this->mUser);
} else {
$encUser = "";
}
$reason = htmlspecialchars(wfMsg("userrights-reason"));
$makebureaucrat = wfMsg("setbureaucratflag");
$mss = wfMsg("set_user_rights");
$wgOut->addHTML(Xml::openElement('form', array('method' => 'post', 'action' => $action, 'id' => 'makesysop')) . Xml::openElement('fieldset') . Xml::element('legend', array(), wfMsg('makesysoptitle')) . "<table border='0'>\n\t\t\t<tr>\n\t\t\t\t<td align='right'>{$namedesc}</td>\n\t\t\t\t<td align='left'>" . Xml::input('wpMakesysopUser', 40, $encUser) . "</td>\n\t\t\t</tr><tr>\n\t\t\t\t<td align='right'>{$reason}</td>\n\t\t\t\t<td align='left'>" . Xml::input('wpMakesysopReason', 40, $this->mReason, array('maxlength' => 255)) . "</td>\n\t\t\t</tr><tr>\n\t\t\t\t<td> </td>\n\t\t\t\t<td align='left'>" . Xml::checkLabel($makebureaucrat, 'wpSetBureaucrat', 'wpSetBureaucrat', $this->mSetBureaucrat) . "</td>\n\t\t\t</tr><tr>\n\t\t\t\t<td> </td>\n\t\t\t\t<td align='left'>" . Xml::submitButton($mss, array('name' => 'wpMakesysopSubmit')) . "</td>\n\t\t\t</tr>\n\t\t\t</table>" . Xml::hidden('wpEditToken', $wgUser->editToken()) . Xml::closeElement('fieldset') . Xml::closeElement('form') . "\n");
}
示例5: addRequestWikiForm
function addRequestWikiForm()
{
$localpage = $this->getPageTitle()->getLocalUrl();
$form = Xml::openElement('form', array('action' => $localpage, 'method' => 'post'));
$form .= '<fieldset><legend>' . $this->msg('requestwiki')->escaped() . '</legend>';
$form .= Xml::openElement('table');
$form .= '<tr><td>' . $this->msg('requestwiki-label-siteurl')->escaped() . '</td>';
$form .= '<td>' . Xml::input('subdomain', 20, '') . '.miraheze.org' . '</td></tr>';
$form .= '<tr><td>' . $this->msg('requestwiki-label-sitename')->escaped() . '</td>';
$form .= '<td>' . Xml::input('sitename', 20, '', array('required' => '')) . '</td></tr>';
$form .= '<tr><td>' . $this->msg('requestwiki-label-customdomain')->escaped() . '</td>';
$form .= '<td>' . Xml::input('customdomain', 20, '') . '</td></tr>';
$form .= '<tr><td>' . $this->msg('requestwiki-label-language')->escaped() . '</td>';
$form .= '<td>' . Xml::languageSelector('en', true, null, array('name' => 'language'))[1] . '</td></tr>';
$form .= '<tr><td>' . $this->msg('requestwiki-label-private')->escaped() . '</td>';
$form .= '<td>' . Xml::check('private', false, array('value' => 0)) . '</td></tr>';
$form .= '<tr><td>' . $this->msg('requestwiki-label-comments')->escaped() . '</td>';
$form .= '<td>' . Xml::textarea('comments', '', 40, 5, array('required' => '')) . '</td></tr>';
$form .= '<tr><td>' . Xml::submitButton($this->msg('requestwiki-submit')->plain()) . '</td></tr>';
$form .= Xml::closeElement('table');
$form .= '</fieldset>';
$form .= Html::hidden('token', $this->getUser()->getEditToken());
$form .= Xml::closeElement('form');
$this->getOutput()->addHTML($form);
}
示例6: showForm
public function showForm()
{
global $wgScript;
# Explanatory text
$this->getOutput()->addWikiMsg('pendingchanges-list', $this->getLang()->formatNum($this->pager->getNumRows()));
$form = Html::openElement('form', array('name' => 'pendingchanges', 'action' => $wgScript, 'method' => 'get')) . "\n";
$form .= "<fieldset><legend>" . wfMsgHtml('pendingchanges-legend') . "</legend>\n";
$form .= Html::hidden('title', $this->getTitle()->getPrefixedDBKey()) . "\n";
$items = array();
if (count(FlaggedRevs::getReviewNamespaces()) > 1) {
$items[] = "<span style='white-space: nowrap;'>" . FlaggedRevsXML::getNamespaceMenu($this->namespace, '') . '</span>';
}
if (FlaggedRevs::qualityVersions()) {
$items[] = "<span style='white-space: nowrap;'>" . FlaggedRevsXML::getLevelMenu($this->level, 'revreview-filter-stable') . '</span>';
}
if (!FlaggedRevs::isStableShownByDefault() && !FlaggedRevs::useOnlyIfProtected()) {
$items[] = "<span style='white-space: nowrap;'>" . Xml::check('stable', $this->stable, array('id' => 'wpStable')) . Xml::label(wfMsg('pendingchanges-stable'), 'wpStable') . '</span>';
}
if ($items) {
$form .= implode(' ', $items) . '<br />';
}
$items = array();
$items[] = Xml::label(wfMsg("pendingchanges-category"), 'wpCategory') . ' ' . Xml::input('category', 30, $this->category, array('id' => 'wpCategory'));
if ($this->getUser()->getId()) {
$items[] = Xml::check('watched', $this->watched, array('id' => 'wpWatched')) . Xml::label(wfMsg('pendingchanges-onwatchlist'), 'wpWatched');
}
$form .= implode(' ', $items) . '<br />';
$form .= Xml::label(wfMsg('pendingchanges-size'), 'wpSize') . Xml::input('size', 4, $this->size, array('id' => 'wpSize')) . ' ' . Xml::submitButton(wfMsg('allpagessubmit')) . "\n";
$form .= "</fieldset>";
$form .= Html::closeElement('form') . "\n";
$this->getOutput()->addHTML($form);
}
示例7: promptForm
/**
* Prompt for a username or IP address.
*
* @param $userName string
*/
protected function promptForm($userName = '')
{
$out = $this->getOutput();
$out->addModules('mediawiki.userSuggest');
$out->addWikiMsg('nuke-tools');
$out->addHTML(Xml::openElement('form', array('action' => $this->getPageTitle()->getLocalURL('action=submit'), 'method' => 'post')) . '<table><tr>' . '<td>' . Xml::label($this->msg('nuke-userorip')->text(), 'nuke-target') . '</td>' . '<td>' . Xml::input('target', 40, $userName, array('id' => 'nuke-target', 'class' => 'mw-autocomplete-user', 'autofocus' => true)) . '</td>' . '</tr><tr>' . '<td>' . Xml::label($this->msg('nuke-pattern')->text(), 'nuke-pattern') . '</td>' . '<td>' . Xml::input('pattern', 40, '', array('id' => 'nuke-pattern')) . '</td>' . '</tr><tr>' . '<td>' . Xml::label($this->msg('nuke-namespace')->text(), 'nuke-namespace') . '</td>' . '<td>' . Html::namespaceSelector(array('all' => 'all'), array('name' => 'namespace')) . '</td>' . '</tr><tr>' . '<td>' . Xml::label($this->msg('nuke-maxpages')->text(), 'nuke-limit') . '</td>' . '<td>' . Xml::input('limit', 7, '500', array('id' => 'nuke-limit')) . '</td>' . '</tr><tr>' . '<td></td>' . '<td>' . Xml::submitButton($this->msg('nuke-submit-user')->text()) . '</td>' . '</tr></table>' . Html::hidden('wpEditToken', $this->getUser()->getEditToken()) . Xml::closeElement('form'));
}
示例8: 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'));
}
}
示例9: onSpecialListusersHeaderForm
/**
* Input form
*/
static function onSpecialListusersHeaderForm( $pager, &$out ) {
$testwiki = IncubatorTest::getUrlParam();
$project = self::getProjectInput();
$input = $project ? $project['name'] : ( $testwiki ? $testwiki['prefix'] : null );
$out .= Xml::label( wfMsg( 'wminc-testwiki' ), 'testwiki' ) . ' ' .
Xml::input( 'testwiki', 20, $input, array( 'id' => 'testwiki' ) ) . '<br />';
return true;
}
示例10: getForm
/** Produce a nice little form */
function getForm()
{
list($sum, $answer) = $this->pickSum();
$index = $this->storeCaptcha(array('answer' => $answer));
$form = '<table><tr><td>' . $this->fetchMath($sum) . '</td>';
$form .= '<td>' . Xml::input('wpCaptchaWord', false, false, array('tabindex' => '1')) . '</td></tr></table>';
$form .= Html::hidden('wpCaptchaId', $index);
return $form;
}
示例11: makeSearchForm
private function makeSearchForm( $process, $wild = false ) {
$self = SpecialPage::getTitleFor( 'Profiling' );
$html = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) );
$html .= '<table><tr><td>' . wfMsgHtml( 'profiling-process' ) . '</td><td>';
$html .= Xml::input( 'process', 50, $process ) . '</td></tr><td align="right">' . Xml::check( 'wildcard', $wild ) . '</td>';
$html .= '<td>' . wfMsgHtml( 'profiling-wildcard' ) . '</td></tr>';
$html .= '<tr><td> </td><td>' . Xml::submitButton( wfMsg( 'profiling-ok' ), array( 'name' => 'submit' ) ) . '</td></table></form>';
return $html;
}
示例12: promptForm
function promptForm()
{
global $wgOut;
$input = Xml::input('target', 40);
$submit = Xml::submitButton(wfMsg('nuke-submit-user'));
$wgOut->addWikiMsg('nuke-tools');
$wgOut->addHTML(Xml::openElement('form', array('action' => $this->getTitle()->getLocalURL('action=submit'), 'method' => 'post')) . "{$input}\n{$submit}\n");
$wgOut->addHTML("</form>");
}
示例13: getForm
public function getForm($par = null)
{
global $wgScript, $wgRequest;
$category = $par;
if (!$category) {
$category = $wgRequest->getVal('category');
}
$f = Xml::openElement('form', array('method' => 'get', 'action' => $wgScript)) . Xml::openElement('fieldset') . Xml::element('legend', array(), wfMsg('randomincategory')) . Html::Hidden('title', $this->getTitle()->getPrefixedText()) . Xml::openElement('p') . Xml::label(wfMsg('randomincategory-label'), 'category') . ' ' . Xml::input('category', null, $category, array('id' => 'category')) . ' ' . Xml::submitButton(wfMsg('randomincategory-submit')) . Xml::closeElement('p') . Xml::closeElement('fieldset') . Xml::closeElement('form');
return $f;
}
示例14: getPageHeader
public function getPageHeader()
{
$self = SpecialPage::getTitleFor($this->getName());
$form = Xml::openElement('form', array('method' => 'post', 'action' => $self->getLocalUrl()));
$form .= '<table><tr><td align="right">' . Xml::label("Exclude titles", 'excludetitles') . '</td>';
$form .= '<td>' . Xml::input('excludetitles', 30, $this->excludeorig, array('id' => 'excludetitles')) . '</td></tr>';
$form .= '<tr><td></td><td>' . Xml::submitButton(wfMsg('allpagessubmit')) . '</td></tr></table>';
$form .= Html::hidden('offset', $this->offset) . Html::hidden('limit', $this->limit) . '</form>';
return $form;
}
示例15: getAddForm
protected function getAddForm() {
return Xml::fieldset( wfMsg( 'premoderation-wl-addip-fieldset' ) ) .
Xml::openElement( 'form', array( 'id' => 'prem-wl-form', 'method' => 'post' ) ) .
'<table><tr><td>' . wfMsg( 'premoderation-private-ip' ) . '</td><td>' .
Xml::input( 'ip', 50, '', array( 'id' => 'prem-whitelist-addip' ) ) . '</td></tr>' .
'<tr><td>' . wfMsg( 'summary' ) . '</td><td>' . Xml::input( 'summary', 50, '',
array( 'id' => 'prem-summary' ) ) . '</td></tr><tr>' . '<td>' .
Xml::submitButton( wfMsg( 'htmlform-submit' ), array( 'id' => 'prem-wl-submit' ) ) .
'<input type="hidden" name="action" value="add" /></td></tr></table>' .
Xml::closeElement( 'form' ) . Xml::closeElement( 'fieldset' );
}