当前位置: 首页>>代码示例>>PHP>>正文


PHP HTMLForm::setHeaderText方法代码示例

本文整理汇总了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'));
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:10,代码来源:SpecialChangePassword.php

示例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));
         }
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:20,代码来源:SpecialBlock.php

示例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;
     }
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:31,代码来源:SpecialTags.php

示例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));
         }
     }
 }
开发者ID:kolzchut,项目名称:mediawiki-molsa-new,代码行数:21,代码来源:SpecialBlock.php

示例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');
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:24,代码来源:SpecialPasswordReset.php

示例6: alterForm

 protected function alterForm(HTMLForm $form)
 {
     $form->setWrapperLegend(false);
     $form->setHeaderText($this->msg('lockdbtext')->parseAsBlock());
     $form->setSubmitTextMsg('lockbtn');
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:6,代码来源:SpecialLockdb.php

示例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');
 }
开发者ID:jpena88,项目名称:mediawiki-dokku-deploy,代码行数:18,代码来源:SpecialPasswordReset.php


注:本文中的HTMLForm::setHeaderText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。