本文整理汇总了PHP中HTMLForm::setSubmitTextMsg方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLForm::setSubmitTextMsg方法的具体用法?PHP HTMLForm::setSubmitTextMsg怎么用?PHP HTMLForm::setSubmitTextMsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLForm
的用法示例。
在下文中一共展示了HTMLForm::setSubmitTextMsg方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
function execute($par)
{
$this->setHeaders();
$this->outputHeader();
$this->getOutput()->addModuleStyles('mediawiki.special.pagesWithProp');
$request = $this->getRequest();
$propname = $request->getVal('propname', $par);
$dbr = wfGetDB(DB_SLAVE);
$res = $dbr->select('page_props', 'pp_propname', '', __METHOD__, array('DISTINCT', 'ORDER BY' => 'pp_propname'));
$propnames = array();
foreach ($res as $row) {
$propnames[$row->pp_propname] = $row->pp_propname;
}
$form = new HTMLForm(array('propname' => array('type' => 'selectorother', 'name' => 'propname', 'options' => $propnames, 'default' => $propname, 'label-message' => 'pageswithprop-prop', 'required' => true)), $this->getContext());
$form->setMethod('get');
$form->setSubmitCallback(array($this, 'onSubmit'));
$form->setWrapperLegendMsg('pageswithprop-legend');
$form->addHeaderText($this->msg('pageswithprop-text')->parseAsBlock());
$form->setSubmitTextMsg('pageswithprop-submit');
$form->prepareForm();
$form->displayForm(false);
if ($propname !== '' && $propname !== null) {
$form->trySubmit();
}
}
示例2: alterForm
protected function alterForm(HTMLForm $form)
{
$form->setWrapperLegendMsg('filerevert-legend');
$form->setSubmitTextMsg('filerevert-submit');
$form->addHiddenField('oldimage', $this->getRequest()->getText('oldimage'));
$form->setTokenSalt(['revert', $this->getTitle()->getPrefixedDBkey()]);
}
示例3: execute
/**
* Main execution point
*
* @param string $par title fragment
*/
public function execute($par)
{
$this->setHeaders();
$this->outputHeader();
$out = $this->getOutput();
$lang = $this->getLanguage();
$out->setPageTitle($this->msg('ipblocklist'));
$out->addModuleStyles('mediawiki.special');
$request = $this->getRequest();
$par = $request->getVal('ip', $par);
$this->target = trim($request->getVal('wpTarget', $par));
$this->options = $request->getArray('wpOptions', array());
$action = $request->getText('action');
if ($action == 'unblock' || $action == 'submit' && $request->wasPosted()) {
# B/C @since 1.18: Unblock interface is now at Special:Unblock
$title = SpecialPage::getTitleFor('Unblock', $this->target);
$out->redirect($title->getFullUrl());
return;
}
# Just show the block list
$fields = array('Target' => array('type' => 'text', 'label-message' => 'ipadressorusername', 'tabindex' => '1', 'size' => '45', 'default' => $this->target), 'Options' => array('type' => 'multiselect', 'options' => array($this->msg('blocklist-userblocks')->text() => 'userblocks', $this->msg('blocklist-tempblocks')->text() => 'tempblocks', $this->msg('blocklist-addressblocks')->text() => 'addressblocks', $this->msg('blocklist-rangeblocks')->text() => 'rangeblocks'), 'flatlist' => true), 'Limit' => array('class' => 'HTMLBlockedUsersItemSelect', 'label-message' => 'table_pager_limit_label', 'options' => array($lang->formatNum(20) => 20, $lang->formatNum(50) => 50, $lang->formatNum(100) => 100, $lang->formatNum(250) => 250, $lang->formatNum(500) => 500), 'name' => 'limit', 'default' => 50));
$form = new HTMLForm($fields, $this->getContext());
$form->setMethod('get');
$form->setWrapperLegendMsg('ipblocklist-legend');
$form->setSubmitTextMsg('ipblocklist-submit');
$form->prepareForm();
$form->displayForm('');
$this->showList();
}
示例4: execute
public function execute($par)
{
$this->checkPermissions();
$this->checkReadOnly();
list($this->target, $this->type) = SpecialBlock::getTargetAndType($par, $this->getRequest());
$this->block = Block::newFromTarget($this->target);
$this->setHeaders();
$this->outputHeader();
$out = $this->getOutput();
$out->setPageTitle($this->msg('unblockip'));
$out->addModules('mediawiki.special');
$form = new HTMLForm($this->getFields(), $this->getContext());
$form->setWrapperLegendMsg('unblockip');
$form->setSubmitCallback(array(__CLASS__, 'processUIUnblock'));
$form->setSubmitTextMsg('ipusubmit');
$form->addPreText($this->msg('unblockiptext')->parseAsBlock());
if ($form->show()) {
switch ($this->type) {
case Block::TYPE_USER:
case Block::TYPE_IP:
$out->addWikiMsg('unblocked', wfEscapeWikiText($this->target));
break;
case Block::TYPE_RANGE:
$out->addWikiMsg('unblocked-range', wfEscapeWikiText($this->target));
break;
case Block::TYPE_ID:
case Block::TYPE_AUTO:
$out->addWikiMsg('unblocked-id', wfEscapeWikiText($this->target));
break;
}
}
}
示例5: alterForm
protected function alterForm(HTMLForm $form)
{
if (!$this->title) {
$form->setMethod('GET');
}
$this->addHelpLink('Help:ChangeContentModel');
// T120576
$form->setSubmitTextMsg('changecontentmodel-submit');
}
示例6: alterForm
protected function alterForm(HTMLForm $form)
{
$form->setId('mw-changeemail-form');
$form->setTableId('mw-changeemail-table');
$form->setWrapperLegendMsg('changeemail-header');
$form->setSubmitTextMsg('changeemail-submit');
$form->addButton('wpCancel', $this->msg('changeemail-cancel')->text());
$form->addHiddenField('returnto', $this->getRequest()->getVal('returnto'));
}
示例7: execute
public function execute($par)
{
$this->checkPermissions();
$this->setHeaders();
$form = new HTMLForm(array('dbname' => array('default' => $par, 'filter-callback' => array('SpecialCreateWiki', 'filter'), 'label-message' => 'createwiki-label-dbname', 'maxlength' => 30, 'required' => true, 'size' => 30, 'type' => 'text', 'validation-callback' => array('SpecialCreateWiki', 'validateDBname')), 'founder' => array('filter-callback' => array('SpecialCreateWiki', 'filter'), 'label-message' => 'createwiki-label-founder', 'required' => true, 'size' => 30, 'type' => 'text', 'validation-callback' => array('SpecialCreateWiki', 'validateFounder')), 'comment' => array('label-message' => 'createwiki-label-comment', 'maxlength' => 79, 'size' => 79, 'type' => 'text')));
$form->setSubmitTextMsg('createwiki-label-create');
$form->setTitle($this->getPageTitle());
$form->setSubmitCallback(array('SpecialCreateWiki', 'processInput'));
$form->show();
}
示例8: showResetForm
private function showResetForm()
{
$this->getOutput()->addWikiMsg('prefs-reset-intro');
$htmlForm = new HTMLForm(array(), $this->getContext(), 'prefs-restore');
$htmlForm->setSubmitTextMsg('restoreprefs');
$htmlForm->setTitle($this->getTitle('reset'));
$htmlForm->setSubmitCallback(array($this, 'submitReset'));
$htmlForm->suppressReset();
$htmlForm->show();
}
示例9: alterForm
protected function alterForm(HTMLForm $form)
{
$form->setId('mw-resetpass-form');
$form->setTableId('mw-resetpass-table');
$form->setWrapperLegendMsg('resetpass_header');
$form->setSubmitTextMsg($this->getUser()->isLoggedIn() ? 'resetpass-submit-loggedin' : 'resetpass_submit');
$form->addButton('wpCancel', $this->msg('resetpass-submit-cancel')->text());
$form->setHeaderText($this->msg('resetpass_text')->parseAsBlock());
$form->addHiddenFields($this->getRequest()->getValues('wpName', 'wpDomain', 'returnto', 'returntoquery'));
}
示例10: execute
/**
* Show a form for filtering namespace and username
*
* @param $par String
* @return String
*/
public function execute($par)
{
$this->setHeaders();
$this->outputHeader();
$form = new HTMLForm(array('Page1' => array('type' => 'text', 'name' => 'page1', 'label-message' => 'compare-page1', 'size' => '40', 'section' => 'page1', 'validation-callback' => array($this, 'checkExistingTitle')), 'Revision1' => array('type' => 'int', 'name' => 'rev1', 'label-message' => 'compare-rev1', 'size' => '8', 'section' => 'page1', 'validation-callback' => array($this, 'checkExistingRevision')), 'Page2' => array('type' => 'text', 'name' => 'page2', 'label-message' => 'compare-page2', 'size' => '40', 'section' => 'page2', 'validation-callback' => array($this, 'checkExistingTitle')), 'Revision2' => array('type' => 'int', 'name' => 'rev2', 'label-message' => 'compare-rev2', 'size' => '8', 'section' => 'page2', 'validation-callback' => array($this, 'checkExistingRevision')), 'Action' => array('type' => 'hidden', 'name' => 'action'), 'Diffonly' => array('type' => 'hidden', 'name' => 'diffonly'), 'Unhide' => array('type' => 'hidden', 'name' => 'unhide')), $this->getContext(), 'compare');
$form->setSubmitTextMsg('compare-submit');
$form->suppressReset();
$form->setMethod('get');
$form->setSubmitCallback(array(__CLASS__, 'showDiff'));
$form->loadData();
$form->displayForm('');
$form->trySubmit();
}
示例11: showResetForm
private function showResetForm()
{
if (!$this->getUser()->isAllowed('editmyoptions')) {
throw new PermissionsError('editmyoptions');
}
$this->getOutput()->addWikiMsg('prefs-reset-intro');
$context = new DerivativeContext($this->getContext());
$context->setTitle($this->getPageTitle('reset'));
// Reset subpage
$htmlForm = new HTMLForm(array(), $context, 'prefs-restore');
$htmlForm->setSubmitTextMsg('restoreprefs');
$htmlForm->setSubmitCallback(array($this, 'submitReset'));
$htmlForm->suppressReset();
$htmlForm->show();
}
示例12: alterForm
protected function alterForm(HTMLForm $form)
{
$form->setSubmitTextMsg('confirm-rollback-button');
$form->setTokenSalt('rollback');
// Copy parameters from GET to confirmation form
$from = $this->getRequest()->getVal('from');
if ($from === null) {
throw new BadRequestError('rollbackfailed', 'rollback-missingparam');
}
foreach (['from', 'bot', 'hidediff', 'summary'] as $param) {
$val = $this->getRequest()->getVal($param);
if ($val !== null) {
$form->addHiddenField($param, $val);
}
}
}
示例13: execute
public function execute($par)
{
$this->setHeaders();
$this->outputHeader();
$this->getOutput()->addModuleStyles('mediawiki.special.pagesWithProp');
$request = $this->getRequest();
$propname = $request->getVal('propname', $par);
$propnames = $this->getExistingPropNames();
$form = new HTMLForm(array('propname' => array('type' => 'selectorother', 'name' => 'propname', 'options' => $propnames, 'default' => $propname, 'label-message' => 'pageswithprop-prop', 'required' => true)), $this->getContext());
$form->setMethod('get');
$form->setSubmitCallback(array($this, 'onSubmit'));
$form->setWrapperLegendMsg('pageswithprop-legend');
$form->addHeaderText($this->msg('pageswithprop-text')->parseAsBlock());
$form->setSubmitTextMsg('pageswithprop-submit');
$form->prepareForm();
$form->displayForm(false);
if ($propname !== '' && $propname !== null) {
$form->trySubmit();
}
}
示例14: execute
public function execute($par)
{
$this->checkPermissions();
$this->checkReadOnly();
list($this->target, $this->type) = SpecialBlock::getTargetAndType($par, $this->getRequest());
$this->block = Block::newFromTarget($this->target);
if ($this->target instanceof User) {
# Set the 'relevant user' in the skin, so it displays links like Contributions,
# User logs, UserRights, etc.
$this->getSkin()->setRelevantUser($this->target);
}
$this->setHeaders();
$this->outputHeader();
$out = $this->getOutput();
$out->setPageTitle($this->msg('unblockip'));
$out->addModules(['mediawiki.special', 'mediawiki.userSuggest']);
$form = new HTMLForm($this->getFields(), $this->getContext());
$form->setWrapperLegendMsg('unblockip');
$form->setSubmitCallback([__CLASS__, 'processUIUnblock']);
$form->setSubmitTextMsg('ipusubmit');
$form->addPreText($this->msg('unblockiptext')->parseAsBlock());
if ($form->show()) {
switch ($this->type) {
case Block::TYPE_IP:
$out->addWikiMsg('unblocked-ip', wfEscapeWikiText($this->target));
break;
case Block::TYPE_USER:
$out->addWikiMsg('unblocked', wfEscapeWikiText($this->target));
break;
case Block::TYPE_RANGE:
$out->addWikiMsg('unblocked-range', wfEscapeWikiText($this->target));
break;
case Block::TYPE_ID:
case Block::TYPE_AUTO:
$out->addWikiMsg('unblocked-id', wfEscapeWikiText($this->target));
break;
}
}
}
示例15: getRawForm
/**
* Get a form for editing the watchlist in "raw" mode
*
* @return HTMLForm
*/
protected function getRawForm()
{
$titles = implode($this->getWatchlist(), "\n");
$fields = array('Titles' => array('type' => 'textarea', 'label-message' => 'watchlistedit-raw-titles', 'default' => $titles));
$form = new HTMLForm($fields, $this->getContext());
$form->setTitle($this->getTitle('raw'));
$form->setSubmitTextMsg('watchlistedit-raw-submit');
# Used message keys: 'accesskey-watchlistedit-raw-submit', 'tooltip-watchlistedit-raw-submit'
$form->setSubmitTooltip('watchlistedit-raw-submit');
$form->setWrapperLegendMsg('watchlistedit-raw-legend');
$form->addHeaderText($this->msg('watchlistedit-raw-explain')->parse());
$form->setSubmitCallback(array($this, 'submitRaw'));
return $form;
}