本文整理汇总了PHP中HTMLForm::addPostText方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLForm::addPostText方法的具体用法?PHP HTMLForm::addPostText怎么用?PHP HTMLForm::addPostText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLForm
的用法示例。
在下文中一共展示了HTMLForm::addPostText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getForm
/**
* Get the HTMLForm to control behavior
* @return HTMLForm|null
*/
protected function getForm()
{
$this->fields = $this->getFormFields();
// Give hooks a chance to alter the form, adding extra fields or text etc
wfRunHooks('ActionModifyFormFields', array($this->getName(), &$this->fields, $this->page));
$form = new HTMLForm($this->fields, $this->getContext(), $this->getName());
$form->setSubmitCallback(array($this, 'onSubmit'));
// Retain query parameters (uselang etc)
$form->addHiddenField('action', $this->getName());
// Might not be the same as the query string
$params = array_diff_key($this->getRequest()->getQueryValues(), array('action' => null, 'title' => null));
$form->addHiddenField('redirectparams', wfArrayToCgi($params));
$form->addPreText($this->preText());
$form->addPostText($this->postText());
$this->alterForm($form);
// Give hooks a chance to alter the form, adding extra fields or text etc
wfRunHooks('ActionBeforeFormDisplay', array($this->getName(), &$form, $this->page));
return $form;
}
示例2: getForm
/**
* Get the HTMLForm to control behavior
* @return HTMLForm|null
*/
protected function getForm()
{
$this->fields = $this->getFormFields();
// Give hooks a chance to alter the form, adding extra fields or text etc
Hooks::run('ActionModifyFormFields', [$this->getName(), &$this->fields, $this->page]);
$form = new HTMLForm($this->fields, $this->getContext(), $this->getName());
$form->setSubmitCallback([$this, 'onSubmit']);
$title = $this->getTitle();
$form->setAction($title->getLocalURL(['action' => $this->getName()]));
// Retain query parameters (uselang etc)
$params = array_diff_key($this->getRequest()->getQueryValues(), ['action' => null, 'title' => null]);
if ($params) {
$form->addHiddenField('redirectparams', wfArrayToCgi($params));
}
$form->addPreText($this->preText());
$form->addPostText($this->postText());
$this->alterForm($form);
// Give hooks a chance to alter the form, adding extra fields or text etc
Hooks::run('ActionBeforeFormDisplay', [$this->getName(), &$form, $this->page]);
return $form;
}
示例3: getForm
/**
* Get the HTMLForm to control behaviour
* @return HTMLForm|null
*/
protected function getForm()
{
$this->fields = $this->getFormFields();
$form = new HTMLForm($this->fields, $this->getContext());
$form->setSubmitCallback(array($this, 'onSubmit'));
$form->setWrapperLegend($this->msg(strtolower($this->getName()) . '-legend'));
$form->addHeaderText($this->msg(strtolower($this->getName()) . '-text')->parseAsBlock());
// Retain query parameters (uselang etc)
$params = array_diff_key($this->getRequest()->getQueryValues(), array('title' => null));
$form->addHiddenField('redirectparams', wfArrayToCGI($params));
$form->addPreText($this->preText());
$form->addPostText($this->postText());
$this->alterForm($form);
// Give hooks a chance to alter the form, adding extra fields or text etc
wfRunHooks("Special{$this->getName()}BeforeFormDisplay", array(&$form));
return $form;
}
示例4: getForm
/**
* Get the HTMLForm to control behavior
* @return HTMLForm|null
*/
protected function getForm()
{
$this->fields = $this->getFormFields();
$form = new HTMLForm($this->fields, $this->getContext(), $this->getMessagePrefix());
$form->setSubmitCallback(array($this, 'onSubmit'));
// If the form is a compact vertical form, then don't output this ugly
// fieldset surrounding it.
// XXX Special pages can setDisplayFormat to 'vform' in alterForm(), but that
// is called after this.
if (!$form->isVForm()) {
$form->setWrapperLegendMsg($this->getMessagePrefix() . '-legend');
}
$headerMsg = $this->msg($this->getMessagePrefix() . '-text');
if (!$headerMsg->isDisabled()) {
$form->addHeaderText($headerMsg->parseAsBlock());
}
// Retain query parameters (uselang etc)
$params = array_diff_key($this->getRequest()->getQueryValues(), array('title' => null));
$form->addHiddenField('redirectparams', wfArrayToCgi($params));
$form->addPreText($this->preText());
$form->addPostText($this->postText());
$this->alterForm($form);
// Give hooks a chance to alter the form, adding extra fields or text etc
wfRunHooks('SpecialPageBeforeFormDisplay', array($this->getName(), &$form));
return $form;
}
示例5: doPostText
/**
* Add footer elements to the form
* @param $form HTMLForm
* @return void
*/
protected function doPostText(HTMLForm &$form)
{
global $wgUser, $wgLang;
# Link to the user's contributions, if applicable
if ($this->target instanceof User) {
$contribsPage = SpecialPage::getTitleFor('Contributions', $this->target->getName());
$links[] = Linker::link($contribsPage, wfMsgExt('ipb-blocklist-contribs', 'escape', $this->target->getName()));
}
# Link to unblock the specified user, or to a blank unblock form
if ($this->target instanceof User) {
$message = wfMsgExt('ipb-unblock-addr', array('parseinline'), $this->target->getName());
$list = SpecialPage::getTitleFor('Unblock', $this->target->getName());
} else {
$message = wfMsgExt('ipb-unblock', array('parseinline'));
$list = SpecialPage::getTitleFor('Unblock');
}
$links[] = Linker::linkKnown($list, $message, array());
# Link to the block list
$links[] = Linker::linkKnown(SpecialPage::getTitleFor('BlockList'), wfMsg('ipb-blocklist'));
# Link to edit the block dropdown reasons, if applicable
if ($wgUser->isAllowed('editinterface')) {
$links[] = Linker::link(Title::makeTitle(NS_MEDIAWIKI, 'Ipbreason-dropdown'), wfMsgHtml('ipb-edit-dropdown'), array(), array('action' => 'edit'));
}
$form->addPostText(Html::rawElement('p', array('class' => 'mw-ipb-conveniencelinks'), $wgLang->pipeList($links)));
if ($this->target instanceof User) {
# Get relevant extracts from the block and suppression logs, if possible
$userpage = $this->target->getUserPage();
$out = '';
LogEventsList::showLogExtract($out, 'block', $userpage->getPrefixedText(), '', array('lim' => 10, 'msgKey' => array('blocklog-showlog', $userpage->getText()), 'showIfEmpty' => false));
$form->addPostText($out);
# Add suppression block entries if allowed
if ($wgUser->isAllowed('suppressionlog')) {
LogEventsList::showLogExtract($out, 'suppress', $userpage->getPrefixedText(), '', array('lim' => 10, 'conds' => array('log_action' => array('block', 'reblock', 'unblock')), 'msgKey' => array('blocklog-showsuppresslog', $userpage->getText()), 'showIfEmpty' => false));
$form->addPostText($out);
}
}
}