/** * 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)); } } }
/** * 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)); } } }
/** * Add header text inside the form, just underneath where the errors would go * @param $form HTMLForm * @return void */ protected function doHeaderText(HTMLForm &$form) { global $wgRequest; # Don't need to do anything if the form has been posted if (!$wgRequest->wasPosted() && $this->preErrors) { $s = HTMLForm::formatErrors($this->preErrors); if ($s) { $form->addHeaderText(Html::rawElement('div', array('class' => 'error'), $s)); } } }