Semantic MediaWiki and related extensions
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
PFUploadWindow Class Reference
Inheritance diagram for PFUploadWindow:
Inheritance graph
[legend]
Collaboration diagram for PFUploadWindow:
Collaboration graph
[legend]

Public Member Functions

 __construct ( $request=null)
 
 execute ( $par)
 

Static Public Member Functions

static getInitialPageText ( $comment='', $license='', $copyStatus='', $source='')
 
static getExistsWarning ( $exists)
 
static ajaxGetExistsWarning ( $filename)
 
static ajaxGetLicensePreview ( $license)
 
static getDupeWarning ( $dupes)
 

Public Attributes

 $mRequest
 
 $mSourceType
 
 $mUpload
 
 $mLocalFile
 
 $mUploadClicked
 
 $mDesiredDestName
 
 $mComment
 
 $mLicense
 
 $mIgnoreWarning
 
 $mWatchThis
 
 $mCopyrightStatus
 
 $mCopyrightSource
 
 $mForReUpload
 
 $mCancelUpload
 
 $mTokenOk
 
 $mInputID
 
 $mDelimiter
 

Protected Member Functions

 loadRequest ( $request)
 
 showUploadForm ( $form)
 
 getUploadForm ( $message='', $sessionKey='', $hideIgnoreWarning=false)
 
 showViewDeletedLinks ()
 
 recoverableUploadError ( $message)
 
 uploadWarning ( $warnings)
 
 uploadError ( $message)
 
 processUpload ()
 
 watchCheck ()
 
 processVerificationError ( $details)
 
 unsaveUploadedFile ()
 

Protected Attributes

 $mTextTop
 
 $mTextAfterSummary
 

Constructor & Destructor Documentation

◆ __construct()

PFUploadWindow::__construct (   $request = null)

Constructor : initialise object Get data POSTed through the form and assign them to the object

Parameters
WebRequest | null$requestData posted.

Member Function Documentation

◆ ajaxGetExistsWarning()

static PFUploadWindow::ajaxGetExistsWarning (   $filename)
static

Get a list of warnings

Parameters
string$filenamelocal filename, e.g. 'file exists', 'non-descriptive filename'
Returns
array list of warning messages

◆ ajaxGetLicensePreview()

static PFUploadWindow::ajaxGetLicensePreview (   $license)
static

Render a preview of a given license for the AJAX preview on upload

Parameters
string$license
Returns
string

◆ execute()

PFUploadWindow::execute (   $par)

Special page entry point

Parameters
string | null$par

◆ getDupeWarning()

static PFUploadWindow::getDupeWarning (   $dupes)
static

Construct a warning and a gallery from an array of duplicate files.

Parameters
File[]$dupes
Returns
string

◆ getExistsWarning()

static PFUploadWindow::getExistsWarning (   $exists)
static

Formats a result of UploadBase::getExistsWarning as HTML This check is static and can be done pre-upload via AJAX

Parameters
array$existsThe result of UploadBase::getExistsWarning
Returns
string Empty string if there is no warning or an HTML fragment consisting of one or more elements if there is a warning.

◆ getInitialPageText()

static PFUploadWindow::getInitialPageText (   $comment = '',
  $license = '',
  $copyStatus = '',
  $source = '' 
)
static

Get the initial image page text based on a comment and optional file status information

Parameters
string$comment
string$license
string$copyStatus
string$source
Returns
string

◆ getUploadForm()

PFUploadWindow::getUploadForm (   $message = '',
  $sessionKey = '',
  $hideIgnoreWarning = false 
)
protected

Get an UploadForm instance with title and text properly set.

Parameters
string$messageHTML string to add to the form
string$sessionKeySession key in case this is a stashed upload
bool$hideIgnoreWarning
Returns
UploadForm

◆ loadRequest()

PFUploadWindow::loadRequest (   $request)
protected

Initialize instance variables from request and create an Upload handler

Parameters
WebRequest$requestThe request to extract variables from

◆ processUpload()

PFUploadWindow::processUpload ( )
protected

Do the upload. Checks are made in SpecialUpload::execute()

Returns
array|bool

◆ processVerificationError()

PFUploadWindow::processVerificationError (   $details)
protected

Provides output to the user for a result of UploadBase::verifyUpload

Parameters
array$detailsResult of UploadBase::verifyUpload
Exceptions
MWException

Statuses that only require name changing

Statuses that require reuploading

◆ recoverableUploadError()

PFUploadWindow::recoverableUploadError (   $message)
protected

Stashes the upload and shows the main upload form.

Note: only errors that can be handled by changing the name or description should be redirected here. It should be assumed that the file itself is sane and has passed UploadBase::verifyFile. This essentially means that UploadBase::VERIFICATION_ERROR and UploadBase::EMPTY_FILE should not be passed here.

Parameters
string$messageHTML message to be passed to mainUploadForm

◆ showUploadForm()

PFUploadWindow::showUploadForm (   $form)
protected

Show the main upload form.

Parameters
UploadForm$form

◆ showViewDeletedLinks()

PFUploadWindow::showViewDeletedLinks ( )
protected

Shows the "view X deleted revivions link""

◆ unsaveUploadedFile()

PFUploadWindow::unsaveUploadedFile ( )
protected

Remove a temporarily kept file stashed by saveTempUploadedFile(). private

Returns
success

◆ uploadError()

PFUploadWindow::uploadError (   $message)
protected

Show the upload form with error message, but do not stash the file.

Parameters
string$message

◆ uploadWarning()

PFUploadWindow::uploadWarning (   $warnings)
protected

Stashes the upload, shows the main form, but adds an "continue anyway button"

Parameters
array$warnings

◆ watchCheck()

PFUploadWindow::watchCheck ( )
protected

See if we should check the 'watch this page' checkbox on the form based on the user's preferences and whether we're being asked to create a new file or update an existing one.

In the case where 'watch edits' is off but 'watch creations' is on, we'll leave the box unchecked.

Note that the page target can be changed on the form, so our check state can get out of sync.

Returns
bool

Member Data Documentation

◆ $mDesiredDestName

PFUploadWindow::$mDesiredDestName

User input variables from the "description" section

◆ $mForReUpload

PFUploadWindow::$mForReUpload

Hidden variables

◆ $mIgnoreWarning

PFUploadWindow::$mIgnoreWarning

User input variables from the root section

◆ $mInputID

PFUploadWindow::$mInputID

used by Page Forms

◆ $mRequest

PFUploadWindow::$mRequest

Misc variables


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

About | General disclaimer | Privacy policy