本文整理匯總了PHP中HtmlForm::addPreText方法的典型用法代碼示例。如果您正苦於以下問題:PHP HtmlForm::addPreText方法的具體用法?PHP HtmlForm::addPreText怎麽用?PHP HtmlForm::addPreText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HtmlForm
的用法示例。
在下文中一共展示了HtmlForm::addPreText方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
public function execute($par)
{
$request = $this->getRequest();
$context = $this->getContext();
$output = $this->getOutput();
$output->addModules('ext.MassMessage.special.js');
$output->addModuleStyles('ext.MassMessage.special');
$this->setHeaders();
$this->outputHeader();
$this->checkPermissions();
// Some variables...
$this->status = new Status();
// Figure out what state we're in.
if ($request->getText('submit-button') == $this->msg('massmessage-form-submit')->text()) {
$this->state = 'submit';
} elseif ($request->getText('preview-button') == $this->msg('massmessage-form-preview')->text()) {
$this->state = 'preview';
} else {
$this->state = 'form';
}
$form = new HtmlForm($this->createForm(), $context);
$form->setId('mw-massmessage-form');
$form->setDisplayFormat('div');
if ($this->state == 'form') {
$form->addPreText($this->msg('massmessage-form-header')->parse());
}
$form->setWrapperLegendMsg('massmessage');
$form->suppressDefaultSubmit();
// We use our own buttons.
$form->setSubmitCallback(array($this, 'callback'));
$form->setMethod('post');
$form->prepareForm();
$result = $form->tryAuthorizedSubmit();
if ($result === true || $result instanceof Status && $result->isGood()) {
if ($this->state == 'submit') {
// If it's preview, everything is shown already.
$msg = $this->msg('massmessage-submitted')->params($this->count)->plain();
$output->addWikiText($msg);
$output->addWikiMsg('massmessage-nextsteps');
}
} else {
$form->displayForm($result);
}
}