MediaWiki  1.23.15
UploadForm Class Reference

Sub class of HTMLForm that provides the form section of SpecialUpload. More...

Inheritance diagram for UploadForm:
Collaboration diagram for UploadForm:

Public Member Functions

 __construct (array $options=array(), IContextSource $context=null)
 
 show ()
 Add the upload JS and show the form. More...
 
 trySubmit ()
 Empty function; submission is handled elsewhere. More...
 
- Public Member Functions inherited from HTMLForm
 __construct ( $descriptor, $context=null, $messagePrefix='')
 Build a new HTMLForm from an array of field attributes. More...
 
 addButton ( $name, $value, $id=null, $attribs=null)
 Add a button to the form. More...
 
 addFooterText ( $msg, $section=null)
 Add footer text, inside the form. More...
 
 addHeaderText ( $msg, $section=null)
 Add header text, inside the form. More...
 
 addHiddenField ( $name, $value, $attribs=array())
 Add a hidden field to the output. More...
 
 addHiddenFields (array $fields)
 Add an array of hidden fields to the output. More...
 
 addPostText ( $msg)
 Add text to the end of the display. More...
 
 addPreText ( $msg)
 Add introductory text. 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...
 
 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...
 
 getErrors ( $errors)
 Format and display an error message stack. 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 ()
 
 getSubmitText ()
 Get the text for the submit button, either customised or a default. More...
 
 getTitle ()
 Get the title. More...
 
 isVForm ()
 Test if displayFormat is 'vform'. More...
 
 loadData ()
 Construct the form fields from the Descriptor array. More...
 
 prepareForm ()
 Prepare form for submission. More...
 
 setAction ( $action)
 Set the value for the action attribute of the form. More...
 
 setDisplayFormat ( $format)
 Set format in which to display the form. More...
 
 setFooterText ( $msg, $section=null)
 Set footer text, 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...
 
 setPostText ( $msg)
 Set text at the end of the display. More...
 
 setPreText ( $msg)
 Set the introductory message, 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...
 
 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...
 
 setValidationErrorMessage ( $msg)
 Set a message to display on a validation error. 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...
 
 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...
 
 wrapForm ( $html)
 Wrap the form innards in an actual "<form>" element. More...
 
- Public Member Functions inherited from ContextSource
 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...
 
 getConfig ()
 Get the Config object. More...
 
 getContext ()
 Get the RequestContext object. More...
 
 getLang ()
 Get the Language object. More...
 
 getLanguage ()
 Get the Language object. More...
 
 getOutput ()
 Get the OutputPage object. More...
 
 getRequest ()
 Get the WebRequest object. More...
 
 getSkin ()
 Get the Skin object. More...
 
 getUser ()
 Get the User object. More...
 
 getWikiPage ()
 Get the WikiPage object. More...
 
 msg ()
 Get a Message object with context set Parameters are the same as wfMessage() More...
 
 setContext (IContextSource $context)
 Set the IContextSource object. More...
 

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 prohibitted. 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...
 

Protected Attributes

 $mComment
 
 $mDestFile
 
 $mDestWarningAck
 
 $mForReUpload
 
 $mHideIgnoreWarning
 
 $mMaxFileSize = array()
 
 $mMaxUploadSize = array()
 
 $mSessionKey
 
 $mSourceIds
 
 $mTextAfterSummary
 
 $mTextTop
 
 $mWatch
 
- Protected Attributes inherited from HTMLForm
Array $availableDisplayFormats
 Available formats in which to display the form. More...
 
String $displayFormat = 'table'
 Format in which to display form. More...
 
bool string $mAction = false
 Form action URL. More...
 
 $mButtons = array()
 
 $mFieldTree
 
HTMLFormField[] $mFlatFields
 
 $mFooter = ''
 
 $mHeader = ''
 
 $mHiddenFields = array()
 
 $mId
 
 $mMessagePrefix
 
 $mMethod = 'post'
 
 $mPost = ''
 
 $mPre = ''
 
 $mSectionFooters = array()
 
 $mSectionHeaders = array()
 
 $mShowReset = false
 
 $mShowSubmit = true
 
 $mSubmitCallback
 
 $mSubmitID
 
 $mSubmitName
 
 $mSubmitText
 
 $mSubmitTooltip
 
 $mSubSectionBeforeFields = true
 If true, sections that contain both fields and subsections will render their subsections before their fields. More...
 
 $mTableId = ''
 
 $mTitle
 
 $mUseMultipart = false
 
 $mValidationErrorMessage
 
 $mWrapperLegend = false
 

Additional Inherited Members

- Static Public Member Functions inherited from HTMLForm
static addJS ()
 Add the HTMLForm-specific JavaScript, if it hasn't been done already. More...
 
static formatErrors ( $errors)
 Format a stack of error messages into a single HTML string. More...
 
static getClassFromDescriptor ( $fieldname, &$descriptor)
 Get the HTMLFormField subclass for this descriptor. More...
 
static loadInputFromParameters ( $fieldname, $descriptor)
 Initialise a new Object for the field. More...
 
- Public Attributes inherited from HTMLForm
 $mFieldData
 
- Static Public Attributes inherited from HTMLForm
static $typeMappings
 

Detailed Description

Sub class of HTMLForm that provides the form section of SpecialUpload.

Definition at line 748 of file SpecialUpload.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ addUploadJS()

UploadForm::addUploadJS ( )
protected

Add upload JS to the OutputPage.

Definition at line 1101 of file SpecialUpload.php.

References $out, array(), ContextSource\getOutput(), global, MWNamespace\isCapitalized(), and NS_FILE.

Referenced by show().

◆ getDescriptionSection()

UploadForm::getDescriptionSection ( )
protected

Get the descriptor of the fieldset that contains the file description input.

The section is 'description'

Returns
Array: descriptor array

Definition at line 953 of file SpecialUpload.php.

References $e, $file, $wgContLang, HTMLForm\addHeaderText(), array(), Html\element(), ContextSource\getUser(), global, in, of, and RepoGroup\singleton().

Referenced by __construct().

◆ getExtensionsMessage()

UploadForm::getExtensionsMessage ( )
protected

Get the messages indicating which extensions are preferred and prohibitted.

Returns
String: HTML string containing the message

Definition at line 907 of file SpecialUpload.php.

References $wgFileExtensions, ContextSource\getContext(), ContextSource\getLanguage(), global, and ContextSource\msg().

Referenced by getSourceSection().

◆ getOptionsSection()

UploadForm::getOptionsSection ( )
protected

Get the descriptor of the fieldset that contains the upload options, such as "watch this file".

The section is 'options'

Returns
Array: descriptor array

Definition at line 1051 of file SpecialUpload.php.

References $user, array(), and ContextSource\getUser().

Referenced by __construct().

◆ getSourceSection()

UploadForm::getSourceSection ( )
protected

Get the descriptor of the fieldset that contains the file source selection.

The section is 'source'

Returns
Array: descriptor array

Definition at line 813 of file SpecialUpload.php.

References array(), ContextSource\getContext(), getExtensionsMessage(), ContextSource\getLanguage(), ContextSource\getRequest(), ContextSource\getUser(), global, UploadFromUrl\isAllowed(), UploadFromUrl\isEnabled(), ContextSource\msg(), wfIsHHVM(), wfRunHooks(), and wfShorthandToInteger().

Referenced by __construct().

◆ show()

UploadForm::show ( )

Add the upload JS and show the form.

Reimplemented from HTMLForm.

Definition at line 1093 of file SpecialUpload.php.

References addUploadJS().

◆ trySubmit()

UploadForm::trySubmit ( )

Empty function; submission is handled elsewhere.

Returns
bool false

Reimplemented from HTMLForm.

Definition at line 1137 of file SpecialUpload.php.

Member Data Documentation

◆ $mComment

UploadForm::$mComment
protected

Definition at line 756 of file SpecialUpload.php.

◆ $mDestFile

UploadForm::$mDestFile
protected

Definition at line 754 of file SpecialUpload.php.

◆ $mDestWarningAck

UploadForm::$mDestWarningAck
protected

Definition at line 753 of file SpecialUpload.php.

◆ $mForReUpload

UploadForm::$mForReUpload
protected

Definition at line 750 of file SpecialUpload.php.

◆ $mHideIgnoreWarning

UploadForm::$mHideIgnoreWarning
protected

Definition at line 752 of file SpecialUpload.php.

◆ $mMaxFileSize

UploadForm::$mMaxFileSize = array()
protected

Definition at line 762 of file SpecialUpload.php.

◆ $mMaxUploadSize

UploadForm::$mMaxUploadSize = array()
protected

Definition at line 764 of file SpecialUpload.php.

◆ $mSessionKey

UploadForm::$mSessionKey
protected

Definition at line 751 of file SpecialUpload.php.

◆ $mSourceIds

UploadForm::$mSourceIds
protected

Definition at line 760 of file SpecialUpload.php.

◆ $mTextAfterSummary

UploadForm::$mTextAfterSummary
protected

Definition at line 758 of file SpecialUpload.php.

◆ $mTextTop

UploadForm::$mTextTop
protected

Definition at line 757 of file SpecialUpload.php.

◆ $mWatch

UploadForm::$mWatch
protected

Definition at line 749 of file SpecialUpload.php.


The documentation for this class was generated from the following file: