當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。