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


PHP HTMLForm::show方法代码示例

本文整理汇总了PHP中HTMLForm::show方法的典型用法代码示例。如果您正苦于以下问题:PHP HTMLForm::show方法的具体用法?PHP HTMLForm::show怎么用?PHP HTMLForm::show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTMLForm的用法示例。


在下文中一共展示了HTMLForm::show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * Show the special page
  *
  * @param $par Mixed: parameter passed to the page or null
  * @return bool|null
  */
 public function execute($par)
 {
     global $wgExtensionAssetsPath;
     $out = $this->getOutput();
     // Add CSS
     if (defined('MW_SUPPORTS_RESOURCE_MODULES')) {
         $out->addModuleStyles('ext.video');
     } else {
         $out->addExtensionStyle($wgExtensionAssetsPath . '/Video/Video.css');
     }
     // If the user doesn't have the required 'addvideo' permission, display an error
     if (!$this->userCanExecute($this->getUser())) {
         $this->displayRestrictionError();
         return;
     }
     // Show a message if the database is in read-only mode
     if (wfReadOnly()) {
         throw new ReadOnlyError();
     }
     // If user is blocked, s/he doesn't need to access this page
     if ($this->getUser()->isBlocked()) {
         throw new UserBlockedError($this->getUser()->mBlock);
     }
     $this->setHeaders();
     $form = new HTMLForm($this->getFormFields(), $this->getContext());
     $form->setIntro(wfMsgExt('video-addvideo-instructions', 'parse'));
     $form->setWrapperLegend(wfMsg('video-addvideo-title'));
     $form->setSubmitText(wfMsg('video-addvideo-button'));
     $form->setSubmitCallback(array($this, 'submit'));
     if ($this->getRequest()->getCheck('forReUpload')) {
         $form->addHiddenField('forReUpload', true);
     }
     $form->show();
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:40,代码来源:SpecialAddVideo.php

示例2: execute

 public function execute($par)
 {
     $this->checkPermissions();
     $this->checkReadOnly();
     list($this->target, $this->type) = SpecialBlock::getTargetAndType($par, $this->getRequest());
     $this->block = Block::newFromTarget($this->target);
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->setPageTitle($this->msg('unblockip'));
     $out->addModules('mediawiki.special');
     $form = new HTMLForm($this->getFields(), $this->getContext());
     $form->setWrapperLegend(wfMsg('unblockip'));
     $form->setSubmitCallback(array(__CLASS__, 'processUIUnblock'));
     $form->setSubmitText(wfMsg('ipusubmit'));
     $form->addPreText(wfMsgExt('unblockiptext', 'parse'));
     if ($form->show()) {
         switch ($this->type) {
             case Block::TYPE_USER:
             case Block::TYPE_IP:
                 $out->addWikiMsg('unblocked', $this->target);
                 break;
             case Block::TYPE_RANGE:
                 $out->addWikiMsg('unblocked-range', $this->target);
                 break;
             case Block::TYPE_ID:
             case Block::TYPE_AUTO:
                 $out->addWikiMsg('unblocked-id', $this->target);
                 break;
         }
     }
 }
开发者ID:laiello,项目名称:media-wiki-law,代码行数:32,代码来源:SpecialUnblock.php

示例3: listDomains

 /**
  * @return void
  */
 function listDomains()
 {
     $this->setHeaders();
     $this->getOutput()->setPagetitle($this->msg('openstackmanager-domainlist'));
     $this->getOutput()->addModuleStyles('ext.openstack');
     $domainInfo = array();
     $domainInfo['domainname'] = array('type' => 'text', 'label-message' => 'openstackmanager-domainname', 'default' => '', 'section' => 'domain', 'name' => 'domainname');
     $domainInfo['fqdn'] = array('type' => 'text', 'label-message' => 'openstackmanager-fqdn', 'default' => '', 'section' => 'domain', 'name' => 'fqdn');
     $domainInfo['location'] = array('type' => 'text', 'label-message' => 'openstackmanager-location', 'default' => '', 'section' => 'domain', 'help-message' => 'openstackmanager-location-help', 'name' => 'location');
     $domainInfo['action'] = array('type' => 'hidden', 'default' => 'create', 'name' => 'action');
     $domainForm = new HTMLForm($domainInfo, $this->getContext(), 'openstackmanager-novadomain');
     $domainForm->setSubmitID('novadomain-form-createdomainsubmit');
     $domainForm->setSubmitCallback(array($this, 'tryCreateSubmit'));
     $domainForm->show();
     $headers = array('openstackmanager-domainname', 'openstackmanager-fqdn', 'openstackmanager-location', 'openstackmanager-actions');
     $domains = OpenStackNovaDomain::getAllDomains();
     $domainRows = array();
     foreach ($domains as $domain) {
         $domainRow = array();
         $domainName = $domain->getDomainName();
         $this->pushResourceColumn($domainRow, $domainName);
         $this->pushResourceColumn($domainRow, $domain->getFullyQualifiedDomainName());
         $this->pushResourceColumn($domainRow, $domain->getLocation());
         $this->pushRawResourceColumn($domainRow, $this->createActionLink('openstackmanager-delete', array('action' => 'delete', 'domainname' => $domainName)));
         $domainRows[] = $domainRow;
     }
     if ($domainRows) {
         $out = $this->createResourceTable($headers, $domainRows);
     } else {
         $out = '';
     }
     $this->getOutput()->addHTML($out);
 }
开发者ID:valhallasw,项目名称:mediawiki-extensions-OpenStackManager,代码行数:36,代码来源:SpecialNovaDomain.php

示例4: show

 public function show($par)
 {
     $formFields = array('account' => array('type' => 'text', 'validation-callback' => array(__CLASS__, 'validateUser'), 'label-message' => 'disableaccount-user'), 'confirm' => array('type' => 'toggle', 'validation-callback' => array(__CLASS__, 'checkConfirmation'), 'label-message' => 'disableaccount-confirm'));
     $htmlForm = new HTMLForm($formFields, 'disableaccount');
     $htmlForm->setSubmitCallback(array(__CLASS__, 'submit'));
     $htmlForm->setTitle($this->getTitle());
     $htmlForm->show();
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:8,代码来源:SpecialDisableAccount.php

示例5: execute

 function execute($par)
 {
     global $wgOut, $wgUser, $wgEmailAuthentication;
     $this->setHeaders();
     if (!$this->userCanExecute($wgUser)) {
         $this->displayRestrictionError();
         return;
     }
     $error = SpecialEmailUser::getPermissionsError($wgUser, $wgUser->editToken());
     if ($error) {
         switch ($error) {
             case 'blockedemailuser':
                 $wgOut->blockedPage();
                 return;
             case 'actionthrottledtext':
                 $wgOut->rateLimited();
                 return;
             case 'mailnologin':
                 $wgOut->showErrorPage('mailnologin', 'mailnologintext');
                 return;
             default:
                 list($title, $msg, $params) = $error;
                 $wgOut->showErrorPage($title, $msg, $params);
                 return;
         }
     }
     $dbr = wfGetDB(DB_SLAVE);
     # $conds can be not that strict but cannot be too strict.
     $conds = array("user_email <> ''");
     if ($wgEmailAuthentication) {
         $conds[] = 'user_email_authenticated IS NOT NULL';
     }
     $res = $dbr->select('user', '*', $conds);
     $users = UserArray::newFromResult($res);
     $usernames = array();
     foreach ($users as $user) {
         if ($user->canReceiveEmail() && $user->getId() != $wgUser->getId()) {
             $usernames[$user->getName()] = $user->getId();
         }
     }
     $this->userIds = array_values($usernames);
     if (empty($usernames)) {
         # No one to send mail to
         $wgOut->addWikiMsg('emailusers-norecipient');
         $wgOut->returnToMain();
         return;
     }
     $form = array('target' => array('type' => 'multiselect', 'label-message' => 'emailto', 'options' => $usernames, 'validation-callback' => array($this, 'validateTarget')), 'target-reverse' => array('type' => 'check', 'default' => true, 'label-message' => 'emailusers-target-reverse'), 'subject' => array('type' => 'text', 'default' => wfMsg('defemailsubject'), 'label-message' => 'emailsubject'), 'text' => array('type' => 'textarea', 'label-message' => 'emailmessage'), 'ccme' => array('type' => 'check', 'default' => $wgUser->getOption('ccmeonemails'), 'label-message' => 'emailccme'));
     $htmlForm = new HTMLForm($form);
     $htmlForm->setTitle($this->getTitle($par));
     $htmlForm->setSubmitCallback(array($this, 'submit'));
     $this->outputHeader();
     if ($htmlForm->show()) {
         $wgOut->addWikiMsg('emailsenttext');
         $htmlForm->displayForm(false);
     }
 }
开发者ID:eliagbayani,项目名称:LiteratureEditor,代码行数:57,代码来源:SpecialEmailUsers.php

示例6: showResetForm

 private function showResetForm()
 {
     $this->getOutput()->addWikiMsg('prefs-reset-intro');
     $htmlForm = new HTMLForm(array(), $this->getContext(), 'prefs-restore');
     $htmlForm->setSubmitText(wfMsg('restoreprefs'));
     $htmlForm->setTitle($this->getTitle('reset'));
     $htmlForm->setSubmitCallback(array($this, 'submitReset'));
     $htmlForm->suppressReset();
     $htmlForm->show();
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:10,代码来源:SpecialPreferences.php

示例7: execute

 public function execute($par)
 {
     $this->checkPermissions();
     $this->setHeaders();
     $form = new HTMLForm(array('dbname' => array('default' => $par, 'filter-callback' => array('SpecialCreateWiki', 'filter'), 'label-message' => 'createwiki-label-dbname', 'maxlength' => 30, 'required' => true, 'size' => 30, 'type' => 'text', 'validation-callback' => array('SpecialCreateWiki', 'validateDBname')), 'founder' => array('filter-callback' => array('SpecialCreateWiki', 'filter'), 'label-message' => 'createwiki-label-founder', 'required' => true, 'size' => 30, 'type' => 'text', 'validation-callback' => array('SpecialCreateWiki', 'validateFounder')), 'comment' => array('label-message' => 'createwiki-label-comment', 'maxlength' => 79, 'size' => 79, 'type' => 'text')));
     $form->setSubmitTextMsg('createwiki-label-create');
     $form->setTitle($this->getPageTitle());
     $form->setSubmitCallback(array('SpecialCreateWiki', 'processInput'));
     $form->show();
 }
开发者ID:NDKilla,项目名称:CreateWiki,代码行数:10,代码来源:SpecialCreateWiki.php

示例8: execute

 function execute($par)
 {
     global $wgRequest;
     $this->setHeaders();
     $form = new HTMLForm(array('TitleText' => array('type' => 'text', 'label-message' => 'luafoo-convert-title')));
     $form->setSubmitText(wfMsg('luafoo-convert-submit'));
     $form->setSubmitCallback(array($this, 'showTranslation'));
     $form->setTitle($this->getTitle());
     $form->show();
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:10,代码来源:SpecialLuaTranslation.php

示例9: showResetForm

 function showResetForm()
 {
     global $wgOut;
     $wgOut->addWikiMsg('prefs-reset-intro');
     $htmlForm = new HTMLForm(array(), 'prefs-restore');
     $htmlForm->setSubmitText(wfMsg('restoreprefs'));
     $htmlForm->setTitle($this->getTitle('reset'));
     $htmlForm->setSubmitCallback(array(__CLASS__, 'submitReset'));
     $htmlForm->suppressReset();
     $htmlForm->show();
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:11,代码来源:SpecialPreferences.php

示例10: showResetForm

 function showResetForm()
 {
     $this->getOutput()->addWikiMsg('prefs-reset-intro');
     $htmlForm = new HTMLForm(array(), $this->getContext(), 'prefs-restore');
     $htmlForm->setSubmitText(wfMsg('restoreprefs'));
     $htmlForm->addHiddenField('username', $this->target);
     $htmlForm->addHiddenField('reset', '1');
     $htmlForm->setSubmitCallback(array($this, 'submitReset'));
     $htmlForm->suppressReset();
     $htmlForm->show();
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:11,代码来源:EditUser_body.php

示例11: execute

 function execute($par)
 {
     global $wgOut;
     $wgOut->setPageTitle(wfMsg('communityhiring-header'));
     $formDescriptor = array('about-intro' => array('type' => 'info', 'default' => wfMsgExt('communityhiring-about-intro', 'parse'), 'raw' => 1, 'section' => 'aboutyou'), 'given-name' => array('type' => 'text', 'label-message' => 'communityhiring-given', 'section' => 'aboutyou', 'validation-callback' => array($this, 'validateRequired')), 'family-name' => array('type' => 'text', 'label-message' => 'communityhiring-family', 'section' => 'aboutyou', 'validation-callback' => array($this, 'validateRequired')), 'address-line1' => array('type' => 'textarea', 'label-message' => 'communityhiring-address', 'section' => 'aboutyou', 'rows' => '3', 'cols' => '20'), 'address-city' => array('type' => 'text', 'label-message' => 'communityhiring-address-city', 'section' => 'aboutyou', 'validation-callback' => array($this, 'validateRequired')), 'address-postal' => array('type' => 'text', 'label-message' => 'communityhiring-address-postal', 'section' => 'aboutyou'), 'address-country' => array('type' => 'text', 'label-message' => 'communityhiring-address-country', 'section' => 'aboutyou', 'validation-callback' => array($this, 'validateRequired')), 'phone' => array('type' => 'text', 'label-message' => 'communityhiring-phone', 'section' => 'aboutyou'), 'email' => array('type' => 'text', 'label-message' => 'communityhiring-email', 'section' => 'aboutyou', 'validation-callback' => array($this, 'validateRequired')), 'paragraph-intro' => array('type' => 'info', 'default' => wfMsgExt('communityhiring-paragraphs-intro', 'parse'), 'raw' => 1, 'section' => 'paragraphs', 'vertical-label' => 1, 'validation-callback' => array($this, 'validateRequired')), 'significance' => array('type' => 'textarea', 'label-message' => 'communityhiring-significance', 'section' => 'paragraphs', 'rows' => 10, 'vertical-label' => 1, 'validation-callback' => array($this, 'validateRequired')), 'excitement' => array('type' => 'textarea', 'label-message' => 'communityhiring-excitement', 'section' => 'paragraphs', 'rows' => 10, 'vertical-label' => 1, 'validation-callback' => array($this, 'validateRequired')), 'experiences' => array('type' => 'textarea', 'label-message' => 'communityhiring-experiences', 'section' => 'paragraphs', 'rows' => 10, 'vertical-label' => 1, 'validation-callback' => array($this, 'validateRequired')), 'other' => array('type' => 'textarea', 'label-message' => 'communityhiring-other', 'section' => 'paragraphs', 'rows' => 10, 'vertical-label' => 1), 'languages' => array('type' => 'textarea', 'options' => array_flip(Language::getLanguageNames()), 'section' => 'demonstrative/languages', 'rows' => '3', 'label-message' => 'communityhiring-languages-label', 'vertical-label' => 1, 'validation-callback' => array($this, 'validateRequired')), 'contributor' => array('type' => 'radio', 'label-message' => 'communityhiring-contributor', 'section' => 'demonstrative/involvement', 'options' => array('Yes' => 'yes', 'No' => 'no')), 'usernames' => array('type' => 'textarea', 'rows' => '3', 'cols' => '20', 'label-message' => 'communityhiring-usernames', 'section' => 'demonstrative/involvement', 'vertical-label' => 1), 'wikimedia-links' => array('type' => 'textarea', 'label-message' => 'communityhiring-links', 'section' => 'demonstrative/involvement', 'rows' => '3', 'cols' => '20', 'vertical-label' => 1), 'other-links' => array('type' => 'textarea', 'label-message' => 'communityhiring-links-other', 'section' => 'demonstrative', 'rows' => '3', 'cols' => '20', 'vertical-label' => 1), 'availability-time' => array('type' => 'text', 'label-message' => 'communityhiring-availability-intro', 'section' => 'availability', 'vertical-label' => 1, 'validation-callback' => array($this, 'validateRequired')), 'availability-info' => array('type' => 'textarea', 'label-message' => 'communityhiring-availability-info', 'section' => 'availability', 'rows' => '5', 'cols' => '20', 'vertical-label' => 1), 'relocation' => array('type' => 'radio', 'label-message' => 'communityhiring-relocation-ok', 'section' => 'availability', 'vertical-label' => 1, 'options' => array('Yes' => 'yes', 'No' => 'no', 'It would be hard, but maybe I would' => 'maybe')), 'research' => array('type' => 'textarea', 'rows' => '5', 'label-message' => 'communityhiring-research', 'vertical-label' => 1, 'validation-callback' => array($this, 'validateRequired')));
     $form = new HTMLForm($formDescriptor, 'communityhiring');
     $form->setIntro(wfMsgExt('communityhiring-intro', 'parse'));
     $form->setSubmitCallback(array($this, 'submit'));
     $form->setTitle($this->getTitle());
     $form->show();
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:11,代码来源:SpecialCommunityHiring.php

示例12: showResetForm

 private function showResetForm()
 {
     if (!$this->getUser()->isAllowed('editmyoptions')) {
         throw new PermissionsError('editmyoptions');
     }
     $this->getOutput()->addWikiMsg('prefs-reset-intro');
     $context = new DerivativeContext($this->getContext());
     $context->setTitle($this->getPageTitle('reset'));
     // Reset subpage
     $htmlForm = new HTMLForm(array(), $context, 'prefs-restore');
     $htmlForm->setSubmitTextMsg('restoreprefs');
     $htmlForm->setSubmitCallback(array($this, 'submitReset'));
     $htmlForm->suppressReset();
     $htmlForm->show();
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:15,代码来源:SpecialPreferences.php

示例13: execute

 public function execute($par)
 {
     global $wgUser, $wgOut, $wgRequest;
     # Check permissions
     if (!$this->userCanExecute($wgUser)) {
         $this->displayRestrictionError();
         return;
     }
     # Check for database lock
     if (wfReadOnly()) {
         throw new ReadOnlyError();
     }
     list($this->target, $this->type) = SpecialBlock::getTargetAndType($par, $wgRequest);
     $this->block = Block::newFromTarget($this->target);
     # bug 15810: blocked admins should have limited access here.  This won't allow sysops
     # to remove autoblocks on themselves, but they should have ipblock-exempt anyway
     $status = SpecialBlock::checkUnblockSelf($this->target);
     if ($status !== true) {
         throw new ErrorPageError('badaccess', $status);
     }
     $wgOut->setPageTitle(wfMsg('unblockip'));
     $wgOut->addModules('mediawiki.special');
     $form = new HTMLForm($this->getFields(), $this->getContext());
     $form->setWrapperLegend(wfMsg('unblockip'));
     $form->setSubmitCallback(array(__CLASS__, 'processUnblock'));
     $form->setSubmitText(wfMsg('ipusubmit'));
     $form->addPreText(wfMsgExt('unblockiptext', 'parse'));
     if ($form->show()) {
         switch ($this->type) {
             case Block::TYPE_USER:
             case Block::TYPE_IP:
                 $wgOut->addWikiMsg('unblocked', $this->target);
                 break;
             case Block::TYPE_RANGE:
                 $wgOut->addWikiMsg('unblocked-range', $this->target);
                 break;
             case Block::TYPE_ID:
             case Block::TYPE_AUTO:
                 $wgOut->addWikiMsg('unblocked-id', $this->target);
                 break;
         }
     }
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:43,代码来源:SpecialUnblock.php

示例14: execute

 public function execute($par)
 {
     $this->checkPermissions();
     $this->checkReadOnly();
     list($this->target, $this->type) = SpecialBlock::getTargetAndType($par, $this->getRequest());
     $this->block = Block::newFromTarget($this->target);
     if ($this->target instanceof User) {
         # Set the 'relevant user' in the skin, so it displays links like Contributions,
         # User logs, UserRights, etc.
         $this->getSkin()->setRelevantUser($this->target);
     }
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->setPageTitle($this->msg('unblockip'));
     $out->addModules(['mediawiki.special', 'mediawiki.userSuggest']);
     $form = new HTMLForm($this->getFields(), $this->getContext());
     $form->setWrapperLegendMsg('unblockip');
     $form->setSubmitCallback([__CLASS__, 'processUIUnblock']);
     $form->setSubmitTextMsg('ipusubmit');
     $form->addPreText($this->msg('unblockiptext')->parseAsBlock());
     if ($form->show()) {
         switch ($this->type) {
             case Block::TYPE_IP:
                 $out->addWikiMsg('unblocked-ip', wfEscapeWikiText($this->target));
                 break;
             case Block::TYPE_USER:
                 $out->addWikiMsg('unblocked', wfEscapeWikiText($this->target));
                 break;
             case Block::TYPE_RANGE:
                 $out->addWikiMsg('unblocked-range', wfEscapeWikiText($this->target));
                 break;
             case Block::TYPE_ID:
             case Block::TYPE_AUTO:
                 $out->addWikiMsg('unblocked-id', wfEscapeWikiText($this->target));
                 break;
         }
     }
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:39,代码来源:SpecialUnblock.php

示例15: showDeletionForm

 /**
  * Show form if user wants to delete all data 
  */
 public function showDeletionForm()
 {
     $out = $this->out;
     $max_length = $this->max_string_formfield_length;
     $out->setPageTitle($out->msg('helperscripts'));
     $html = '';
     $html .= $this->getHTMLJavascriptLoader();
     $html .= "<div class='javascripthide'>";
     if (!empty($error_message)) {
         $html .= "<br>";
         $html .= "<div class = 'error'>{$error_message}</div>";
     }
     $html .= "</div>";
     $out->addHTML($html);
     $descriptor = array();
     $descriptor['phrase'] = array('label-message' => 'phrase-message', 'class' => 'HTMLTextField', 'type' => 'password', 'maxlength' => $max_length * 20);
     $html_form = new HTMLForm($descriptor, $out->getContext());
     $html_form->setSubmitText($out->msg('delete-submit'));
     $html_form->addHiddenField('phrase_posted', 'phrase_posted');
     $html_form->setSubmitCallback(array('SpecialHelperScripts', 'processInput'));
     return $html_form->show();
 }
开发者ID:akvankorlaar,项目名称:manuscriptdesk,代码行数:25,代码来源:HelperScriptsViewer.php


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