本文整理汇总了PHP中Xml::submitButton方法的典型用法代码示例。如果您正苦于以下问题:PHP Xml::submitButton方法的具体用法?PHP Xml::submitButton怎么用?PHP Xml::submitButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xml
的用法示例。
在下文中一共展示了Xml::submitButton方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showForm
public function showForm()
{
global $wgScript;
// Text to explain level select (if there are several levels)
if (FlaggedRevs::qualityVersions()) {
$this->getOutput()->addWikiMsg('reviewedpages-list', $this->getLanguage()->formatNum($this->pager->getNumRows()));
}
$form = Html::openElement('form', array('name' => 'reviewedpages', 'action' => $wgScript, 'method' => 'get'));
$form .= "<fieldset><legend>" . $this->msg('reviewedpages-leg')->escaped() . "</legend>\n";
// show/hide links
$showhide = array($this->msg('show')->escaped(), $this->msg('hide')->escaped());
$onoff = 1 - $this->hideRedirs;
$link = Linker::link($this->getPageTitle(), $showhide[$onoff], array(), array('hideredirs' => $onoff, 'namespace' => $this->namespace));
$showhideredirs = $this->msg('whatlinkshere-hideredirs')->rawParams($link)->escaped();
$fields = array();
$namespaces = FlaggedRevs::getReviewNamespaces();
if (count($namespaces) > 1) {
$fields[] = FlaggedRevsXML::getNamespaceMenu($this->namespace) . ' ';
}
if (FlaggedRevs::qualityVersions()) {
$fields[] = FlaggedRevsXML::getLevelMenu($this->type) . ' ';
}
$form .= implode(' ', $fields) . ' ';
$form .= $showhideredirs;
if (count($fields)) {
$form .= " " . Xml::submitButton($this->msg('go')->text());
}
$form .= Html::hidden('title', $this->getPageTitle()->getPrefixedDBKey()) . "\n";
$form .= "</fieldset>";
$form .= Html::closeElement('form ') . "\n";
$this->getOutput()->addHTML($form);
}
示例2: switchForm
/**
* Output a form to allow searching for a user
*/
function switchForm()
{
global $wgScript;
$this->getOutput()->addModules('ext.centralauth.globaluserautocomplete');
$this->getOutput()->addModuleStyles('mediawiki.special');
$this->getOutput()->addHTML(Xml::openElement('form', array('method' => 'get', 'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1')) . Html::hidden('title', $this->getPageTitle()) . Xml::openElement('fieldset') . Xml::element('legend', array(), $this->msg('userrights-lookup-user')->text()) . Xml::inputLabel($this->msg('userrights-user-editname')->text(), 'user', 'username', 30, $this->mTarget, array('class' => 'mw-autocomplete-global-user')) . ' <br />' . Xml::submitButton($this->msg('editusergroup')->text()) . Xml::closeElement('fieldset') . Xml::closeElement('form') . "\n");
}
示例3: getForm
/**
* Returns HTML5 output of the form
* GLOBALS: $wgLang, $wgScript
* @return string
*/
protected function getForm() {
global $wgLang, $wgScript;
$form = Xml::tags( 'form',
array(
'action' => $wgScript,
'method' => 'get'
),
'<table><tr><td>' .
wfMsgHtml( 'translate-page-language' ) .
'</td><td>' .
TranslateUtils::languageSelector( $wgLang->getCode(), $this->options['language'] ) .
'</td></tr><tr><td>' .
wfMsgHtml( 'translate-magic-module' ) .
'</td><td>' .
$this->moduleSelector( $this->options['module'] ) .
'</td></tr><tr><td colspan="2">' .
Xml::submitButton( wfMsg( 'translate-magic-submit' ) ) . ' ' .
Xml::submitButton( wfMsg( 'translate-magic-cm-export' ), array( 'name' => 'export' ) ) .
'</td></tr></table>' .
Html::hidden( 'title', $this->getTitle()->getPrefixedText() )
);
return $form;
}
示例4: getDeletionButton
protected function getDeletionButton( $ip ) {
return Xml::openElement( 'form', array( 'id' => 'prem-wl-delete' . $ip, 'method' => 'post' ) ) .
Xml::submitButton( wfMsg( 'premoderation-table-list-delete' ) ) .
'<input type="hidden" name="action" value="delete" />' .
'<input type="hidden" name="ip" value="' . $ip . '" />' .
Xml::closeElement( 'form' );
}
示例5: execute
public function execute($subpage)
{
global $wgOut, $wgRequest, $wgUser, $wgCacheEpoch, $wgCityId;
wfProfileIn(__METHOD__);
$this->setHeaders();
$this->mTitle = SpecialPage::getTitleFor('UserData');
if ($this->isRestricted() && !$this->userCanExecute($wgUser)) {
$this->displayRestrictionError();
wfProfileOut(__METHOD__);
return;
}
$result = '';
$userId = $wgRequest->getInt('userId');
if ($userId) {
$user = User::newFromId($userId);
if (!empty($user)) {
//todo: add nicer result - right now only name and link to user page
$result = Xml::element('a', array('href' => $user->getUserPage()->getLocalURL()), $user->getName(), false);
}
}
$wgOut->addHTML(Xml::openElement('form', array('action' => $this->mTitle->getFullURL(), 'method' => 'get')));
$wgOut->addHTML(Xml::inputLabel(wfMsg('userdata-userid-label'), 'userId', 'user-id', false, $userId));
$wgOut->addHTML('<br>' . Xml::submitButton(wfMsg('userdata-submit')));
$wgOut->addHTML(Xml::closeElement('form'));
if ($result) {
$wgOut->addHTML('<hr>' . $result);
}
wfProfileOut(__METHOD__);
}
示例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: getButtons
function getButtons()
{
$buttons = '';
if ($this->mShowSubmit) {
$attribs = array();
if (isset($this->mSubmitID)) {
$attribs['id'] = $this->mSubmitID;
}
if (isset($this->mSubmitName)) {
$attribs['name'] = $this->mSubmitName;
}
if (isset($this->mSubmitTooltip)) {
$attribs += Linker::tooltipAndAccesskeyAttribs($this->mSubmitTooltip);
}
$attribs['class'] = array('mw-htmlform-submit', 'mw-ui-button mw-ui-big mw-ui-block', $this->mSubmitModifierClass);
$buttons .= Xml::submitButton($this->getSubmitText(), $attribs) . "\n";
}
if ($this->mShowReset) {
$buttons .= Html::element('input', array('type' => 'reset', 'value' => $this->msg('htmlform-reset')->text(), 'class' => 'mw-ui-button mw-ui-big mw-ui-block')) . "\n";
}
foreach ($this->mButtons as $button) {
$attrs = array('type' => 'submit', 'name' => $button['name'], 'value' => $button['value']);
if ($button['attribs']) {
$attrs += $button['attribs'];
}
if (isset($button['id'])) {
$attrs['id'] = $button['id'];
}
$attrs['class'] = isset($attrs['class']) ? (array) $attrs['class'] : array();
$attrs['class'][] = 'mw-ui-button mw-ui-big mw-ui-block';
$buttons .= Html::element('input', $attrs) . "\n";
}
$html = Html::rawElement('div', array('class' => 'mw-htmlform-submit-buttons'), "\n{$buttons}") . "\n";
return $html;
}
示例8: 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);
}
示例9: showForm
/**
* Once a set of revisions have been selected,
* list them and request a reason/comment for confirmation.
*/
function showForm()
{
global $wgOut, $wgUser;
$special = Title::makeTitle(NS_SPECIAL, 'HideRevision');
$wgOut->addWikiText(wfMsg('hiderevision-text'));
$wgOut->addHtml($this->revisionList() . $this->archiveList() . Xml::openElement('form', array('action' => $special->getLocalUrl('action=submit'), 'method' => 'post')) . "<br />" . Xml::inputLabel(wfMsgHTML('hiderevision-reason'), 'wpReason', 'wpReason', 60, $this->mReason) . "<br />" . Xml::submitButton(wfMsgHTML('hiderevision-submit')) . $this->revisionFields() . Html::Hidden('wpEditToken', $wgUser->editToken()) . Xml::closeElement('form'));
}
示例10: showForm
protected function showForm()
{
global $wgScript;
# Explanatory text
$this->getOutput()->addWikiMsg('configuredpages-list', $this->getLang()->formatNum($this->pager->getNumRows()));
$fields = array();
# Namespace selector
if (count(FlaggedRevs::getReviewNamespaces()) > 1) {
$fields[] = FlaggedRevsXML::getNamespaceMenu($this->namespace, '');
}
# Default version selector
$fields[] = FlaggedRevsXML::getDefaultFilterMenu($this->override);
# Restriction level selector
if (FlaggedRevs::getRestrictionLevels()) {
$fields[] = FlaggedRevsXML::getRestrictionFilterMenu($this->autoreview);
}
$form = Html::openElement('form', array('name' => 'configuredpages', 'action' => $wgScript, 'method' => 'get'));
$form .= Html::hidden('title', $this->getTitle()->getPrefixedDBKey());
$form .= "<fieldset><legend>" . wfMsg('configuredpages') . "</legend>\n";
$form .= implode(' ', $fields) . '<br/>';
$form .= Xml::submitButton(wfMsg('go'));
$form .= "</fieldset>\n";
$form .= Html::closeElement('form') . "\n";
$this->getOutput()->addHTML($form);
}
示例11: showRequestForm
/**
* Show a nice form for the user to request a confirmation mail
*/
function showRequestForm()
{
global $wgOut, $wgUser, $wgLang, $wgRequest;
if ($wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getText('token'))) {
$ok = $wgUser->sendConfirmationMail();
if (WikiError::isError($ok)) {
$wgOut->addWikiMsg('confirmemail_sendfailed', $ok->toString());
} else {
$wgOut->addWikiMsg('confirmemail_sent');
}
} else {
if ($wgUser->isEmailConfirmed()) {
// date and time are separate parameters to facilitate localisation.
// $time is kept for backward compat reasons.
// 'emailauthenticated' is also used in SpecialPreferences.php
$time = $wgLang->timeAndDate($wgUser->mEmailAuthenticated, true);
$d = $wgLang->date($wgUser->mEmailAuthenticated, true);
$t = $wgLang->time($wgUser->mEmailAuthenticated, true);
$wgOut->addWikiMsg('emailauthenticated', $time, $d, $t);
}
if ($wgUser->isEmailConfirmationPending()) {
$wgOut->wrapWikiMsg("<div class=\"error mw-confirmemail-pending\">\n\$1</div>", 'confirmemail_pending');
}
$wgOut->addWikiMsg('confirmemail_text');
$form = Xml::openElement('form', array('method' => 'post', 'action' => $this->getTitle()->getLocalUrl()));
$form .= Xml::hidden('token', $wgUser->editToken());
$form .= Xml::submitButton(wfMsg('confirmemail_send'));
$form .= Xml::closeElement('form');
$wgOut->addHTML($form);
}
}
示例12: 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);
}
示例13: execute
public function execute($subpage)
{
global $wgOut, $wgRequest, $wgUser, $wgCacheEpoch, $wgCityId;
wfProfileIn(__METHOD__);
$this->setHeaders();
$this->mTitle = SpecialPage::getTitleFor('cacheepoch');
if ($this->isRestricted() && !$this->userCanExecute($wgUser)) {
$this->displayRestrictionError();
wfProfileOut(__METHOD__);
return;
}
//no WikiFactory (internal wikis)
if (empty($wgCityId)) {
$wgOut->addHTML(wfMsg('cacheepoch-no-wf'));
wfProfileOut(__METHOD__);
return;
}
if ($wgRequest->wasPosted()) {
$wgCacheEpoch = wfTimestampNow();
$status = WikiFactory::setVarByName('wgCacheEpoch', $wgCityId, $wgCacheEpoch, wfMsg('cacheepoch-wf-reason'));
if ($status) {
$wgOut->addHTML('<h2>' . wfMsg('cacheepoch-updated', $wgCacheEpoch) . '</h2>');
} else {
$wgOut->addHTML('<h2>' . wfMsg('cacheepoch-not-updated') . '</h2>');
}
} else {
$wgOut->addHTML('<h2>' . wfMsg('cacheepoch-header') . '</h2>');
}
$wgOut->addHTML(Xml::openElement('form', array('action' => $this->mTitle->getFullURL(), 'method' => 'post')));
$wgOut->addHTML(wfMsg('cacheepoch-value', $wgCacheEpoch) . '<br>');
$wgOut->addHTML(Xml::submitButton(wfMsg('cacheepoch-submit')));
$wgOut->addHTML(Xml::closeElement('form'));
wfProfileOut(__METHOD__);
}
示例14: 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");
}
示例15: showOptions
/**
* @param $namespace int
* @param $type string
* @param $level string
* @param $minsize int
* @private
*/
function showOptions($namespace, $type = 'edit', $level, $sizetype, $size)
{
global $wgScript;
$action = htmlspecialchars($wgScript);
$title = SpecialPage::getTitleFor('ProtectedTitles');
$special = htmlspecialchars($title->getPrefixedDBkey());
return "<form action=\"{$action}\" method=\"get\">\n" . '<fieldset>' . Xml::element('legend', array(), wfMsg('protectedtitles')) . Xml::hidden('title', $special) . " \n" . $this->getNamespaceMenu($namespace) . " \n" . $this->getLevelMenu($level) . " \n" . " " . Xml::submitButton(wfMsg('allpagessubmit')) . "\n" . "</fieldset></form>";
}