本文整理汇总了PHP中HTMLForm::setHeaderText方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLForm::setHeaderText方法的具体用法?PHP HTMLForm::setHeaderText怎么用?PHP HTMLForm::setHeaderText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLForm
的用法示例。
在下文中一共展示了HTMLForm::setHeaderText方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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'));
}
示例2: alterForm
/**
* Customizes the HTMLForm a bit
*
* @param $form HTMLForm
*/
protected function alterForm(HTMLForm $form)
{
$form->setWrapperLegendMsg('blockip-legend');
$form->setHeaderText('');
$form->setSubmitCallback(array(__CLASS__, 'processUIForm'));
$msg = $this->alreadyBlocked ? 'ipb-change-block' : 'ipbsubmit';
$form->setSubmitTextMsg($msg);
# Don't need to do anything if the form has been posted
if (!$this->getRequest()->wasPosted() && $this->preErrors) {
$s = HTMLForm::formatErrors($this->preErrors);
if ($s) {
$form->addHeaderText(Html::rawElement('div', array('class' => 'error'), $s));
}
}
}
示例3: processCreateTagForm
public function processCreateTagForm(array $data, HTMLForm $form)
{
$context = $form->getContext();
$out = $context->getOutput();
$tag = trim(strval($data['Tag']));
$ignoreWarnings = isset($data['IgnoreWarnings']) && $data['IgnoreWarnings'] === '1';
$status = ChangeTags::createTagWithChecks($tag, $data['Reason'], $context->getUser(), $ignoreWarnings);
if ($status->isGood()) {
$out->redirect($this->getPageTitle()->getLocalURL());
return true;
} elseif ($status->isOK()) {
// we have some warnings, so we show a confirmation form
$fields = ['Tag' => ['type' => 'hidden', 'default' => $data['Tag']], 'Reason' => ['type' => 'hidden', 'default' => $data['Reason']], 'IgnoreWarnings' => ['type' => 'hidden', 'default' => '1']];
// fool HTMLForm into thinking the form hasn't been submitted yet. Otherwise
// we get into an infinite loop!
$context->getRequest()->unsetVal('wpEditToken');
$headerText = $this->msg('tags-create-warnings-above', $tag, count($status->getWarningsArray()))->parseAsBlock() . $out->parse($status->getWikiText()) . $this->msg('tags-create-warnings-below')->parseAsBlock();
$subform = new HTMLForm($fields, $this->getContext());
$subform->setAction($this->getPageTitle('create')->getLocalURL());
$subform->setWrapperLegendMsg('tags-create-heading');
$subform->setHeaderText($headerText);
$subform->setSubmitCallback([$this, 'processCreateTagForm']);
$subform->setSubmitTextMsg('htmlform-yes');
$subform->show();
$out->addBacklinkSubtitle($this->getPageTitle());
return true;
} else {
$out->addWikiText("<div class=\"error\">\n" . $status->getWikiText() . "\n</div>");
return false;
}
}
示例4: alterForm
/**
* Customizes the HTMLForm a bit
*
* @param HTMLForm $form
*/
protected function alterForm(HTMLForm $form)
{
$form->setWrapperLegendMsg('blockip-legend');
$form->setHeaderText('');
$form->setSubmitDestructive();
$msg = $this->alreadyBlocked ? 'ipb-change-block' : 'ipbsubmit';
$form->setSubmitTextMsg($msg);
$this->addHelpLink('Help:Blocking users');
# Don't need to do anything if the form has been posted
if (!$this->getRequest()->wasPosted() && $this->preErrors) {
$s = $form->formatErrors($this->preErrors);
if ($s) {
$form->addHeaderText(Html::rawElement('div', array('class' => 'error'), $s));
}
}
}
示例5: alterForm
public function alterForm(HTMLForm $form)
{
global $wgPasswordResetRoutes;
$form->setDisplayFormat('vform');
// Turn the old-school line around the form off.
// XXX This wouldn't be necessary here if we could set the format of
// the HTMLForm to 'vform' at its creation, but there's no way to do so
// from a FormSpecialPage class.
$form->setWrapperLegend(false);
$form->addHiddenFields($this->getRequest()->getValues('returnto', 'returntoquery'));
$i = 0;
if (isset($wgPasswordResetRoutes['username']) && $wgPasswordResetRoutes['username']) {
$i++;
}
if (isset($wgPasswordResetRoutes['email']) && $wgPasswordResetRoutes['email']) {
$i++;
}
if (isset($wgPasswordResetRoutes['domain']) && $wgPasswordResetRoutes['domain']) {
$i++;
}
$message = $i > 1 ? 'passwordreset-text-many' : 'passwordreset-text-one';
$form->setHeaderText($this->msg($message, $i)->parseAsBlock());
$form->setSubmitTextMsg('mailmypassword');
}
示例6: alterForm
protected function alterForm(HTMLForm $form)
{
$form->setWrapperLegend(false);
$form->setHeaderText($this->msg('lockdbtext')->parseAsBlock());
$form->setSubmitTextMsg('lockbtn');
}
示例7: alterForm
public function alterForm(HTMLForm $form)
{
$resetRoutes = $this->getConfig()->get('PasswordResetRoutes');
$form->addHiddenFields($this->getRequest()->getValues('returnto', 'returntoquery'));
$i = 0;
if (isset($resetRoutes['username']) && $resetRoutes['username']) {
$i++;
}
if (isset($resetRoutes['email']) && $resetRoutes['email']) {
$i++;
}
if (isset($resetRoutes['domain']) && $resetRoutes['domain']) {
$i++;
}
$message = $i > 1 ? 'passwordreset-text-many' : 'passwordreset-text-one';
$form->setHeaderText($this->msg($message, $i)->parseAsBlock());
$form->setSubmitTextMsg('mailmypassword');
}