|
MediaWiki master
|
Sub class of HTMLForm that provides the form section of SpecialUpload. More...
Inherits MediaWiki\HTMLForm\HTMLForm.

Public Member Functions | |
| __construct (array $options=[], ?IContextSource $context=null, ?LinkRenderer $linkRenderer=null, private ?LocalRepo $localRepo=null, ?Language $unused=null, private ?NamespaceInfo $nsInfo=null, ?HookContainer $hookContainer=null) | |
| show () | |
| Add the upload JS and show the form. | |
| trySubmit () | |
| Empty function; submission is handled elsewhere. | |
Public Member Functions inherited from MediaWiki\HTMLForm\HTMLForm | |
| __construct ( $descriptor, IContextSource $context, $messagePrefix='') | |
| Build a new HTMLForm from an array of field attributes. | |
| addButton ( $data) | |
| Add a button to the form. | |
| addFields ( $descriptor) | |
| Add fields to the form. | |
| addFooterHtml ( $html, $section=null) | |
| Add footer HTML, inside the form. | |
| addHeaderHtml ( $html, $section=null) | |
| Add HTML to the header, inside the form. | |
| addHiddenField ( $name, $value, array $attribs=[]) | |
| Add a hidden field to the output Array values are discarded for security reasons (per WebRequest::getVal) | |
| addHiddenFields (array $fields) | |
| Add an array of hidden fields to the output Array values are discarded for security reasons (per WebRequest::getVal) | |
| addPostHtml ( $html) | |
| Add HTML to the end of the display. | |
| addPreHtml ( $html) | |
| Add HTML to introductory message. | |
| displayForm ( $submitResult) | |
| Display the form (sending to the context's OutputPage object), with an appropriate error message or stack of messages, and any validation errors, etc. | |
| displaySection ( $fields, $sectionName='', $fieldsetIDPrefix='', &$hasUserVisibleFields=false) | |
| filterDataForSubmit ( $data) | |
| Overload this if you want to apply special filtration routines to the form as a whole, after it's submitted but before it's processed. | |
| formatErrors ( $errors) | |
| Format a stack of error messages into a single HTML string. | |
| getAction () | |
| Get the value for the action attribute of the form. | |
| getBody () | |
| Get the whole body of the form. | |
| getButtons () | |
| Get the submit and (potentially) reset buttons. | |
| getDisplayFormat () | |
| Getter for displayFormat. | |
| getErrorsOrWarnings ( $elements, $elementsType) | |
| Returns a formatted list of errors or warnings from the given elements. | |
| getField ( $fieldname) | |
| getFooterHtml ( $section=null) | |
| Get footer HTML. | |
| getHeaderHtml ( $section=null) | |
| Get header HTML. | |
| getHiddenFields () | |
| Get the hidden fields that should go inside the form. | |
| getHTML ( $submitResult) | |
| Returns the raw HTML generated by the form. | |
| getLegend ( $key) | |
| Get a string to go in the "<legend>" of a section fieldset. | |
| getMethod () | |
| getPostHtml () | |
| Get HTML at the end of the display. | |
| getPreHtml () | |
| Get the introductory message HTML. | |
| getSubmitText () | |
| Get the text for the submit button, either customised or a default. | |
| getTitle () | |
| hasField ( $fieldname) | |
| loadData () | |
| needsJSForHtml5FormValidation () | |
| Whether this form, with its current fields, requires the user agent to have JavaScript enabled for the client-side HTML5 form validation to work correctly. | |
| prepareForm () | |
| Prepare form for submission. | |
| requestIsAuthorized () | |
| Return true if the http request passes identity and csrf checks. | |
| setAction ( $action) | |
| Set the value for the action attribute of the form. | |
| setAutocomplete ( $autocomplete) | |
| Set the value for the autocomplete attribute of the form. | |
| setCancelTarget ( $target) | |
| Sets the target where the user is redirected to after clicking cancel. | |
| setCollapsibleOptions ( $collapsedByDefault=false) | |
| Enable collapsible mode, and set whether the form is collapsed by default. | |
| setDisplayFormat ( $format) | |
| Set format in which to display the form. | |
| setFooterHtml ( $html, $section=null) | |
| Set footer HTML, inside the form. | |
| setFormIdentifier (string $ident, bool $single=false) | |
| Set an internal identifier for this form. | |
| setHeaderHtml ( $html, $section=null) | |
| Set header HTML, inside the form. | |
| setId ( $id) | |
| setMessagePrefix ( $p) | |
| Set the prefix for various default messages. | |
| setMethod ( $method='post') | |
| Set the method used to submit the form. | |
| setName ( $name) | |
| setPostHtml ( $html) | |
| Set HTML at the end of the display. | |
| setPreHtml ( $html) | |
| Set the introductory message HTML, overwriting any existing message. | |
| setSections ( $sections) | |
| Set an array of information about sections. | |
| setSubmitCallback ( $cb) | |
| Set a callback to a function to do something with the form once it's been successfully validated. | |
| setSubmitDestructive () | |
| Identify that the submit button in the form has a destructive action. | |
| setSubmitID ( $t) | |
| Set the id for the submit button. | |
| setSubmitName ( $name) | |
| setSubmitText ( $t) | |
| Set the text for the submit button. | |
| setSubmitTextMsg ( $msg) | |
| Set the text for the submit button to a message. | |
| setSubmitTooltip ( $name) | |
| setTableId ( $id) | |
| Set the id of the \<table\> or outermost \<div\> element. | |
| setTitle ( $t) | |
| Set the title for form submission. | |
| setTokenSalt ( $salt) | |
| Set the salt for the edit token. | |
| setValidationErrorMessage ( $msg) | |
| Set a message to display on a validation error. | |
| setWrapperAttributes ( $attributes) | |
| For internal use only. | |
| setWrapperLegend ( $legend) | |
| Prompt the whole form to be wrapped in a "<fieldset>", with this text as its "<legend>" element. | |
| setWrapperLegendMsg ( $msg) | |
| Prompt the whole form to be wrapped in a "<fieldset>", with this message as its "<legend>" element. | |
| showAlways () | |
| Same as self::show with the difference, that the form will be added to the output, no matter, if the validation was good or not. | |
| showCancel ( $show=true) | |
| Show a cancel button (or prevent it). | |
| suppressDefaultSubmit ( $suppressSubmit=true) | |
| Stop a default submit button being shown for this form. | |
| tryAuthorizedSubmit () | |
| Try submitting, with edit token check first. | |
| wasSubmitted () | |
| Test whether the form was considered to have been submitted or not, i.e. | |
| wrapForm ( $html) | |
| Wrap the form innards in an actual "<form>" element. | |
Public Member Functions inherited from MediaWiki\Context\ContextSource | |
| canUseWikiPage () | |
| Check whether a WikiPage object can be get with getWikiPage(). | |
| exportSession () | |
| Export the resolved user IP, HTTP headers, user ID, and session ID. | |
| getActionName () | |
| Get the action name for the current web request. | |
| getAuthority () | |
| getConfig () | |
| getContext () | |
| Get the base IContextSource object. | |
| getCsrfTokenSet () | |
| Get a repository to obtain and match CSRF tokens. | |
| getLanguage () | |
| getLanguageCode () | |
| getOutput () | |
| getRequest () | |
| getSkin () | |
| getTiming () | |
| getUser () | |
| getWikiPage () | |
| Get the WikiPage object. | |
| msg ( $key,... $params) | |
| Get a Message object with context set Parameters are the same as wfMessage() | |
| setContext (IContextSource $context) | |
Protected Member Functions | |
| addUploadJS () | |
| Add upload JS to the OutputPage. | |
| getDescriptionSection () | |
| Get the descriptor of the fieldset that contains the file description input. | |
| getExtensionsMessage () | |
| Get the messages indicating which extensions are preferred and prohibited. | |
| getOptionsSection () | |
| Get the descriptor of the fieldset that contains the upload options, such as "watch this file". | |
| getSourceSection () | |
| Get the descriptor of the fieldset that contains the file source selection. | |
Protected Member Functions inherited from MediaWiki\HTMLForm\HTMLForm | |
| formatField (HTMLFormField $field, $value) | |
| Generate the HTML for an individual field in the current display format. | |
| formatSection (array $fieldsHtml, $sectionName, $anyFieldHasLabel) | |
| Put a form section together from the individual fields' HTML, merging it and wrapping. | |
| getCancelTargetURL () | |
| getFormAttributes () | |
Get HTML attributes for the <form> tag. | |
| getMessage ( $value) | |
| Turns a *-message parameter (which could be a MessageSpecifier, or a message name, or a name + parameters array) into a Message. | |
| loadFieldData () | |
| Load data of form fields from the request. | |
| wrapFieldSetSection ( $legend, $section, $attributes, $isRoot) | |
| Wraps the given $section into a user-visible fieldset. | |
Protected Attributes | |
| string | $mComment |
| string | $mDestFile |
| bool | $mDestWarningAck |
| bool | $mForReUpload |
| bool | $mHideIgnoreWarning |
| array | $mMaxUploadSize = [] |
| string | $mSessionKey |
| string[] | $mSourceIds |
| string | $mTextAfterSummary |
| raw html | |
| string | $mTextTop |
| raw html | |
| bool | $mWatch |
Protected Attributes inherited from MediaWiki\HTMLForm\HTMLForm | |
| array | $availableDisplayFormats |
| Available formats in which to display the form. | |
| array | $availableSubclassDisplayFormats |
| Available formats in which to display the form. | |
| string | $displayFormat = 'table' |
| Format in which to display form. | |
| string false | $mAction = false |
| Form action URL. | |
| string null | $mAutocomplete = null |
| Form attribute autocomplete. | |
| array[] | $mButtons = [] |
| LinkTarget string null | $mCancelTarget |
| bool | $mCollapsed = false |
| Whether the form is collapsed by default. | |
| bool | $mCollapsible = false |
| Whether the form can be collapsed. | |
| array | $mFieldTree = [] |
| HTMLFormField[] | $mFlatFields = [] |
| string | $mFooter = '' |
| string null | $mFormIdentifier |
| string | $mHeader = '' |
| array[] | $mHiddenFields = [] |
| string null | $mId |
| string | $mMessagePrefix |
| string | $mMethod = 'post' |
| string null | $mName |
| string | $mPost = '' |
| string | $mPre = '' |
| string[] | $mSectionFooters = [] |
| string[] | $mSectionHeaders = [] |
| array[] | $mSections = [] |
| Additional information about form sections. | |
| bool | $mShowCancel = false |
| bool | $mShowSubmit = true |
| bool | $mSingleForm = false |
| callable null | $mSubmitCallback |
| string[] | $mSubmitFlags = [ 'primary', 'progressive' ] |
| string null | $mSubmitID |
| string null | $mSubmitName |
| string null | $mSubmitText |
| string null | $mSubmitTooltip |
| bool | $mSubSectionBeforeFields = true |
| If true, sections that contain both fields and subsections will render their subsections before their fields. | |
| string | $mTableId = '' |
| Title null | $mTitle |
| string array | $mTokenSalt = '' |
| Salt for the edit token. | |
| bool | $mUseMultipart = false |
| array[] | $mValidationErrorMessage |
| bool | $mWasSubmitted = false |
| array | $mWrapperAttributes = [] |
| string false | $mWrapperLegend = false |
Additional Inherited Members | |
Static Public Member Functions inherited from MediaWiki\HTMLForm\HTMLForm | |
| static | factory ( $displayFormat, $descriptor, IContextSource $context, $messagePrefix='') |
| Construct a HTMLForm object for given display type. | |
| static | getClassFromDescriptor ( $fieldname, &$descriptor) |
| Get the HTMLFormField subclass for this descriptor. | |
| static | loadInputFromParameters ( $fieldname, $descriptor, ?self $parent=null) |
| Initialise a new Object for the field. | |
Public Attributes inherited from MediaWiki\HTMLForm\HTMLForm | |
| array | $mFieldData |
Static Public Attributes inherited from MediaWiki\HTMLForm\HTMLForm | |
| static string[] | $typeMappings |
| A mapping of 'type' inputs onto standard HTMLFormField subclasses. | |
Sub class of HTMLForm that provides the form section of SpecialUpload.
Definition at line 32 of file UploadForm.php.
| MediaWiki\Specials\Forms\UploadForm::__construct | ( | array | $options = [], |
| ?IContextSource | $context = null, | ||
| ?LinkRenderer | $linkRenderer = null, | ||
| private ?LocalRepo | $localRepo = null, | ||
| ?Language | $unused = null, | ||
| private ?NamespaceInfo | $nsInfo = null, | ||
| ?HookContainer | $hookContainer = null ) |
Definition at line 61 of file UploadForm.php.
References MediaWiki\HTMLForm\HTMLForm\addFooterHtml(), MediaWiki\Context\ContextSource\getAuthority(), MediaWiki\Context\ContextSource\getContext(), MediaWiki\Specials\Forms\UploadForm\getDescriptionSection(), MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Specials\Forms\UploadForm\getOptionsSection(), MediaWiki\Context\ContextSource\getOutput(), MediaWiki\Specials\Forms\UploadForm\getSourceSection(), MediaWiki\HTMLForm\HTMLForm\getTitle(), MediaWiki\Context\ContextSource\msg(), MediaWiki\Context\ContextSource\setContext(), MediaWiki\HTMLForm\HTMLForm\setId(), MediaWiki\HTMLForm\HTMLForm\setSubmitName(), MediaWiki\HTMLForm\HTMLForm\setSubmitTextMsg(), and MediaWiki\HTMLForm\HTMLForm\setSubmitTooltip().
|
protected |
Add upload JS to the OutputPage.
Definition at line 440 of file UploadForm.php.
References MediaWiki\Specials\Forms\UploadForm\$mMaxUploadSize, MediaWiki\Specials\Forms\UploadForm\$mSourceIds, MediaWiki\MainConfigNames\AjaxLicensePreview, MediaWiki\MainConfigNames\CheckFileExtensions, MediaWiki\MainConfigNames\FileExtensions, MediaWiki\Context\ContextSource\getConfig(), MediaWiki\Context\ContextSource\getOutput(), MediaWiki\Specials\SpecialUpload\rotationEnabled(), and MediaWiki\MainConfigNames\StrictFileExtensions.
Referenced by MediaWiki\Specials\Forms\UploadForm\show().
|
protected |
Get the descriptor of the fieldset that contains the file description input.
The section is 'description'
Definition at line 282 of file UploadForm.php.
References MediaWiki\Specials\Forms\UploadForm\$mComment, MediaWiki\Specials\Forms\UploadForm\$mDestFile, MediaWiki\Specials\Forms\UploadForm\$mTextAfterSummary, MediaWiki\HTMLForm\HTMLForm\addHeaderHtml(), MediaWiki\Context\ContextSource\getConfig(), MediaWiki\Context\ContextSource\getUser(), and MediaWiki\MainConfigNames\UseCopyrightUpload.
Referenced by MediaWiki\Specials\Forms\UploadForm\__construct().
|
protected |
Get the messages indicating which extensions are preferred and prohibited.
Definition at line 234 of file UploadForm.php.
References MediaWiki\MainConfigNames\CheckFileExtensions, MediaWiki\MainConfigNames\FileExtensions, MediaWiki\Context\ContextSource\getConfig(), MediaWiki\Context\ContextSource\getLanguage(), MediaWiki\Context\ContextSource\msg(), MediaWiki\MainConfigNames\ProhibitedFileExtensions, and MediaWiki\MainConfigNames\StrictFileExtensions.
Referenced by MediaWiki\Specials\Forms\UploadForm\getSourceSection().
|
protected |
Get the descriptor of the fieldset that contains the upload options, such as "watch this file".
The section is 'options'
Definition at line 389 of file UploadForm.php.
References MediaWiki\Specials\Forms\UploadForm\$mWatch, and MediaWiki\Context\ContextSource\getUser().
Referenced by MediaWiki\Specials\Forms\UploadForm\__construct().
|
protected |
Get the descriptor of the fieldset that contains the file source selection.
The section is 'source'
Definition at line 143 of file UploadForm.php.
References MediaWiki\Specials\Forms\UploadForm\$mSessionKey, MediaWiki\Specials\Forms\UploadForm\$mTextTop, MediaWiki\MainConfigNames\CopyUploadsFromSpecialUpload, MediaWiki\Context\ContextSource\getAuthority(), MediaWiki\Context\ContextSource\getConfig(), MediaWiki\Specials\Forms\UploadForm\getExtensionsMessage(), MediaWiki\Context\ContextSource\getRequest(), and MediaWiki\Context\ContextSource\msg().
Referenced by MediaWiki\Specials\Forms\UploadForm\__construct().
| MediaWiki\Specials\Forms\UploadForm::show | ( | ) |
Add the upload JS and show the form.
Reimplemented from MediaWiki\HTMLForm\HTMLForm.
Definition at line 432 of file UploadForm.php.
References MediaWiki\Specials\Forms\UploadForm\addUploadJS().
| MediaWiki\Specials\Forms\UploadForm::trySubmit | ( | ) |
Empty function; submission is handled elsewhere.
Reimplemented from MediaWiki\HTMLForm\HTMLForm.
Definition at line 473 of file UploadForm.php.
|
protected |
Definition at line 47 of file UploadForm.php.
Referenced by MediaWiki\Specials\Forms\UploadForm\getDescriptionSection().
|
protected |
Definition at line 44 of file UploadForm.php.
Referenced by MediaWiki\Specials\Forms\UploadForm\getDescriptionSection().
|
protected |
Definition at line 42 of file UploadForm.php.
|
protected |
Definition at line 36 of file UploadForm.php.
|
protected |
Definition at line 40 of file UploadForm.php.
|
protected |
Definition at line 57 of file UploadForm.php.
Referenced by MediaWiki\Specials\Forms\UploadForm\addUploadJS().
|
protected |
Definition at line 38 of file UploadForm.php.
Referenced by MediaWiki\Specials\Forms\UploadForm\getSourceSection().
|
protected |
Definition at line 54 of file UploadForm.php.
Referenced by MediaWiki\Specials\Forms\UploadForm\addUploadJS().
|
protected |
raw html
Definition at line 51 of file UploadForm.php.
Referenced by MediaWiki\Specials\Forms\UploadForm\getDescriptionSection().
|
protected |
raw html
Definition at line 49 of file UploadForm.php.
Referenced by MediaWiki\Specials\Forms\UploadForm\getSourceSection().
|
protected |
Definition at line 34 of file UploadForm.php.
Referenced by MediaWiki\Specials\Forms\UploadForm\getOptionsSection().