MediaWiki
master
|
Sub class of HTMLForm that provides the form section of SpecialUpload. More...
Public Member Functions | |
__construct (array $options=[], IContextSource $context=null, LinkRenderer $linkRenderer=null, LocalRepo $localRepo=null, Language $contentLanguage=null, NamespaceInfo $nsInfo=null, HookContainer $hookContainer=null) | |
show () | |
Add the upload JS and show the form. More... | |
trySubmit () | |
Empty function; submission is handled elsewhere. More... | |
![]() | |
__construct ( $descriptor, IContextSource $context, $messagePrefix='') | |
Build a new HTMLForm from an array of field attributes. More... | |
addButton ( $data) | |
Add a button to the form. More... | |
addFields ( $descriptor) | |
Add fields to the form. More... | |
addFooterHtml ( $html, $section=null) | |
Add footer HTML, inside the form. More... | |
addFooterText ( $msg, $section=null) | |
Add footer text, inside the form. More... | |
addHeaderHtml ( $html, $section=null) | |
Add HTML to the header, inside the form. More... | |
addHeaderText ( $msg, $section=null) | |
Add HTML to the header, inside the form. More... | |
addHiddenField ( $name, $value, array $attribs=[]) | |
Add a hidden field to the output Array values are discarded for security reasons (per WebRequest::getVal) More... | |
addHiddenFields (array $fields) | |
Add an array of hidden fields to the output Array values are discarded for security reasons (per WebRequest::getVal) More... | |
addPostHtml ( $html) | |
Add HTML to the end of the display. More... | |
addPostText ( $msg) | |
Add text to the end of the display. More... | |
addPreHtml ( $html) | |
Add HTML to introductory message. More... | |
addPreText ( $msg) | |
Add HTML to introductory message. More... | |
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. More... | |
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. More... | |
formatErrors ( $errors) | |
Format a stack of error messages into a single HTML string. More... | |
getAction () | |
Get the value for the action attribute of the form. More... | |
getBody () | |
Get the whole body of the form. More... | |
getButtons () | |
Get the submit and (potentially) reset buttons. More... | |
getDisplayFormat () | |
Getter for displayFormat. More... | |
getErrorsOrWarnings ( $elements, $elementsType) | |
Returns a formatted list of errors or warnings from the given elements. More... | |
getField ( $fieldname) | |
getFooterHtml ( $section=null) | |
Get footer HTML. More... | |
getFooterText ( $section=null) | |
Get footer text. More... | |
getHeaderHtml ( $section=null) | |
Get header HTML. More... | |
getHeaderText ( $section=null) | |
Get header text. More... | |
getHiddenFields () | |
Get the hidden fields that should go inside the form. More... | |
getHTML ( $submitResult) | |
Returns the raw HTML generated by the form. More... | |
getLegend ( $key) | |
Get a string to go in the "<legend>" of a section fieldset. More... | |
getMethod () | |
getPostHtml () | |
Get HTML at the end of the display. More... | |
getPreHtml () | |
Get the introductory message HTML. More... | |
getPreText () | |
Get the introductory message HTML. More... | |
getSubmitText () | |
Get the text for the submit button, either customised or a default. More... | |
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. More... | |
prepareForm () | |
Prepare form for submission. More... | |
setAction ( $action) | |
Set the value for the action attribute of the form. More... | |
setAutocomplete ( $autocomplete) | |
Set the value for the autocomplete attribute of the form. More... | |
setCancelTarget ( $target) | |
Sets the target where the user is redirected to after clicking cancel. More... | |
setCollapsibleOptions ( $collapsedByDefault=false) | |
Enable collapsible mode, and set whether the form is collapsed by default. More... | |
setDisplayFormat ( $format) | |
Set format in which to display the form. More... | |
setFooterHtml ( $html, $section=null) | |
Set footer HTML, inside the form. More... | |
setFooterText ( $msg, $section=null) | |
Set footer text, inside the form. More... | |
setFormIdentifier (string $ident, bool $single=false) | |
Set an internal identifier for this form. More... | |
setHeaderHtml ( $html, $section=null) | |
Set header HTML, inside the form. More... | |
setHeaderText ( $msg, $section=null) | |
Set header text, inside the form. More... | |
setId ( $id) | |
setIntro ( $msg) | |
Set the introductory message, overwriting any existing message. More... | |
setMessagePrefix ( $p) | |
Set the prefix for various default messages. More... | |
setMethod ( $method='post') | |
Set the method used to submit the form. More... | |
setName ( $name) | |
setPostHtml ( $html) | |
Set HTML at the end of the display. More... | |
setPostText ( $msg) | |
Set text at the end of the display. More... | |
setPreHtml ( $html) | |
Set the introductory message HTML, overwriting any existing message. More... | |
setPreText ( $msg) | |
Set the introductory message HTML, overwriting any existing message. More... | |
setSubmitCallback ( $cb) | |
Set a callback to a function to do something with the form once it's been successfully validated. More... | |
setSubmitDestructive () | |
Identify that the submit button in the form has a destructive action. More... | |
setSubmitID ( $t) | |
Set the id for the submit button. More... | |
setSubmitName ( $name) | |
setSubmitText ( $t) | |
Set the text for the submit button. More... | |
setSubmitTextMsg ( $msg) | |
Set the text for the submit button to a message. More... | |
setSubmitTooltip ( $name) | |
setTableId ( $id) | |
Set the id of the \<table\> or outermost \<div\> element. More... | |
setTitle ( $t) | |
Set the title for form submission. More... | |
setTokenSalt ( $salt) | |
Set the salt for the edit token. More... | |
setValidationErrorMessage ( $msg) | |
Set a message to display on a validation error. More... | |
setWrapperAttributes ( $attributes) | |
For internal use only. More... | |
setWrapperLegend ( $legend) | |
Prompt the whole form to be wrapped in a "<fieldset>", with this text as its "<legend>" element. More... | |
setWrapperLegendMsg ( $msg) | |
Prompt the whole form to be wrapped in a "<fieldset>", with this message as its "<legend>" element. More... | |
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. More... | |
showCancel ( $show=true) | |
Show a cancel button (or prevent it). More... | |
suppressDefaultSubmit ( $suppressSubmit=true) | |
Stop a default submit button being shown for this form. More... | |
suppressReset ( $suppressReset=true) | |
Stop a reset button being shown for this form. More... | |
tryAuthorizedSubmit () | |
Try submitting, with edit token check first. More... | |
wasSubmitted () | |
Test whether the form was considered to have been submitted or not, i.e. More... | |
wrapForm ( $html) | |
Wrap the form innards in an actual "<form>" element. More... | |
![]() | |
canUseWikiPage () | |
Check whether a WikiPage object can be get with getWikiPage(). More... | |
exportSession () | |
Export the resolved user IP, HTTP headers, user ID, and session ID. More... | |
getActionName () | |
Get the action name for the current web request. More... | |
getAuthority () | |
getConfig () | |
getContext () | |
Get the base IContextSource object. More... | |
getCsrfTokenSet () | |
Get a repository to obtain and match CSRF tokens. More... | |
getLanguage () | |
getOutput () | |
getRequest () | |
getSkin () | |
getTiming () | |
getUser () | |
getWikiPage () | |
Get the WikiPage object. More... | |
msg ( $key,... $params) | |
Get a Message object with context set Parameters are the same as wfMessage() More... | |
setContext (IContextSource $context) | |
Protected Member Functions | |
addUploadJS () | |
Add upload JS to the OutputPage. More... | |
getDescriptionSection () | |
Get the descriptor of the fieldset that contains the file description input. More... | |
getExtensionsMessage () | |
Get the messages indicating which extensions are preferred and prohibited. More... | |
getOptionsSection () | |
Get the descriptor of the fieldset that contains the upload options, such as "watch this file". More... | |
getSourceSection () | |
Get the descriptor of the fieldset that contains the file source selection. More... | |
![]() | |
formatField (HTMLFormField $field, $value) | |
Generate the HTML for an individual field in the current display format. More... | |
formatSection (array $fieldsHtml, $sectionName, $anyFieldHasLabel) | |
Put a form section together from the individual fields' HTML, merging it and wrapping. More... | |
getCancelTargetURL () | |
getFormAttributes () | |
Get HTML attributes for the <form> tag. More... | |
getMessage ( $value) | |
Turns a *-message parameter (which could be a MessageSpecifier, or a message name, or a name + parameters array) into a Message. More... | |
loadFieldData () | |
Load data of form fields from the request. More... | |
wrapFieldSetSection ( $legend, $section, $attributes, $isRoot) | |
Wraps the given $section into a user-visible fieldset. More... | |
Protected Attributes | |
$mComment | |
$mDestFile | |
$mDestWarningAck | |
$mForReUpload | |
$mHideIgnoreWarning | |
$mMaxFileSize = [] | |
array | $mMaxUploadSize = [] |
$mSessionKey | |
$mSourceIds | |
string | $mTextAfterSummary |
raw html More... | |
string | $mTextTop |
raw html More... | |
$mWatch | |
![]() | |
array | $availableDisplayFormats |
Available formats in which to display the form. More... | |
array | $availableSubclassDisplayFormats |
Available formats in which to display the form. More... | |
string | $displayFormat = 'table' |
Format in which to display form. More... | |
string false | $mAction = false |
Form action URL. More... | |
string null | $mAutocomplete = null |
Form attribute autocomplete. More... | |
array[] | $mButtons = [] |
$mCancelTarget | |
bool | $mCollapsed = false |
Whether the form is collapsed by default. More... | |
bool | $mCollapsible = false |
Whether the form can be collapsed. More... | |
$mFieldTree = [] | |
HTMLFormField[] | $mFlatFields = [] |
$mFooter = '' | |
$mFormIdentifier | |
$mHeader = '' | |
array[] | $mHiddenFields = [] |
$mId | |
$mMessagePrefix | |
$mMethod = 'post' | |
$mName | |
$mPost = '' | |
$mPre = '' | |
$mSectionFooters = [] | |
$mSectionHeaders = [] | |
$mShowCancel = false | |
$mShowReset = false | |
$mShowSubmit = true | |
$mSingleForm = false | |
$mSubmitCallback | |
string[] | $mSubmitFlags = [ 'primary', 'progressive' ] |
$mSubmitID | |
$mSubmitName | |
$mSubmitText | |
$mSubmitTooltip | |
bool | $mSubSectionBeforeFields = true |
If true, sections that contain both fields and subsections will render their subsections before their fields. More... | |
$mTableId = '' | |
Title null | $mTitle |
string array | $mTokenSalt = '' |
Salt for the edit token. More... | |
$mUseMultipart = false | |
array[] | $mValidationErrorMessage |
$mWasSubmitted = false | |
$mWrapperAttributes = [] | |
$mWrapperLegend = false | |
Additional Inherited Members | |
![]() | |
static | factory ( $displayFormat, $descriptor, IContextSource $context, $messagePrefix='') |
Construct a HTMLForm object for given display type. More... | |
static | getClassFromDescriptor ( $fieldname, &$descriptor) |
Get the HTMLFormField subclass for this descriptor. More... | |
static | loadInputFromParameters ( $fieldname, $descriptor, HTMLForm $parent=null) |
Initialise a new Object for the field. More... | |
![]() | |
$mFieldData | |
![]() | |
static string[] | $typeMappings |
A mapping of 'type' inputs onto standard HTMLFormField subclasses. More... | |
Sub class of HTMLForm that provides the form section of SpecialUpload.
Definition at line 35 of file UploadForm.php.
UploadForm::__construct | ( | array | $options = [] , |
IContextSource | $context = null , |
||
LinkRenderer | $linkRenderer = null , |
||
LocalRepo | $localRepo = null , |
||
Language | $contentLanguage = null , |
||
NamespaceInfo | $nsInfo = null , |
||
HookContainer | $hookContainer = null |
||
) |
array | $options | |
IContextSource | null | $context | |
LinkRenderer | null | $linkRenderer | |
LocalRepo | null | $localRepo | |
Language | null | $contentLanguage | |
NamespaceInfo | null | $nsInfo | |
HookContainer | null | $hookContainer |
Definition at line 70 of file UploadForm.php.
References HTMLForm\addFooterText(), ContextSource\getAuthority(), ContextSource\getContext(), getDescriptionSection(), getOptionsSection(), ContextSource\getOutput(), getSourceSection(), HTMLForm\getTitle(), ContextSource\msg(), ContextSource\setContext(), HTMLForm\setId(), HTMLForm\setSubmitName(), HTMLForm\setSubmitTextMsg(), and HTMLForm\setSubmitTooltip().
|
protected |
Add upload JS to the OutputPage.
Definition at line 450 of file UploadForm.php.
References $mMaxUploadSize, $mSourceIds, ContextSource\getConfig(), UploadBase\getMaxUploadSize(), and ContextSource\getOutput().
Referenced by show().
|
protected |
Get the descriptor of the fieldset that contains the file description input.
The section is 'description'
Definition at line 296 of file UploadForm.php.
References $file, $mComment, $mDestFile, $mTextAfterSummary, HTMLForm\addHeaderText(), ContextSource\getConfig(), and ContextSource\getUser().
Referenced by __construct().
|
protected |
Get the messages indicating which extensions are preferred and prohibited.
Definition at line 248 of file UploadForm.php.
References ContextSource\getConfig(), ContextSource\getLanguage(), and ContextSource\msg().
Referenced by 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 399 of file UploadForm.php.
References $mWatch, and ContextSource\getUser().
Referenced by __construct().
|
protected |
Get the descriptor of the fieldset that contains the file source selection.
The section is 'source'
Definition at line 157 of file UploadForm.php.
References $mSessionKey, $mTextTop, ContextSource\getAuthority(), ContextSource\getConfig(), getExtensionsMessage(), UploadBase\getMaxPhpUploadSize(), UploadBase\getMaxUploadSize(), ContextSource\getRequest(), UploadFromUrl\isAllowed(), UploadFromUrl\isEnabled(), ContextSource\msg(), and true.
Referenced by __construct().
UploadForm::show | ( | ) |
Add the upload JS and show the form.
Reimplemented from HTMLForm.
Definition at line 442 of file UploadForm.php.
References addUploadJS().
UploadForm::trySubmit | ( | ) |
Empty function; submission is handled elsewhere.
Reimplemented from HTMLForm.
Definition at line 483 of file UploadForm.php.
|
protected |
Definition at line 43 of file UploadForm.php.
Referenced by getDescriptionSection().
|
protected |
Definition at line 41 of file UploadForm.php.
Referenced by getDescriptionSection().
|
protected |
Definition at line 40 of file UploadForm.php.
|
protected |
Definition at line 37 of file UploadForm.php.
|
protected |
Definition at line 39 of file UploadForm.php.
|
protected |
Definition at line 51 of file UploadForm.php.
|
protected |
Definition at line 54 of file UploadForm.php.
Referenced by addUploadJS().
|
protected |
Definition at line 38 of file UploadForm.php.
Referenced by getSourceSection().
|
protected |
Definition at line 49 of file UploadForm.php.
Referenced by addUploadJS().
|
protected |
|
protected |
|
protected |
Definition at line 36 of file UploadForm.php.
Referenced by getOptionsSection().