本文整理汇总了PHP中HTMLForm::addHiddenFields方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLForm::addHiddenFields方法的具体用法?PHP HTMLForm::addHiddenFields怎么用?PHP HTMLForm::addHiddenFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLForm
的用法示例。
在下文中一共展示了HTMLForm::addHiddenFields方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getForm
function getForm()
{
$fields = array();
$fields['limit'] = array('type' => 'select', 'name' => 'limit', 'label-message' => 'table_pager_limit_label', 'options' => $this->getLimitSelectList(), 'default' => $this->mLimit);
if (!$this->getConfig()->get('MiserMode')) {
$fields['ilsearch'] = array('type' => 'text', 'name' => 'ilsearch', 'id' => 'mw-ilsearch', 'label-message' => 'listfiles_search_for', 'default' => $this->mSearch, 'size' => '40', 'maxlength' => '255');
}
$this->getOutput()->addModules('mediawiki.userSuggest');
$fields['user'] = array('type' => 'text', 'name' => 'user', 'id' => 'mw-listfiles-user', 'label-message' => 'username', 'default' => $this->mUserName, 'size' => '40', 'maxlength' => '255', 'cssclass' => 'mw-autocomplete-user');
$fields['ilshowall'] = array('type' => 'check', 'name' => 'ilshowall', 'id' => 'mw-listfiles-show-all', 'label-message' => 'listfiles-show-all', 'default' => $this->mShowAll);
$query = $this->getRequest()->getQueryValues();
unset($query['title']);
unset($query['limit']);
unset($query['ilsearch']);
unset($query['ilshowall']);
unset($query['user']);
$form = new HTMLForm($fields, $this->getContext());
$form->setMethod('get');
$form->setTitle($this->getTitle());
$form->setId('mw-listfiles-form');
$form->setWrapperLegendMsg('listfiles');
$form->setSubmitTextMsg('table_pager_limit_submit');
$form->addHiddenFields($query);
$form->prepareForm();
$form->displayForm('');
}
示例3: 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');
}
示例4: alterForm
protected function alterForm(HTMLForm $form)
{
$form->setId('mw-changeemail-form');
$form->setTableId('mw-changeemail-table');
$form->setSubmitTextMsg('changeemail-submit');
$form->addHiddenFields($this->getRequest()->getValues('returnto', 'returntoquery'));
}
示例5: alterForm
protected function alterForm(HTMLForm $form)
{
$form->setId('mw-changeemail-form');
$form->setTableId('mw-changeemail-table');
$form->setSubmitTextMsg('changeemail-submit');
$form->addHiddenFields($this->getRequest()->getValues('returnto', 'returntoquery'));
$form->addHeaderText($this->msg('changeemail-header')->parseAsBlock());
if ($this->getConfig()->get('RequirePasswordforEmailChange')) {
$form->addHeaderText($this->msg('changeemail-passwordrequired')->parseAsBlock());
}
}
示例6: 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');
}