Movatterモバイル変換


[0]ホーム

URL:


MediaWiki master
HTMLForm.php
Go to the documentation of this file.
1<?php
2
10namespaceMediaWiki\HTMLForm;
11
12use DomainException;
13use InvalidArgumentException;
14use LogicException;
15useMediaWiki\Context\ContextSource;
16useMediaWiki\Context\IContextSource;
17use MediaWiki\HookContainer\ProtectedHookAccessorTrait;
18useMediaWiki\Html\Html;
19useMediaWiki\HTMLForm\Field\HTMLApiField;
20useMediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField;
21useMediaWiki\HTMLForm\Field\HTMLCheckField;
22useMediaWiki\HTMLForm\Field\HTMLCheckMatrix;
23useMediaWiki\HTMLForm\Field\HTMLComboboxField;
24useMediaWiki\HTMLForm\Field\HTMLDateTimeField;
25useMediaWiki\HTMLForm\Field\HTMLEditTools;
26useMediaWiki\HTMLForm\Field\HTMLExpiryField;
27useMediaWiki\HTMLForm\Field\HTMLFileField;
28useMediaWiki\HTMLForm\Field\HTMLFloatField;
29useMediaWiki\HTMLForm\Field\HTMLFormFieldCloner;
30useMediaWiki\HTMLForm\Field\HTMLHiddenField;
31useMediaWiki\HTMLForm\Field\HTMLInfoField;
32useMediaWiki\HTMLForm\Field\HTMLIntField;
33useMediaWiki\HTMLForm\Field\HTMLMultiSelectField;
34useMediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField;
35useMediaWiki\HTMLForm\Field\HTMLOrderedMultiselectField;
36useMediaWiki\HTMLForm\Field\HTMLRadioField;
37useMediaWiki\HTMLForm\Field\HTMLSelectAndOtherField;
38useMediaWiki\HTMLForm\Field\HTMLSelectField;
39useMediaWiki\HTMLForm\Field\HTMLSelectLanguageField;
40useMediaWiki\HTMLForm\Field\HTMLSelectLimitField;
41useMediaWiki\HTMLForm\Field\HTMLSelectNamespace;
42useMediaWiki\HTMLForm\Field\HTMLSelectNamespaceWithButton;
43useMediaWiki\HTMLForm\Field\HTMLSelectOrOtherField;
44useMediaWiki\HTMLForm\Field\HTMLSizeFilterField;
45useMediaWiki\HTMLForm\Field\HTMLSubmitField;
46useMediaWiki\HTMLForm\Field\HTMLTagFilter;
47useMediaWiki\HTMLForm\Field\HTMLTagMultiselectField;
48useMediaWiki\HTMLForm\Field\HTMLTextAreaField;
49useMediaWiki\HTMLForm\Field\HTMLTextField;
50useMediaWiki\HTMLForm\Field\HTMLTextFieldWithButton;
51useMediaWiki\HTMLForm\Field\HTMLTimezoneField;
52useMediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField;
53useMediaWiki\HTMLForm\Field\HTMLTitleTextField;
54useMediaWiki\HTMLForm\Field\HTMLUsersMultiselectField;
55useMediaWiki\HTMLForm\Field\HTMLUserTextField;
56useMediaWiki\Linker\Linker;
57useMediaWiki\Linker\LinkTarget;
58useMediaWiki\MainConfigNames;
59useMediaWiki\Message\Message;
60useMediaWiki\Page\PageReference;
61useMediaWiki\Parser\Sanitizer;
62useMediaWiki\Session\CsrfTokenSet;
63useMediaWiki\Status\Status;
64useMediaWiki\Title\Title;
65useMediaWiki\Title\TitleValue;
66useStatusValue;
67use Stringable;
68useWikimedia\Message\MessageParam;
69useWikimedia\Message\MessageSpecifier;
70
195classHTMLFormextendsContextSource {
196 use ProtectedHookAccessorTrait;
197
199publicstatic$typeMappings = [
200'api' => HTMLApiField::class,
201'text' => HTMLTextField::class,
202'textwithbutton' => HTMLTextFieldWithButton::class,
203'textarea' => HTMLTextAreaField::class,
204'select' => HTMLSelectField::class,
205'combobox' => HTMLComboboxField::class,
206'radio' => HTMLRadioField::class,
207'multiselect' => HTMLMultiSelectField::class,
208'limitselect' => HTMLSelectLimitField::class,
209'check' => HTMLCheckField::class,
210'toggle' => HTMLCheckField::class,
211'int' => HTMLIntField::class,
212'file' => HTMLFileField::class,
213'float' => HTMLFloatField::class,
214'info' => HTMLInfoField::class,
215'selectorother' => HTMLSelectOrOtherField::class,
216'selectandother' => HTMLSelectAndOtherField::class,
217'namespaceselect' => HTMLSelectNamespace::class,
218'namespaceselectwithbutton' => HTMLSelectNamespaceWithButton::class,
219'tagfilter' => HTMLTagFilter::class,
220'sizefilter' => HTMLSizeFilterField::class,
221'submit' => HTMLSubmitField::class,
222'hidden' => HTMLHiddenField::class,
223'edittools' => HTMLEditTools::class,
224'checkmatrix' => HTMLCheckMatrix::class,
225'cloner' => HTMLFormFieldCloner::class,
226'autocompleteselect' => HTMLAutoCompleteSelectField::class,
227'language' => HTMLSelectLanguageField::class,
228'date' => HTMLDateTimeField::class,
229'time' => HTMLDateTimeField::class,
230'datetime' => HTMLDateTimeField::class,
231'expiry' => HTMLExpiryField::class,
232'timezone' => HTMLTimezoneField::class,
233// HTMLTextField will output the correct type="" attribute automagically.
234// There are about four zillion other HTML5 input types, like range, but
235// we don't use those at the moment, so no point in adding all of them.
236'email' => HTMLTextField::class,
237'password' => HTMLTextField::class,
238'url' => HTMLTextField::class,
239'title' => HTMLTitleTextField::class,
240'user' => HTMLUserTextField::class,
241'tagmultiselect' => HTMLTagMultiselectField::class,
242'orderedmultiselect' => HTMLOrderedMultiselectField::class,
243'usersmultiselect' => HTMLUsersMultiselectField::class,
244'titlesmultiselect' => HTMLTitlesMultiselectField::class,
245'namespacesmultiselect' => HTMLNamespacesMultiselectField::class,
246 ];
247
249public$mFieldData;
250
252protected$mMessagePrefix;
253
255protected$mFlatFields = [];
257protected$mFieldTree = [];
259protected$mShowSubmit =true;
261protected$mSubmitFlags = ['primary','progressive' ];
263protected$mShowCancel =false;
265protected$mCancelTarget;
266
268protected$mSubmitCallback;
273protected$mValidationErrorMessage;
274
276protected$mPre ='';
278protected$mHeader ='';
280protected$mFooter ='';
282protected$mSectionHeaders = [];
284protected$mSectionFooters = [];
286protected$mPost ='';
288protected$mId;
290protected$mName;
292protected$mTableId ='';
293
295protected$mSubmitID;
297protected$mSubmitName;
299protected$mSubmitText;
301protected$mSubmitTooltip;
302
304protected$mFormIdentifier;
306protected$mSingleForm =false;
307
309protected$mTitle;
311protected$mMethod ='post';
313protected$mWasSubmitted =false;
314
320protected$mAction =false;
321
327protected$mCollapsible =false;
328
334protected$mCollapsed =false;
335
341protected$mAutocomplete =null;
342
344protected$mUseMultipart =false;
349protected$mHiddenFields = [];
354protected$mButtons = [];
355
357protected$mWrapperLegend =false;
359protected$mWrapperAttributes = [];
360
365protected$mTokenSalt ='';
366
379protected$mSections = [];
380
389protected$mSubSectionBeforeFields =true;
390
396protected$displayFormat ='table';
397
402protected$availableDisplayFormats = [
403'table',
404'div',
405'raw',
406'inline',
407 ];
408
413protected$availableSubclassDisplayFormats = [
414'vform',// deprecated since 1.45
415'codex',
416'ooui',
417 ];
418
423private $hiddenTitleAddedToForm =false;
424
438publicstaticfunctionfactory(
439$displayFormat, $descriptor,IContextSource $context, $messagePrefix =''
440 ) {
441switch ($displayFormat ) {
442case'codex':
443returnnewCodexHTMLForm( $descriptor, $context, $messagePrefix );
444case'vform':
445wfDeprecatedMsg("'vform' HTMLForm display format is deprecated",'1.45' );
446returnnewVFormHTMLForm( $descriptor, $context, $messagePrefix );
447case'ooui':
448returnnewOOUIHTMLForm( $descriptor, $context, $messagePrefix );
449default:
450 $form =newself( $descriptor, $context, $messagePrefix );
451 $form->setDisplayFormat($displayFormat );
452return $form;
453 }
454 }
455
467publicfunction__construct(
468 $descriptor,IContextSource $context, $messagePrefix =''
469 ) {
470 $this->setContext( $context );
471 $this->mMessagePrefix = $messagePrefix;
472 $this->addFields( $descriptor );
473 }
474
484publicfunctionaddFields( $descriptor ) {
485 $loadedDescriptor = [];
486
487foreach ( $descriptor as $fieldname => $info ) {
488 $section = $info['section'] ??'';
489
490if ( isset( $info['type'] ) && $info['type'] ==='file' ) {
491 $this->mUseMultipart =true;
492 }
493
494 $field = static::loadInputFromParameters( $fieldname, $info, $this );
495
496 $setSection =& $loadedDescriptor;
497if ( $section ) {
498foreach ( explode('/', $section ) as $newName ) {
499 $setSection[$newName] ??= [];
500 $setSection =& $setSection[$newName];
501 }
502 }
503
504 $setSection[$fieldname] = $field;
505 $this->mFlatFields[$fieldname] = $field;
506 }
507
508 $this->mFieldTree = array_merge_recursive( $this->mFieldTree, $loadedDescriptor );
509
510return $this;
511 }
512
517publicfunctionhasField( $fieldname ) {
518return isset( $this->mFlatFields[$fieldname] );
519 }
520
526publicfunctiongetField( $fieldname ) {
527if ( !$this->hasField( $fieldname ) ) {
528thrownew DomainException( __METHOD__ .': no field named ' . $fieldname );
529 }
530return $this->mFlatFields[$fieldname];
531 }
532
542publicfunctionsetDisplayFormat( $format ) {
543if (
544 in_array( $format, $this->availableSubclassDisplayFormats,true ) ||
545 in_array( $this->displayFormat, $this->availableSubclassDisplayFormats,true )
546 ) {
547thrownew LogicException('Cannot change display format after creation, ' .
548'use HTMLForm::factory() instead' );
549 }
550
551if ( !in_array( $format, $this->availableDisplayFormats,true ) ) {
552thrownew InvalidArgumentException('Display format must be one of ' .
553 print_r(
554 array_merge(
555 $this->availableDisplayFormats,
556 $this->availableSubclassDisplayFormats
557 ),
558true
559 ) );
560 }
561
562 $this->displayFormat = $format;
563
564return $this;
565 }
566
572publicfunctiongetDisplayFormat() {
574 }
575
592publicstaticfunctiongetClassFromDescriptor( $fieldname, &$descriptor ) {
593if ( isset( $descriptor['class'] ) ) {
594 $class = $descriptor['class'];
595 } elseif ( isset( $descriptor['type'] ) ) {
596 $class = static::$typeMappings[$descriptor['type']];
597 $descriptor['class'] = $class;
598 }else {
599 $class =null;
600 }
601
602if ( !$class ) {
603thrownew InvalidArgumentException("Descriptor with no class for $fieldname: "
604 . print_r( $descriptor,true ) );
605 }
606
607return $class;
608 }
609
622publicstaticfunctionloadInputFromParameters( $fieldname, $descriptor,
623 ?HTMLForm $parent =null
624 ) {
625 $class = static::getClassFromDescriptor( $fieldname, $descriptor );
626
627 $descriptor['fieldname'] = $fieldname;
628if ( $parent ) {
629 $descriptor['parent'] = $parent;
630 }
631
632 # @todo This will throw a fatal error whenever someone try to use
633 # 'class' to feed a CSS class instead of 'cssclass'. Would be
634 # great to avoid the fatal error and show a nice error.
635returnnew $class( $descriptor );
636 }
637
646publicfunctionprepareForm() {
647 # Load data from the request.
648if (
649 $this->mFormIdentifier ===null ||
650 $this->getRequest()->getVal('wpFormIdentifier' ) === $this->mFormIdentifier ||
651 ( $this->mSingleForm && $this->getMethod() ==='get' )
652 ) {
653 $this->loadFieldData();
654 }else {
655 $this->mFieldData = [];
656 }
657
658return $this;
659 }
660
665publicfunctiontryAuthorizedSubmit() {
666 $result =false;
667
668if ( $this->mFormIdentifier ===null ) {
669 $identOkay =true;
670 }else {
671 $identOkay = $this->getRequest()->getVal('wpFormIdentifier' ) ===$this->mFormIdentifier;
672 }
673
674 $tokenOkay =false;
675if ( $this->getMethod() !=='post' ) {
676 $tokenOkay =true;// no session check needed
677 } elseif ( $this->getRequest()->wasPosted() ) {
678 $editToken = $this->getRequest()->getVal('wpEditToken' );
679if ( $this->getUser()->isRegistered() || $editToken !==null ) {
680// Session tokens for logged-out users have no security value.
681// However, if the user gave one, check it in order to give a nice
682// "session expired" error instead of "permission denied" or such.
683 $tokenOkay = $this->getCsrfTokenSet()->matchTokenField(
684 CsrfTokenSet::DEFAULT_FIELD_NAME, $this->mTokenSalt
685 );
686 }else {
687 $tokenOkay =true;
688 }
689 }
690
691if ( $tokenOkay && $identOkay ) {
692 $this->mWasSubmitted =true;
693 $result = $this->trySubmit();
694 }
695
696return $result;
697 }
698
706publicfunctionshow() {
707 $this->prepareForm();
708
709 $result = $this->tryAuthorizedSubmit();
710if ( $result ===true || ( $result instanceofStatus && $result->isGood() ) ) {
711return $result;
712 }
713
714 $this->displayForm( $result );
715
716returnfalse;
717 }
718
724publicfunctionshowAlways() {
725 $this->prepareForm();
726
727 $result = $this->tryAuthorizedSubmit();
728
729 $this->displayForm( $result );
730
731return $result;
732 }
733
745publicfunctiontrySubmit() {
746 $valid =true;
747 $hoistedErrors = Status::newGood();
748if ( $this->mValidationErrorMessage ) {
749foreach ( $this->mValidationErrorMessage as $error ) {
750 $hoistedErrors->fatal( ...$error );
751 }
752 }else {
753 $hoistedErrors->fatal('htmlform-invalid-input' );
754 }
755
756 $this->mWasSubmitted =true;
757
758 # Check for cancelled submission
759foreach ( $this->mFlatFields as $fieldname => $field ) {
760if ( !array_key_exists( $fieldname, $this->mFieldData ) ) {
761continue;
762 }
763if ( $field->cancelSubmit( $this->mFieldData[$fieldname], $this->mFieldData ) ) {
764 $this->mWasSubmitted =false;
765returnfalse;
766 }
767 }
768
769 # Check for validation
770 $hasNonDefault =false;
771foreach ( $this->mFlatFields as $fieldname => $field ) {
772if ( !array_key_exists( $fieldname, $this->mFieldData ) ) {
773continue;
774 }
775 $hasNonDefault = $hasNonDefault || $this->mFieldData[$fieldname] !== $field->getDefault();
776if ( $field->isDisabled( $this->mFieldData ) ) {
777continue;
778 }
779 $res = $field->validate( $this->mFieldData[$fieldname], $this->mFieldData );
780if ( $res !==true ) {
781 $valid =false;
782if ( $res !==false && !$field->canDisplayErrors() ) {
783if ( is_string( $res ) ) {
784 $hoistedErrors->fatal('rawmessage', $res );
785 }else {
786 $hoistedErrors->fatal( $res );
787 }
788 }
789 }
790 }
791
792if ( !$valid ) {
793// Treat as not submitted if got nothing from the user on GET forms.
794if ( !$hasNonDefault && $this->getMethod() ==='get' &&
795 ( $this->mFormIdentifier ===null ||
796 $this->getRequest()->getCheck('wpFormIdentifier' ) )
797 ) {
798 $this->mWasSubmitted =false;
799returnfalse;
800 }
801return $hoistedErrors;
802 }
803
804 $callback =$this->mSubmitCallback;
805if ( !is_callable( $callback ) ) {
806thrownew LogicException('HTMLForm: no submit callback provided. Use ' .
807'setSubmitCallback() to set one.' );
808 }
809
810 $data = $this->filterDataForSubmit( $this->mFieldData );
811
812 $res = $callback( $data, $this );
813if ( $res ===false ) {
814 $this->mWasSubmitted =false;
815 } elseif ( $res instanceofStatusValue ) {
816// DWIM - callbacks are not supposed to return a StatusValue but it's easy to mix up.
817 $res = Status::wrap( $res );
818 }
819
820return $res;
821 }
822
834publicfunctionwasSubmitted() {
836 }
837
848publicfunctionsetSubmitCallback( $cb ) {
849 $this->mSubmitCallback = $cb;
850
851return $this;
852 }
853
863publicfunctionsetValidationErrorMessage( $msg ) {
864 $this->mValidationErrorMessage = $msg;
865
866return $this;
867 }
868
877publicfunctionsetPreHtml( $html ) {
878 $this->mPre = $html;
879
880return $this;
881 }
882
891publicfunctionaddPreHtml( $html ) {
892 $this->mPre .= $html;
893
894return $this;
895 }
896
903publicfunctiongetPreHtml() {
904return$this->mPre;
905 }
906
916publicfunctionaddHeaderHtml( $html, $section =null ) {
917if ( $section ===null ) {
918 $this->mHeader .= $html;
919 }else {
920 $this->mSectionHeaders[$section] ??='';
921 $this->mSectionHeaders[$section] .= $html;
922 }
923
924return $this;
925 }
926
936publicfunctionsetHeaderHtml( $html, $section =null ) {
937if ( $section ===null ) {
938 $this->mHeader = $html;
939 }else {
940 $this->mSectionHeaders[$section] = $html;
941 }
942
943return $this;
944 }
945
954publicfunctiongetHeaderHtml( $section =null ) {
955return $section ? $this->mSectionHeaders[$section] ??'' :$this->mHeader;
956 }
957
967publicfunctionaddFooterHtml( $html, $section =null ) {
968if ( $section ===null ) {
969 $this->mFooter .= $html;
970 }else {
971 $this->mSectionFooters[$section] ??='';
972 $this->mSectionFooters[$section] .= $html;
973 }
974
975return $this;
976 }
977
987publicfunctionsetFooterHtml( $html, $section =null ) {
988if ( $section ===null ) {
989 $this->mFooter = $html;
990 }else {
991 $this->mSectionFooters[$section] = $html;
992 }
993
994return $this;
995 }
996
1004publicfunctiongetFooterHtml( $section =null ) {
1005return $section ? $this->mSectionFooters[$section] ??'' :$this->mFooter;
1006 }
1007
1016publicfunctionaddPostHtml( $html ) {
1017 $this->mPost .= $html;
1018
1019return $this;
1020 }
1021
1030publicfunctionsetPostHtml( $html ) {
1031 $this->mPost = $html;
1032
1033return $this;
1034 }
1035
1042publicfunctiongetPostHtml() {
1043return$this->mPost;
1044 }
1045
1055publicfunctionsetSections( $sections ) {
1056if ( $this->getDisplayFormat() !=='codex' ) {
1057throw new \InvalidArgumentException(
1058"Non-Codex HTMLForms do not support additional section information."
1059 );
1060 }
1061
1062 $this->mSections = $sections;
1063
1064return $this;
1065 }
1066
1077publicfunctionaddHiddenField( $name, $value, array $attribs = [] ) {
1078if ( !is_array( $value ) ) {
1079// Per WebRequest::getVal: Array values are discarded for security reasons.
1080 $attribs += ['name' => $name ];
1081 $this->mHiddenFields[] = [ $value, $attribs ];
1082 }
1083
1084return $this;
1085 }
1086
1098publicfunctionaddHiddenFields( array $fields ) {
1099foreach ( $fields as $name => $value ) {
1100if ( is_array( $value ) ) {
1101// Per WebRequest::getVal: Array values are discarded for security reasons.
1102continue;
1103 }
1104 $this->mHiddenFields[] = [ $value, ['name' => $name ] ];
1105 }
1106
1107return $this;
1108 }
1109
1133publicfunctionaddButton( $data ) {
1134if ( !is_array( $data ) ) {
1135 $args = func_get_args();
1136if ( count( $args ) < 2 || count( $args ) > 4 ) {
1137thrownew InvalidArgumentException(
1138'Incorrect number of arguments for deprecated calling style'
1139 );
1140 }
1141 $data = [
1142'name' => $args[0],
1143'value' => $args[1],
1144'id' => $args[2] ??null,
1145'attribs' => $args[3] ??null,
1146 ];
1147 }else {
1148if ( !isset( $data['name'] ) ) {
1149thrownew InvalidArgumentException('A name is required' );
1150 }
1151if ( !isset( $data['value'] ) ) {
1152thrownew InvalidArgumentException('A value is required' );
1153 }
1154 }
1155 $this->mButtons[] = $data + [
1156'id' =>null,
1157'attribs' =>null,
1158'flags' =>null,
1159'framed' =>true,
1160 ];
1161
1162return $this;
1163 }
1164
1174publicfunctionsetTokenSalt( $salt ) {
1175 $this->mTokenSalt = $salt;
1176
1177return $this;
1178 }
1179
1194publicfunctiondisplayForm( $submitResult ) {
1195 $this->getOutput()->addHTML( $this->getHTML( $submitResult ) );
1196 }
1197
1201privatefunction getHiddenTitle(): string {
1202if ( $this->hiddenTitleAddedToForm ) {
1203return'';
1204 }
1205
1206 $html ='';
1207if ( $this->getMethod() ==='post' ||
1208 $this->getAction() === $this->getConfig()->get(MainConfigNames::Script )
1209 ) {
1210 $html .= Html::hidden('title', $this->getTitle()->getPrefixedText() ) ."\n";
1211 }
1212 $this->hiddenTitleAddedToForm =true;
1213return $html;
1214 }
1215
1226publicfunctiongetHTML( $submitResult ) {
1227 # For good measure (it is the default)
1228 $this->getOutput()->getMetadata()->setPreventClickjacking(true );
1229 $this->getOutput()->addModules('mediawiki.htmlform' );
1230 $this->getOutput()->addModuleStyles( [
1231'mediawiki.htmlform.styles',
1232// Html::errorBox and Html::warningBox used by HtmlFormField and HtmlForm::getErrorsOrWarnings
1233'mediawiki.codex.messagebox.styles'
1234 ] );
1235
1236if ( $this->mCollapsible ) {
1237// Preload jquery.makeCollapsible for mediawiki.htmlform
1238 $this->getOutput()->addModules('jquery.makeCollapsible' );
1239 }
1240
1241 $headerHtml = $this->getHeaderHtml();
1242 $footerHtml = $this->getFooterHtml();
1243 $html = $this->getErrorsOrWarnings( $submitResult,'error' )
1244 . $this->getErrorsOrWarnings( $submitResult,'warning' )
1245 . $headerHtml
1246 . $this->getHiddenTitle()
1247 . $this->getBody()
1248 . $this->getHiddenFields()
1249 . $this->getButtons()
1250 . $footerHtml;
1251
1252return $this->mPre . $this->wrapForm( $html ) . $this->mPost;
1253 }
1254
1262publicfunctionsetCollapsibleOptions( $collapsedByDefault =false ) {
1263 $this->mCollapsible =true;
1264 $this->mCollapsed = $collapsedByDefault;
1265return $this;
1266 }
1267
1273protectedfunctiongetFormAttributes() {
1274 # Use multipart/form-data
1275 $encType = $this->mUseMultipart
1276 ?'multipart/form-data'
1277 :'application/x-www-form-urlencoded';
1278 # Attributes
1279 $attribs = [
1280'class' =>'mw-htmlform',
1281'action' => $this->getAction(),
1282'method' => $this->getMethod(),
1283'enctype' => $encType,
1284 ];
1285if ( $this->mId ) {
1286 $attribs['id'] = $this->mId;
1287 }
1288if ( is_string( $this->mAutocomplete ) ) {
1289 $attribs['autocomplete'] = $this->mAutocomplete;
1290 }
1291if ( $this->mName ) {
1292 $attribs['name'] = $this->mName;
1293 }
1294if ( $this->needsJSForHtml5FormValidation() ) {
1295 $attribs['novalidate'] =true;
1296 }
1297return $attribs;
1298 }
1299
1307publicfunctionwrapForm( $html ) {
1308 # Include a <fieldset> wrapper for style, if requested.
1309if ( $this->mWrapperLegend !==false ) {
1310 $legend = is_string( $this->mWrapperLegend ) ? $this->mWrapperLegend :false;
1311 $html = Html::rawElement(
1312'fieldset',
1313 $this->mWrapperAttributes,
1314 ( $legend ?Html::element('legend', [], $legend ) :'' ) . $html
1315 );
1316 }
1317
1318return Html::rawElement(
1319'form',
1320 $this->getFormAttributes(),
1321 $html
1322 );
1323 }
1324
1329publicfunctiongetHiddenFields() {
1330 $html ='';
1331
1332// add the title as a hidden file if it hasn't been added yet and if it is necessary
1333// added for backward compatibility with the previous version of this public method
1334 $html .= $this->getHiddenTitle();
1335
1336if ( $this->mFormIdentifier !==null ) {
1337 $html .= Html::hidden(
1338'wpFormIdentifier',
1339 $this->mFormIdentifier
1340 ) ."\n";
1341 }
1342if ( $this->getMethod() ==='post' ) {
1343 $html .= Html::hidden(
1344'wpEditToken',
1345 $this->getUser()->getEditToken( $this->mTokenSalt ),
1346 ['id' =>'wpEditToken' ]
1347 ) ."\n";
1348 }
1349
1350foreach ( $this->mHiddenFields as [ $value, $attribs ] ) {
1351 $html .= Html::hidden( $attribs['name'], $value, $attribs ) ."\n";
1352 }
1353
1354return $html;
1355 }
1356
1362publicfunctiongetButtons() {
1363 $buttons ='';
1364
1365if ( $this->mShowSubmit ) {
1366 $attribs = [];
1367
1368if ( $this->mSubmitID !==null ) {
1369 $attribs['id'] = $this->mSubmitID;
1370 }
1371
1372if ( $this->mSubmitName !==null ) {
1373 $attribs['name'] = $this->mSubmitName;
1374 }
1375
1376if ( $this->mSubmitTooltip !==null ) {
1377 $attribs += Linker::tooltipAndAccesskeyAttribs( $this->mSubmitTooltip );
1378 }
1379
1380 $attribs['class'] = ['mw-htmlform-submit' ];
1381
1382 $buttons .= Html::submitButton( $this->getSubmitText(), $attribs ) ."\n";
1383 }
1384
1385if ( $this->mShowCancel ) {
1386 $target = $this->getCancelTargetURL();
1387 $buttons .=Html::element(
1388'a',
1389 [
1390'href' => $target,
1391 ],
1392 $this->msg('cancel' )->text()
1393 ) ."\n";
1394 }
1395
1396foreach ( $this->mButtons as $button ) {
1397 $attrs = [
1398'type' =>'submit',
1399'name' => $button['name'],
1400'value' => $button['value']
1401 ];
1402
1403if ( isset( $button['label-message'] ) ) {
1404 $label = $this->getMessage( $button['label-message'] )->parse();
1405 } elseif ( isset( $button['label'] ) ) {
1406 $label = htmlspecialchars( $button['label'] );
1407 } elseif ( isset( $button['label-raw'] ) ) {
1408 $label = $button['label-raw'];
1409 }else {
1410 $label = htmlspecialchars( $button['value'] );
1411 }
1412
1413// @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset Always set in self::addButton
1414if ( $button['attribs'] ) {
1415// @phan-suppress-next-line PhanTypePossiblyInvalidDimOffset Always set in self::addButton
1416 $attrs += $button['attribs'];
1417 }
1418
1419if ( isset( $button['id'] ) ) {
1420 $attrs['id'] = $button['id'];
1421 }
1422
1423 $buttons .= Html::rawElement('button', $attrs, $label ) ."\n";
1424 }
1425
1426if ( !$buttons ) {
1427return'';
1428 }
1429
1430return Html::rawElement('span',
1431 ['class' =>'mw-htmlform-submit-buttons' ],"\n$buttons" ) ."\n";
1432 }
1433
1439publicfunctiongetBody() {
1440return $this->displaySection( $this->mFieldTree, $this->mTableId );
1441 }
1442
1452publicfunctiongetErrorsOrWarnings( $elements, $elementsType ) {
1453if ( !in_array( $elementsType, ['error','warning' ],true ) ) {
1454thrownew DomainException( $elementsType .' is not a valid type.' );
1455 }
1456 $elementstr =false;
1457if ( $elements instanceofStatus ) {
1458 [ $errorStatus, $warningStatus ] = $elements->splitByErrorType();
1459 $status = $elementsType ==='error' ? $errorStatus : $warningStatus;
1460if ( $status->isGood() ) {
1461 $elementstr ='';
1462 }else {
1463 $elementstr = $status
1464 ->getMessage()
1465 ->setContext( $this )
1466 ->setInterfaceMessageFlag(true )
1467 ->parse();
1468 }
1469 } elseif ( $elementsType ==='error' ) {
1470if ( is_array( $elements ) ) {
1471 $elementstr = $this->formatErrors( $elements );
1472 } elseif ( $elements && $elements !==true ) {
1473 $elementstr = (string)$elements;
1474 }
1475 }
1476
1477if ( !$elementstr ) {
1478return'';
1479 } elseif ( $elementsType ==='error' ) {
1480return Html::errorBox( $elementstr );
1481 }else {// $elementsType can only be 'warning'
1482return Html::warningBox( $elementstr );
1483 }
1484 }
1485
1493publicfunctionformatErrors( $errors ) {
1494 $errorstr ='';
1495
1496foreach ( $errors as $error ) {
1497 $errorstr .= Html::rawElement(
1498'li',
1499 [],
1500 $this->getMessage( $error )->parse()
1501 );
1502 }
1503
1504return Html::rawElement('ul', [], $errorstr );
1505 }
1506
1514publicfunctionsetSubmitText( $t ) {
1515 $this->mSubmitText = $t;
1516
1517return $this;
1518 }
1519
1526publicfunctionsetSubmitDestructive() {
1527 $this->mSubmitFlags = ['destructive','primary' ];
1528
1529return $this;
1530 }
1531
1540publicfunctionsetSubmitTextMsg( $msg ) {
1541if ( !$msg instanceofMessage ) {
1542 $msg = $this->msg( $msg );
1543 }
1544 $this->setSubmitText( $msg->text() );
1545
1546return $this;
1547 }
1548
1553publicfunctiongetSubmitText() {
1554return $this->mSubmitText ?: $this->msg('htmlform-submit' )->text();
1555 }
1556
1562publicfunctionsetSubmitName( $name ) {
1563 $this->mSubmitName = $name;
1564
1565return $this;
1566 }
1567
1573publicfunctionsetSubmitTooltip( $name ) {
1574 $this->mSubmitTooltip = $name;
1575
1576return $this;
1577 }
1578
1587publicfunctionsetSubmitID( $t ) {
1588 $this->mSubmitID = $t;
1589
1590return $this;
1591 }
1592
1611publicfunctionsetFormIdentifier(string $ident,bool $single =false ) {
1612 $this->mFormIdentifier = $ident;
1613 $this->mSingleForm = $single;
1614
1615return $this;
1616 }
1617
1628publicfunctionsuppressDefaultSubmit( $suppressSubmit =true ) {
1629 $this->mShowSubmit = !$suppressSubmit;
1630
1631return $this;
1632 }
1633
1640publicfunctionshowCancel( $show =true ) {
1641 $this->mShowCancel = $show;
1642return $this;
1643 }
1644
1651publicfunctionsetCancelTarget( $target ) {
1652if ( $target instanceofPageReference ) {
1653 $target = TitleValue::castPageToLinkTarget( $target );
1654 }
1655
1656 $this->mCancelTarget = $target;
1657return $this;
1658 }
1659
1664protectedfunctiongetCancelTargetURL() {
1665if ( is_string( $this->mCancelTarget ) ) {
1666return $this->mCancelTarget;
1667 }else {
1668// TODO: use a service to get the local URL for a LinkTarget, see T282283
1669 $target = Title::castFromLinkTarget( $this->mCancelTarget ) ?: Title::newMainPage();
1670return $target->getLocalURL();
1671 }
1672 }
1673
1683publicfunctionsetTableId( $id ) {
1684 $this->mTableId = $id;
1685
1686return $this;
1687 }
1688
1694publicfunctionsetId( $id ) {
1695 $this->mId = $id;
1696
1697return $this;
1698 }
1699
1704publicfunctionsetName( $name ) {
1705 $this->mName = $name;
1706
1707return $this;
1708 }
1709
1721publicfunctionsetWrapperLegend( $legend ) {
1722 $this->mWrapperLegend = $legend;
1723
1724return $this;
1725 }
1726
1734publicfunctionsetWrapperAttributes( $attributes ) {
1735 $this->mWrapperAttributes = $attributes;
1736
1737return $this;
1738 }
1739
1749publicfunctionsetWrapperLegendMsg( $msg ) {
1750if ( !$msg instanceofMessage ) {
1751 $msg = $this->msg( $msg );
1752 }
1753 $this->setWrapperLegend( $msg->text() );
1754
1755return $this;
1756 }
1757
1767publicfunctionsetMessagePrefix( $p ) {
1768 $this->mMessagePrefix = $p;
1769
1770return $this;
1771 }
1772
1780publicfunctionsetTitle( $t ) {
1781// TODO: make mTitle a PageReference when we have a better way to get URLs, see T282283.
1782 $this->mTitle = Title::castFromPageReference( $t );
1783
1784return $this;
1785 }
1786
1790publicfunctiongetTitle() {
1791return $this->mTitle ?: $this->getContext()->getTitle();
1792 }
1793
1801publicfunctionsetMethod( $method ='post' ) {
1802 $this->mMethod = strtolower( $method );
1803
1804return $this;
1805 }
1806
1810publicfunctiongetMethod() {
1811return $this->mMethod;
1812 }
1813
1824protectedfunctionwrapFieldSetSection( $legend, $section, $attributes, $isRoot ) {
1825return Html::rawElement(
1826'fieldset',
1827 $attributes,
1828Html::element('legend', [], $legend ) . $section
1829 ) ."\n";
1830 }
1831
1850publicfunctiondisplaySection( $fields,
1851 $sectionName ='',
1852 $fieldsetIDPrefix ='',
1853 &$hasUserVisibleFields =false
1854 ) {
1855if ( $this->mFieldData ===null ) {
1856thrownew LogicException('HTMLForm::displaySection() called on uninitialized field data. '
1857 .'You probably called displayForm() without calling prepareForm() first.' );
1858 }
1859
1860 $html = [];
1861 $subsectionHtml ='';
1862 $hasLabel =false;
1863
1864foreach ( $fields as $key => $value ) {
1865if ( $value instanceofHTMLFormField ) {
1866 $v = array_key_exists( $key, $this->mFieldData )
1867 ? $this->mFieldData[$key]
1868 : $value->getDefault();
1869
1870 $retval = $this->formatField( $value, $v ??'' );
1871
1872// check, if the form field should be added to
1873// the output.
1874if ( $value->hasVisibleOutput() ) {
1875 $html[] = $retval;
1876
1877 $labelValue = trim( $value->getLabel() );
1878if ( $labelValue !=="\u{00A0}" && $labelValue !=='&#160;' && $labelValue !=='' ) {
1879 $hasLabel =true;
1880 }
1881
1882 $hasUserVisibleFields =true;
1883 }
1884 } elseif ( is_array( $value ) ) {
1885 $subsectionHasVisibleFields =false;
1886 $section =
1887 $this->displaySection( $value,
1888"mw-htmlform-$key",
1889"$fieldsetIDPrefix$key-",
1890 $subsectionHasVisibleFields );
1891
1892if ( $subsectionHasVisibleFields ===true ) {
1893// Display the section with various niceties.
1894 $hasUserVisibleFields =true;
1895
1896 $legend = $this->getLegend( $key );
1897
1898 $headerHtml = $this->getHeaderHtml( $key );
1899 $footerHtml = $this->getFooterHtml( $key );
1900 $section = $headerHtml .
1901 $section .
1902 $footerHtml;
1903
1904 $attributes = [];
1905if ( $fieldsetIDPrefix ) {
1906 $attributes['id'] = Sanitizer::escapeIdForAttribute("$fieldsetIDPrefix$key" );
1907 }
1908 $subsectionHtml .= $this->wrapFieldSetSection(
1909 $legend, $section, $attributes, $fields === $this->mFieldTree
1910 );
1911 }else {
1912// Just return the inputs, nothing fancy.
1913 $subsectionHtml .= $section;
1914 }
1915 }
1916 }
1917
1918 $html = $this->formatSection( $html, $sectionName, $hasLabel );
1919
1920if ( $subsectionHtml ) {
1921if ( $this->mSubSectionBeforeFields ) {
1922return $subsectionHtml ."\n" . $html;
1923 }else {
1924return $html ."\n" . $subsectionHtml;
1925 }
1926 }else {
1927return $html;
1928 }
1929 }
1930
1939protectedfunctionformatField(HTMLFormField $field, $value ) {
1940 $displayFormat = $this->getDisplayFormat();
1941switch ( $displayFormat ) {
1942case'table':
1943return $field->getTableRow( $value );
1944case'div':
1945return $field->getDiv( $value );
1946case'raw':
1947return $field->getRaw( $value );
1948case'inline':
1949return $field->getInline( $value );
1950default:
1951thrownew LogicException('Not implemented' );
1952 }
1953 }
1954
1963protectedfunctionformatSection( array $fieldsHtml, $sectionName, $anyFieldHasLabel ) {
1964if ( !$fieldsHtml ) {
1965// Do not generate any wrappers for empty sections. Sections may be empty if they only have
1966// subsections, but no fields. A legend will still be added in wrapFieldSetSection().
1967return'';
1968 }
1969
1970 $displayFormat = $this->getDisplayFormat();
1971 $html = implode('', $fieldsHtml );
1972
1973if ( $displayFormat ==='raw' ) {
1974return $html;
1975 }
1976
1977// Avoid strange spacing when no labels exist
1978 $attribs = $anyFieldHasLabel ? [] : ['class' =>'mw-htmlform-nolabel' ];
1979
1980if ( $sectionName ) {
1981 $attribs['id'] = Sanitizer::escapeIdForAttribute( $sectionName );
1982 }
1983
1984if ( $displayFormat ==='table' ) {
1985return Html::rawElement('table',
1986 $attribs,
1987 Html::rawElement('tbody', [],"\n$html\n" ) ) ."\n";
1988 } elseif ( $displayFormat ==='inline' ) {
1989return Html::rawElement('span', $attribs,"\n$html\n" );
1990 }else {
1991return Html::rawElement('div', $attribs,"\n$html\n" );
1992 }
1993 }
1994
1998publicfunctionloadData() {
1999 $this->prepareForm();
2000 }
2001
2005protectedfunctionloadFieldData() {
2006 $fieldData = [];
2007 $request = $this->getRequest();
2008
2009foreach ( $this->mFlatFields as $fieldname => $field ) {
2010if ( $field->skipLoadData( $request ) ) {
2011continue;
2012 }
2013if ( $field->mParams['disabled'] ??false ) {
2014 $fieldData[$fieldname] = $field->getDefault();
2015 }else {
2016 $fieldData[$fieldname] = $field->loadDataFromRequest( $request );
2017 }
2018 }
2019
2020// Reset to default for fields that are supposed to be disabled.
2021// FIXME: Handle dependency chains, fields that a field checks on may need a reset too.
2022foreach ( $fieldData as $name => &$value ) {
2023 $field = $this->mFlatFields[$name];
2024if ( $field->isDisabled( $fieldData ) ) {
2025 $value = $field->getDefault();
2026 }
2027 }
2028
2029 # Filter data.
2030foreach ( $fieldData as $name => &$value ) {
2031 $field = $this->mFlatFields[$name];
2032 $value = $field->filter( $value, $fieldData );
2033 }
2034
2035 $this->mFieldData = $fieldData;
2036 }
2037
2048publicfunctionfilterDataForSubmit( $data ) {
2049return $data;
2050 }
2051
2061publicfunctiongetLegend( $key ) {
2062return $this->msg( $this->mMessagePrefix ?"{$this->mMessagePrefix}-$key" : $key )->text();
2063 }
2064
2075publicfunctionsetAction( $action ) {
2076 $this->mAction = $action;
2077
2078return $this;
2079 }
2080
2088publicfunctiongetAction() {
2089// If an action is already provided, return it
2090if ( $this->mAction !==false ) {
2091return $this->mAction;
2092 }
2093
2094 $articlePath = $this->getConfig()->get(MainConfigNames::ArticlePath );
2095// Check whether we are in GET mode and the ArticlePath contains a "?"
2096// meaning that getLocalURL() would return something like "index.php?title=...".
2097// As browser remove the query string before submitting GET forms,
2098// it means that the title would be lost. In such case use script path instead
2099// and put title in a hidden field (see getHiddenFields()).
2100if ( str_contains( $articlePath,'?' ) && $this->getMethod() ==='get' ) {
2101return $this->getConfig()->get(MainConfigNames::Script );
2102 }
2103
2104return $this->getTitle()->getLocalURL();
2105 }
2106
2117publicfunctionsetAutocomplete( $autocomplete ) {
2118 $this->mAutocomplete = $autocomplete;
2119
2120return $this;
2121 }
2122
2129protectedfunctiongetMessage( $value ) {
2130returnMessage::newFromSpecifier( $value )->setContext( $this );
2131 }
2132
2143foreach ( $this->mFlatFields as $field ) {
2144if ( $field->needsJSForHtml5FormValidation() ) {
2145returntrue;
2146 }
2147 }
2148returnfalse;
2149 }
2150}
2151
2153class_alias( HTMLForm::class,'HTMLForm' );
wfDeprecatedMsg
wfDeprecatedMsg( $msg, $version=false, $component=false, $callerOffset=2)
Log a deprecation warning with arbitrary message text.
DefinitionGlobalFunctions.php:766
if
if(!defined('MW_SETUP_CALLBACK'))
DefinitionWebStart.php:68
MediaWiki\Context\ContextSource
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
DefinitionContextSource.php:34
MediaWiki\Context\ContextSource\getUser
getUser()
DefinitionContextSource.php:148
MediaWiki\Context\ContextSource\getRequest
getRequest()
DefinitionContextSource.php:82
MediaWiki\Context\ContextSource\getCsrfTokenSet
getCsrfTokenSet()
Get a repository to obtain and match CSRF tokens.
DefinitionContextSource.php:232
MediaWiki\Context\ContextSource\getConfig
getConfig()
DefinitionContextSource.php:73
MediaWiki\Context\ContextSource\setContext
setContext(IContextSource $context)
DefinitionContextSource.php:64
MediaWiki\Context\ContextSource\getOutput
getOutput()
DefinitionContextSource.php:138
MediaWiki\HTMLForm\CodexHTMLForm
Codex based HTML form.
DefinitionCodexHTMLForm.php:22
MediaWiki\HTMLForm\Field\HTMLApiField
DefinitionHTMLApiField.php:10
MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField
Text field for selecting a value from a large list of possible values, with auto-completion and optio...
DefinitionHTMLAutoCompleteSelectField.php:38
MediaWiki\HTMLForm\Field\HTMLCheckField
A checkbox field.
DefinitionHTMLCheckField.php:17
MediaWiki\HTMLForm\Field\HTMLCheckMatrix
A checkbox matrix Operates similarly to HTMLMultiSelectField, but instead of using an array of option...
DefinitionHTMLCheckMatrix.php:39
MediaWiki\HTMLForm\Field\HTMLComboboxField
A combo box field.
DefinitionHTMLComboboxField.php:24
MediaWiki\HTMLForm\Field\HTMLDateTimeField
A field that will contain a date and/or time.
DefinitionHTMLDateTimeField.php:28
MediaWiki\HTMLForm\Field\HTMLEditTools
DefinitionHTMLEditTools.php:11
MediaWiki\HTMLForm\Field\HTMLExpiryField
Expiry Field that allows the user to specify a precise date or a relative date string.
DefinitionHTMLExpiryField.php:15
MediaWiki\HTMLForm\Field\HTMLFileField
File <input> field.
DefinitionHTMLFileField.php:21
MediaWiki\HTMLForm\Field\HTMLFloatField
A field that will contain a numeric value.
DefinitionHTMLFloatField.php:10
MediaWiki\HTMLForm\Field\HTMLFormFieldCloner
A container for HTMLFormFields that allows for multiple copies of the set of fields to be displayed t...
DefinitionHTMLFormFieldCloner.php:48
MediaWiki\HTMLForm\Field\HTMLHiddenField
DefinitionHTMLHiddenField.php:10
MediaWiki\HTMLForm\Field\HTMLInfoField
An information field (text blob), not a proper input.
DefinitionHTMLInfoField.php:12
MediaWiki\HTMLForm\Field\HTMLIntField
A field that must contain a number.
DefinitionHTMLIntField.php:10
MediaWiki\HTMLForm\Field\HTMLMultiSelectField
Multi-select field.
DefinitionHTMLMultiSelectField.php:18
MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField
Implements a tag multiselect input field for namespaces.
DefinitionHTMLNamespacesMultiselectField.php:20
MediaWiki\HTMLForm\Field\HTMLOrderedMultiselectField
Implements a tag multiselect input field with a searchable dropdown containing valid tags.
DefinitionHTMLOrderedMultiselectField.php:19
MediaWiki\HTMLForm\Field\HTMLRadioField
Radio checkbox fields.
DefinitionHTMLRadioField.php:15
MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField
Double field with a dropdown list constructed from a system message in the format.
DefinitionHTMLSelectAndOtherField.php:22
MediaWiki\HTMLForm\Field\HTMLSelectField
A select dropdown field.
DefinitionHTMLSelectField.php:13
MediaWiki\HTMLForm\Field\HTMLSelectLanguageField
Language select field.
DefinitionHTMLSelectLanguageField.php:14
MediaWiki\HTMLForm\Field\HTMLSelectLimitField
A limit dropdown, which accepts any valid number.
DefinitionHTMLSelectLimitField.php:10
MediaWiki\HTMLForm\Field\HTMLSelectNamespaceWithButton
Creates a Html::namespaceSelector input field with a button assigned to the input field.
DefinitionHTMLSelectNamespaceWithButton.php:12
MediaWiki\HTMLForm\Field\HTMLSelectNamespace
Wrapper for Html::namespaceSelector to use in HTMLForm.
DefinitionHTMLSelectNamespace.php:13
MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField
Select dropdown field, with an additional "other" textbox.
DefinitionHTMLSelectOrOtherField.php:18
MediaWiki\HTMLForm\Field\HTMLSizeFilterField
A size filter field for use on query-type special pages.
DefinitionHTMLSizeFilterField.php:19
MediaWiki\HTMLForm\Field\HTMLSubmitField
Add a submit button inline in the form (as opposed to HTMLForm::addButton(), which will add it at the...
DefinitionHTMLSubmitField.php:11
MediaWiki\HTMLForm\Field\HTMLTagFilter
Wrapper for ChangeTags::buildTagFilterSelector to use in HTMLForm.
DefinitionHTMLTagFilter.php:13
MediaWiki\HTMLForm\Field\HTMLTagMultiselectField
Implements a tag multiselect input field for arbitrary values.
DefinitionHTMLTagMultiselectField.php:20
MediaWiki\HTMLForm\Field\HTMLTextAreaField
DefinitionHTMLTextAreaField.php:13
MediaWiki\HTMLForm\Field\HTMLTextFieldWithButton
Creates a text input field with a button assigned to the input field.
DefinitionHTMLTextFieldWithButton.php:12
MediaWiki\HTMLForm\Field\HTMLTextField
<input> field.
DefinitionHTMLTextField.php:19
MediaWiki\HTMLForm\Field\HTMLTimezoneField
Dropdown widget that allows the user to select a timezone, either by choosing a geographic zone,...
DefinitionHTMLTimezoneField.php:21
MediaWiki\HTMLForm\Field\HTMLTitleTextField
Implements a text input field for page titles.
DefinitionHTMLTitleTextField.php:28
MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField
Implements a tag multiselect input field for titles.
DefinitionHTMLTitlesMultiselectField.php:25
MediaWiki\HTMLForm\Field\HTMLUserTextField
Implements a text input field for user names.
DefinitionHTMLUserTextField.php:29
MediaWiki\HTMLForm\Field\HTMLUsersMultiselectField
Implements a tag multiselect input field for user names.
DefinitionHTMLUsersMultiselectField.php:23
MediaWiki\HTMLForm\HTMLFormField
The parent class to generate form fields.
DefinitionHTMLFormField.php:27
MediaWiki\HTMLForm\HTMLFormField\getDiv
getDiv( $value)
Get the complete div for the input, including help text, labels, and whatever.
DefinitionHTMLFormField.php:706
MediaWiki\HTMLForm\HTMLFormField\getTableRow
getTableRow( $value)
Get the complete table row for the input, including help text, labels, and whatever.
DefinitionHTMLFormField.php:645
MediaWiki\HTMLForm\HTMLFormField\getRaw
getRaw( $value)
Get the complete raw fields for the input, including help text, labels, and whatever.
DefinitionHTMLFormField.php:982
MediaWiki\HTMLForm\HTMLFormField\getInline
getInline( $value)
Get the complete field as an inline element.
DefinitionHTMLFormField.php:1014
MediaWiki\HTMLForm\HTMLForm
Object handling generic submission, CSRF protection, layout and other logic for UI forms in a reusabl...
DefinitionHTMLForm.php:195
MediaWiki\HTMLForm\HTMLForm\getTitle
getTitle()
DefinitionHTMLForm.php:1790
MediaWiki\HTMLForm\HTMLForm\wrapForm
wrapForm( $html)
Wrap the form innards in an actual "<form>" element.
DefinitionHTMLForm.php:1307
MediaWiki\HTMLForm\HTMLForm\displayForm
displayForm( $submitResult)
Display the form (sending to the context's OutputPage object), with an appropriate error message or s...
DefinitionHTMLForm.php:1194
MediaWiki\HTMLForm\HTMLForm\setHeaderHtml
setHeaderHtml( $html, $section=null)
Set header HTML, inside the form.
DefinitionHTMLForm.php:936
MediaWiki\HTMLForm\HTMLForm\setName
setName( $name)
DefinitionHTMLForm.php:1704
MediaWiki\HTMLForm\HTMLForm\needsJSForHtml5FormValidation
needsJSForHtml5FormValidation()
Whether this form, with its current fields, requires the user agent to have JavaScript enabled for th...
DefinitionHTMLForm.php:2142
MediaWiki\HTMLForm\HTMLForm\setSubmitName
setSubmitName( $name)
DefinitionHTMLForm.php:1562
MediaWiki\HTMLForm\HTMLForm\setWrapperLegendMsg
setWrapperLegendMsg( $msg)
Prompt the whole form to be wrapped in a "<fieldset>", with this message as its "<legend>" element.
DefinitionHTMLForm.php:1749
MediaWiki\HTMLForm\HTMLForm\showCancel
showCancel( $show=true)
Show a cancel button (or prevent it).
DefinitionHTMLForm.php:1640
MediaWiki\HTMLForm\HTMLForm\setMessagePrefix
setMessagePrefix( $p)
Set the prefix for various default messages.
DefinitionHTMLForm.php:1767
MediaWiki\HTMLForm\HTMLForm\$mUseMultipart
bool $mUseMultipart
DefinitionHTMLForm.php:344
MediaWiki\HTMLForm\HTMLForm\$mFormIdentifier
string null $mFormIdentifier
DefinitionHTMLForm.php:304
MediaWiki\HTMLForm\HTMLForm\$mSections
array[] $mSections
Additional information about form sections.
DefinitionHTMLForm.php:379
MediaWiki\HTMLForm\HTMLForm\wrapFieldSetSection
wrapFieldSetSection( $legend, $section, $attributes, $isRoot)
Wraps the given $section into a user-visible fieldset.
DefinitionHTMLForm.php:1824
MediaWiki\HTMLForm\HTMLForm\$mWrapperLegend
string false $mWrapperLegend
DefinitionHTMLForm.php:357
MediaWiki\HTMLForm\HTMLForm\getField
getField( $fieldname)
DefinitionHTMLForm.php:526
MediaWiki\HTMLForm\HTMLForm\$mFieldTree
array $mFieldTree
DefinitionHTMLForm.php:257
MediaWiki\HTMLForm\HTMLForm\$mSubmitCallback
callable null $mSubmitCallback
DefinitionHTMLForm.php:268
MediaWiki\HTMLForm\HTMLForm\getHeaderHtml
getHeaderHtml( $section=null)
Get header HTML.
DefinitionHTMLForm.php:954
MediaWiki\HTMLForm\HTMLForm\$mCollapsed
bool $mCollapsed
Whether the form is collapsed by default.
DefinitionHTMLForm.php:334
MediaWiki\HTMLForm\HTMLForm\$mSectionFooters
string[] $mSectionFooters
DefinitionHTMLForm.php:284
MediaWiki\HTMLForm\HTMLForm\setFormIdentifier
setFormIdentifier(string $ident, bool $single=false)
Set an internal identifier for this form.
DefinitionHTMLForm.php:1611
MediaWiki\HTMLForm\HTMLForm\trySubmit
trySubmit()
Validate all the fields, and call the submission callback function if everything is kosher.
DefinitionHTMLForm.php:745
MediaWiki\HTMLForm\HTMLForm\$mSectionHeaders
string[] $mSectionHeaders
DefinitionHTMLForm.php:282
MediaWiki\HTMLForm\HTMLForm\$mWrapperAttributes
array $mWrapperAttributes
DefinitionHTMLForm.php:359
MediaWiki\HTMLForm\HTMLForm\$availableSubclassDisplayFormats
array $availableSubclassDisplayFormats
Available formats in which to display the form.
DefinitionHTMLForm.php:413
MediaWiki\HTMLForm\HTMLForm\$mShowCancel
bool $mShowCancel
DefinitionHTMLForm.php:263
MediaWiki\HTMLForm\HTMLForm\$mSubmitID
string null $mSubmitID
DefinitionHTMLForm.php:295
MediaWiki\HTMLForm\HTMLForm\setAction
setAction( $action)
Set the value for the action attribute of the form.
DefinitionHTMLForm.php:2075
MediaWiki\HTMLForm\HTMLForm\setPreHtml
setPreHtml( $html)
Set the introductory message HTML, overwriting any existing message.
DefinitionHTMLForm.php:877
MediaWiki\HTMLForm\HTMLForm\$mId
string null $mId
DefinitionHTMLForm.php:288
MediaWiki\HTMLForm\HTMLForm\setTokenSalt
setTokenSalt( $salt)
Set the salt for the edit token.
DefinitionHTMLForm.php:1174
MediaWiki\HTMLForm\HTMLForm\$mPre
string $mPre
DefinitionHTMLForm.php:276
MediaWiki\HTMLForm\HTMLForm\setFooterHtml
setFooterHtml( $html, $section=null)
Set footer HTML, inside the form.
DefinitionHTMLForm.php:987
MediaWiki\HTMLForm\HTMLForm\suppressDefaultSubmit
suppressDefaultSubmit( $suppressSubmit=true)
Stop a default submit button being shown for this form.
DefinitionHTMLForm.php:1628
MediaWiki\HTMLForm\HTMLForm\getCancelTargetURL
getCancelTargetURL()
DefinitionHTMLForm.php:1664
MediaWiki\HTMLForm\HTMLForm\$mWasSubmitted
bool $mWasSubmitted
DefinitionHTMLForm.php:313
MediaWiki\HTMLForm\HTMLForm\$mMessagePrefix
string $mMessagePrefix
DefinitionHTMLForm.php:252
MediaWiki\HTMLForm\HTMLForm\loadFieldData
loadFieldData()
Load data of form fields from the request.
DefinitionHTMLForm.php:2005
MediaWiki\HTMLForm\HTMLForm\tryAuthorizedSubmit
tryAuthorizedSubmit()
Try submitting, with edit token check first.
DefinitionHTMLForm.php:665
MediaWiki\HTMLForm\HTMLForm\wasSubmitted
wasSubmitted()
Test whether the form was considered to have been submitted or not, i.e.
DefinitionHTMLForm.php:834
MediaWiki\HTMLForm\HTMLForm\$mFooter
string $mFooter
DefinitionHTMLForm.php:280
MediaWiki\HTMLForm\HTMLForm\getFormAttributes
getFormAttributes()
Get HTML attributes for the <form> tag.
DefinitionHTMLForm.php:1273
MediaWiki\HTMLForm\HTMLForm\getClassFromDescriptor
static getClassFromDescriptor( $fieldname, &$descriptor)
Get the HTMLFormField subclass for this descriptor.
DefinitionHTMLForm.php:592
MediaWiki\HTMLForm\HTMLForm\getMessage
getMessage( $value)
Turns a *-message parameter (which could be a MessageSpecifier, or a message name,...
DefinitionHTMLForm.php:2129
MediaWiki\HTMLForm\HTMLForm\prepareForm
prepareForm()
Prepare form for submission.
DefinitionHTMLForm.php:646
MediaWiki\HTMLForm\HTMLForm\$mCancelTarget
LinkTarget string null $mCancelTarget
DefinitionHTMLForm.php:265
MediaWiki\HTMLForm\HTMLForm\$mCollapsible
bool $mCollapsible
Whether the form can be collapsed.
DefinitionHTMLForm.php:327
MediaWiki\HTMLForm\HTMLForm\addHiddenField
addHiddenField( $name, $value, array $attribs=[])
Add a hidden field to the output Array values are discarded for security reasons (per WebRequest::get...
DefinitionHTMLForm.php:1077
MediaWiki\HTMLForm\HTMLForm\setSubmitTextMsg
setSubmitTextMsg( $msg)
Set the text for the submit button to a message.
DefinitionHTMLForm.php:1540
MediaWiki\HTMLForm\HTMLForm\$mMethod
string $mMethod
DefinitionHTMLForm.php:311
MediaWiki\HTMLForm\HTMLForm\setAutocomplete
setAutocomplete( $autocomplete)
Set the value for the autocomplete attribute of the form.
DefinitionHTMLForm.php:2117
MediaWiki\HTMLForm\HTMLForm\getBody
getBody()
Get the whole body of the form.
DefinitionHTMLForm.php:1439
MediaWiki\HTMLForm\HTMLForm\$mSubSectionBeforeFields
bool $mSubSectionBeforeFields
If true, sections that contain both fields and subsections will render their subsections before their...
DefinitionHTMLForm.php:389
MediaWiki\HTMLForm\HTMLForm\$displayFormat
string $displayFormat
Format in which to display form.
DefinitionHTMLForm.php:396
MediaWiki\HTMLForm\HTMLForm\setSubmitTooltip
setSubmitTooltip( $name)
DefinitionHTMLForm.php:1573
MediaWiki\HTMLForm\HTMLForm\$mSubmitFlags
string[] $mSubmitFlags
DefinitionHTMLForm.php:261
MediaWiki\HTMLForm\HTMLForm\setWrapperAttributes
setWrapperAttributes( $attributes)
For internal use only.
DefinitionHTMLForm.php:1734
MediaWiki\HTMLForm\HTMLForm\$mHeader
string $mHeader
DefinitionHTMLForm.php:278
MediaWiki\HTMLForm\HTMLForm\$mAutocomplete
string null $mAutocomplete
Form attribute autocomplete.
DefinitionHTMLForm.php:341
MediaWiki\HTMLForm\HTMLForm\getDisplayFormat
getDisplayFormat()
Getter for displayFormat.
DefinitionHTMLForm.php:572
MediaWiki\HTMLForm\HTMLForm\formatSection
formatSection(array $fieldsHtml, $sectionName, $anyFieldHasLabel)
Put a form section together from the individual fields' HTML, merging it and wrapping.
DefinitionHTMLForm.php:1963
MediaWiki\HTMLForm\HTMLForm\setDisplayFormat
setDisplayFormat( $format)
Set format in which to display the form.
DefinitionHTMLForm.php:542
MediaWiki\HTMLForm\HTMLForm\$mTokenSalt
string array $mTokenSalt
Salt for the edit token.
DefinitionHTMLForm.php:365
MediaWiki\HTMLForm\HTMLForm\getHTML
getHTML( $submitResult)
Returns the raw HTML generated by the form.
DefinitionHTMLForm.php:1226
MediaWiki\HTMLForm\HTMLForm\addButton
addButton( $data)
Add a button to the form.
DefinitionHTMLForm.php:1133
MediaWiki\HTMLForm\HTMLForm\$mTitle
Title null $mTitle
DefinitionHTMLForm.php:309
MediaWiki\HTMLForm\HTMLForm\getHiddenFields
getHiddenFields()
Get the hidden fields that should go inside the form.
DefinitionHTMLForm.php:1329
MediaWiki\HTMLForm\HTMLForm\$mFieldData
array $mFieldData
DefinitionHTMLForm.php:249
MediaWiki\HTMLForm\HTMLForm\setTableId
setTableId( $id)
Set the id of the <table> or outermost <div> element.
DefinitionHTMLForm.php:1683
MediaWiki\HTMLForm\HTMLForm\setWrapperLegend
setWrapperLegend( $legend)
Prompt the whole form to be wrapped in a "<fieldset>", with this text as its "<legend>" element.
DefinitionHTMLForm.php:1721
MediaWiki\HTMLForm\HTMLForm\$mShowSubmit
bool $mShowSubmit
DefinitionHTMLForm.php:259
MediaWiki\HTMLForm\HTMLForm\addFooterHtml
addFooterHtml( $html, $section=null)
Add footer HTML, inside the form.
DefinitionHTMLForm.php:967
MediaWiki\HTMLForm\HTMLForm\$mButtons
array[] $mButtons
DefinitionHTMLForm.php:354
MediaWiki\HTMLForm\HTMLForm\showAlways
showAlways()
Same as self::show with the difference, that the form will be added to the output,...
DefinitionHTMLForm.php:724
MediaWiki\HTMLForm\HTMLForm\displaySection
displaySection( $fields, $sectionName='', $fieldsetIDPrefix='', &$hasUserVisibleFields=false)
DefinitionHTMLForm.php:1850
MediaWiki\HTMLForm\HTMLForm\addFields
addFields( $descriptor)
Add fields to the form.
DefinitionHTMLForm.php:484
MediaWiki\HTMLForm\HTMLForm\setSubmitText
setSubmitText( $t)
Set the text for the submit button.
DefinitionHTMLForm.php:1514
MediaWiki\HTMLForm\HTMLForm\$mPost
string $mPost
DefinitionHTMLForm.php:286
MediaWiki\HTMLForm\HTMLForm\setPostHtml
setPostHtml( $html)
Set HTML at the end of the display.
DefinitionHTMLForm.php:1030
MediaWiki\HTMLForm\HTMLForm\getFooterHtml
getFooterHtml( $section=null)
Get footer HTML.
DefinitionHTMLForm.php:1004
MediaWiki\HTMLForm\HTMLForm\setTitle
setTitle( $t)
Set the title for form submission.
DefinitionHTMLForm.php:1780
MediaWiki\HTMLForm\HTMLForm\setSubmitCallback
setSubmitCallback( $cb)
Set a callback to a function to do something with the form once it's been successfully validated.
DefinitionHTMLForm.php:848
MediaWiki\HTMLForm\HTMLForm\getSubmitText
getSubmitText()
Get the text for the submit button, either customised or a default.
DefinitionHTMLForm.php:1553
MediaWiki\HTMLForm\HTMLForm\addHiddenFields
addHiddenFields(array $fields)
Add an array of hidden fields to the output Array values are discarded for security reasons (per WebR...
DefinitionHTMLForm.php:1098
MediaWiki\HTMLForm\HTMLForm\setId
setId( $id)
DefinitionHTMLForm.php:1694
MediaWiki\HTMLForm\HTMLForm\hasField
hasField( $fieldname)
DefinitionHTMLForm.php:517
MediaWiki\HTMLForm\HTMLForm\show
show()
The here's-one-I-made-earlier option: do the submission if posted, or display the form with or withou...
DefinitionHTMLForm.php:706
MediaWiki\HTMLForm\HTMLForm\formatField
formatField(HTMLFormField $field, $value)
Generate the HTML for an individual field in the current display format.
DefinitionHTMLForm.php:1939
MediaWiki\HTMLForm\HTMLForm\$mHiddenFields
array[] $mHiddenFields
DefinitionHTMLForm.php:349
MediaWiki\HTMLForm\HTMLForm\$mName
string null $mName
DefinitionHTMLForm.php:290
MediaWiki\HTMLForm\HTMLForm\setSections
setSections( $sections)
Set an array of information about sections.
DefinitionHTMLForm.php:1055
MediaWiki\HTMLForm\HTMLForm\formatErrors
formatErrors( $errors)
Format a stack of error messages into a single HTML string.
DefinitionHTMLForm.php:1493
MediaWiki\HTMLForm\HTMLForm\setValidationErrorMessage
setValidationErrorMessage( $msg)
Set a message to display on a validation error.
DefinitionHTMLForm.php:863
MediaWiki\HTMLForm\HTMLForm\$mFlatFields
HTMLFormField[] $mFlatFields
DefinitionHTMLForm.php:255
MediaWiki\HTMLForm\HTMLForm\setSubmitDestructive
setSubmitDestructive()
Identify that the submit button in the form has a destructive action.
DefinitionHTMLForm.php:1526
MediaWiki\HTMLForm\HTMLForm\$mSubmitText
string null $mSubmitText
DefinitionHTMLForm.php:299
MediaWiki\HTMLForm\HTMLForm\getMethod
getMethod()
DefinitionHTMLForm.php:1810
MediaWiki\HTMLForm\HTMLForm\$mSubmitTooltip
string null $mSubmitTooltip
DefinitionHTMLForm.php:301
MediaWiki\HTMLForm\HTMLForm\loadInputFromParameters
static loadInputFromParameters( $fieldname, $descriptor, ?HTMLForm $parent=null)
Initialise a new Object for the field.
DefinitionHTMLForm.php:622
MediaWiki\HTMLForm\HTMLForm\$mSingleForm
bool $mSingleForm
DefinitionHTMLForm.php:306
MediaWiki\HTMLForm\HTMLForm\getErrorsOrWarnings
getErrorsOrWarnings( $elements, $elementsType)
Returns a formatted list of errors or warnings from the given elements.
DefinitionHTMLForm.php:1452
MediaWiki\HTMLForm\HTMLForm\$mTableId
string $mTableId
DefinitionHTMLForm.php:292
MediaWiki\HTMLForm\HTMLForm\addPreHtml
addPreHtml( $html)
Add HTML to introductory message.
DefinitionHTMLForm.php:891
MediaWiki\HTMLForm\HTMLForm\setSubmitID
setSubmitID( $t)
Set the id for the submit button.
DefinitionHTMLForm.php:1587
MediaWiki\HTMLForm\HTMLForm\$availableDisplayFormats
array $availableDisplayFormats
Available formats in which to display the form.
DefinitionHTMLForm.php:402
MediaWiki\HTMLForm\HTMLForm\getPostHtml
getPostHtml()
Get HTML at the end of the display.
DefinitionHTMLForm.php:1042
MediaWiki\HTMLForm\HTMLForm\$mValidationErrorMessage
array[] $mValidationErrorMessage
DefinitionHTMLForm.php:273
MediaWiki\HTMLForm\HTMLForm\getLegend
getLegend( $key)
Get a string to go in the "<legend>" of a section fieldset.
DefinitionHTMLForm.php:2061
MediaWiki\HTMLForm\HTMLForm\setCancelTarget
setCancelTarget( $target)
Sets the target where the user is redirected to after clicking cancel.
DefinitionHTMLForm.php:1651
MediaWiki\HTMLForm\HTMLForm\addHeaderHtml
addHeaderHtml( $html, $section=null)
Add HTML to the header, inside the form.
DefinitionHTMLForm.php:916
MediaWiki\HTMLForm\HTMLForm\factory
static factory( $displayFormat, $descriptor, IContextSource $context, $messagePrefix='')
Construct a HTMLForm object for given display type.
DefinitionHTMLForm.php:438
MediaWiki\HTMLForm\HTMLForm\setCollapsibleOptions
setCollapsibleOptions( $collapsedByDefault=false)
Enable collapsible mode, and set whether the form is collapsed by default.
DefinitionHTMLForm.php:1262
MediaWiki\HTMLForm\HTMLForm\getAction
getAction()
Get the value for the action attribute of the form.
DefinitionHTMLForm.php:2088
MediaWiki\HTMLForm\HTMLForm\setMethod
setMethod( $method='post')
Set the method used to submit the form.
DefinitionHTMLForm.php:1801
MediaWiki\HTMLForm\HTMLForm\getPreHtml
getPreHtml()
Get the introductory message HTML.
DefinitionHTMLForm.php:903
MediaWiki\HTMLForm\HTMLForm\getButtons
getButtons()
Get the submit and (potentially) reset buttons.
DefinitionHTMLForm.php:1362
MediaWiki\HTMLForm\HTMLForm\loadData
loadData()
DefinitionHTMLForm.php:1998
MediaWiki\HTMLForm\HTMLForm\$typeMappings
static string[] $typeMappings
A mapping of 'type' inputs onto standard HTMLFormField subclasses.
DefinitionHTMLForm.php:199
MediaWiki\HTMLForm\HTMLForm\filterDataForSubmit
filterDataForSubmit( $data)
Overload this if you want to apply special filtration routines to the form as a whole,...
DefinitionHTMLForm.php:2048
MediaWiki\HTMLForm\HTMLForm\$mSubmitName
string null $mSubmitName
DefinitionHTMLForm.php:297
MediaWiki\HTMLForm\HTMLForm\__construct
__construct( $descriptor, IContextSource $context, $messagePrefix='')
Build a new HTMLForm from an array of field attributes.
DefinitionHTMLForm.php:467
MediaWiki\HTMLForm\HTMLForm\$mAction
string false $mAction
Form action URL.
DefinitionHTMLForm.php:320
MediaWiki\HTMLForm\HTMLForm\addPostHtml
addPostHtml( $html)
Add HTML to the end of the display.
DefinitionHTMLForm.php:1016
MediaWiki\HTMLForm\OOUIHTMLForm
Compact stacked vertical format for forms, implemented using OOUI widgets.
DefinitionOOUIHTMLForm.php:23
MediaWiki\HTMLForm\VFormHTMLForm
Compact stacked vertical format for forms.
DefinitionVFormHTMLForm.php:21
MediaWiki\Html\Html
This class is a collection of static functions that serve two purposes:
DefinitionHtml.php:43
MediaWiki\Linker\Linker
Some internal bits split of from Skin.php.
DefinitionLinker.php:47
MediaWiki\MainConfigNames
A class containing constants representing the names of configuration variables.
DefinitionMainConfigNames.php:22
MediaWiki\MainConfigNames\ArticlePath
const ArticlePath
Name constant for the ArticlePath setting, for use with Config::get()
DefinitionMainConfigNames.php:136
MediaWiki\MainConfigNames\Script
const Script
Name constant for the Script setting, for use with Config::get()
DefinitionMainConfigNames.php:88
MediaWiki\Message\Message
The Message class deals with fetching and processing of interface message into a variety of formats.
DefinitionMessage.php:144
MediaWiki\Message\Message\newFromSpecifier
static newFromSpecifier( $value)
Transform a MessageSpecifier or a primitive value used interchangeably with specifiers (a message key...
DefinitionMessage.php:492
MediaWiki\Parser\Sanitizer
HTML sanitizer for MediaWiki.
DefinitionSanitizer.php:32
MediaWiki\Session\CsrfTokenSet
Stores and matches CSRF tokens belonging to a given session user.
DefinitionCsrfTokenSet.php:18
MediaWiki\Status\Status
Generic operation result class Has warning/error list, boolean status and arbitrary value.
DefinitionStatus.php:44
MediaWiki\Title\TitleValue
Represents the target of a wiki link.
DefinitionTitleValue.php:33
MediaWiki\Title\Title
Represents a title within MediaWiki.
DefinitionTitle.php:69
StatusValue
Generic operation result class Has warning/error list, boolean status and arbitrary value.
DefinitionStatusValue.php:41
StatusValue\isGood
isGood()
Returns whether the operation completed and didn't have any error or warnings.
DefinitionStatusValue.php:137
Wikimedia\Message\MessageParam
Value object representing a message parameter that consists of a list of values.
DefinitionMessageParam.php:14
MediaWiki\Context\IContextSource
Interface for objects which can provide a MediaWiki context on request.
DefinitionIContextSource.php:57
MediaWiki\Linker\LinkTarget
Represents the target of a wiki link.
DefinitionLinkTarget.php:19
MediaWiki\Page\PageReference
Interface for objects (potentially) representing a page that can be viewable and linked to on a wiki.
DefinitionPageReference.php:38
Wikimedia\Message\MessageSpecifier
DefinitionMessageSpecifier.php:12
MediaWiki\HTMLForm
DefinitionCodexHTMLForm.php:10
MediaWiki\Html\element
element(SerializerNode $parent, SerializerNode $node, $contents)
DefinitionHtmlHelperTrait.php:38

[8]ページ先頭

©2009-2025 Movatter.jp