SFUploadWindowProto Class Reference
[Special Pages]

List of all members.

Public Member Functions

 __construct ($request=null)
 Constructor : initialise object Get data POSTed through the form and assign them to the object.
 execute ($par)
 Special page entry point.

Static Public Member Functions

static getInitialPageText ($comment= '', $license= '', $copyStatus= '', $source= '')
 Get the initial image page text based on a comment and optional file status information.
static getExistsWarning ($exists)
 Formats a result of UploadBase::getExistsWarning as HTML This check is static and can be done pre-upload via AJAX.
static ajaxGetExistsWarning ($filename)
 Get a list of warnings.
static ajaxGetLicensePreview ($license)
 Render a preview of a given license for the AJAX preview on upload.
static getDupeWarning ($dupes)
 Construct a warning and a gallery from an array of duplicate files.

Public Attributes

 $mRequest
 Misc variables.
 $mSourceType
 $mUpload
 $mLocalFile
 $mUploadClicked
 $mDesiredDestName
 User input variables from the "description" section.
 $mComment
 $mLicense
 $mIgnoreWarning
 User input variables from the root section.
 $mWatchThis
 $mCopyrightStatus
 $mCopyrightSource
 $mForReUpload
 Hidden variables.
 $mCancelUpload
 $mTokenOk
 $mInputID
 used by Semantic Forms
 $mDelimiter

Protected Member Functions

 loadRequest ($request)
 Initialize instance variables from request and create an Upload handler.
 showUploadForm ($form)
 Show the main upload form and optionally add the session key to the output.
 getUploadForm ($message= '', $sessionKey= '', $hideIgnoreWarning=false)
 Get an UploadForm instance with title and text properly set.
 showViewDeletedLinks ()
 Shows the "view X deleted revivions link"".
 recoverableUploadError ($message)
 Stashes the upload and shows the main upload form.
 uploadWarning ($warnings)
 Stashes the upload, shows the main form, but adds an "continue anyway button".
 uploadError ($message)
 Show the upload form with error message, but do not stash the file.
 processUpload ()
 Do the upload.
 watchCheck ()
 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.
 processVerificationError ($details)
 Provides output to the user for a result of UploadBase::verifyUpload.
 unsaveUploadedFile ()
 Remove a temporarily kept file stashed by saveTempUploadedFile().


Detailed Description

Definition at line 16 of file SF_UploadWindow.php.


Constructor & Destructor Documentation

SFUploadWindowProto::__construct ( request = null  ) 

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

Parameters:
WebRequest $request Data posted.

Definition at line 22 of file SF_UploadWindow.php.

References loadRequest().


Member Function Documentation

SFUploadWindowProto::loadRequest ( request  )  [protected]

Initialize instance variables from request and create an Upload handler.

Parameters:
WebRequest $request The request to extract variables from

Definition at line 62 of file SF_UploadWindow.php.

Referenced by __construct().

SFUploadWindowProto::execute ( par  ) 

Special page entry point.

Definition at line 109 of file SF_UploadWindow.php.

References $wgGroupPermissions, getUploadForm(), processUpload(), showUploadForm(), and unsaveUploadedFile().

SFUploadWindowProto::showUploadForm ( form  )  [protected]

Show the main upload form and optionally add the session key to the output.

This hides the source selection.

Parameters:
string $message HTML message to be shown at top of form
string $sessionKey Session key of the stashed upload

Definition at line 183 of file SF_UploadWindow.php.

References showViewDeletedLinks().

Referenced by execute(), processUpload(), processVerificationError(), recoverableUploadError(), uploadError(), and uploadWarning().

SFUploadWindowProto::getUploadForm ( message = '',
sessionKey = '',
hideIgnoreWarning = false 
) [protected]

Get an UploadForm instance with title and text properly set.

Parameters:
string $message HTML string to add to the form
string $sessionKey Session key in case this is a stashed upload
Returns:
UploadForm

Definition at line 198 of file SF_UploadWindow.php.

References watchCheck().

Referenced by execute(), processUpload(), processVerificationError(), recoverableUploadError(), uploadError(), and uploadWarning().

SFUploadWindowProto::showViewDeletedLinks (  )  [protected]

Shows the "view X deleted revivions link"".

Definition at line 237 of file SF_UploadWindow.php.

Referenced by showUploadForm().

SFUploadWindowProto::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 $message HTML message to be passed to mainUploadForm

Definition at line 271 of file SF_UploadWindow.php.

References getUploadForm(), and showUploadForm().

Referenced by processVerificationError().

SFUploadWindowProto::uploadWarning ( warnings  )  [protected]

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

Parameters:
array $warnings

Definition at line 285 of file SF_UploadWindow.php.

References getUploadForm(), and showUploadForm().

Referenced by processUpload().

SFUploadWindowProto::uploadError ( message  )  [protected]

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

Parameters:
string $message

Definition at line 325 of file SF_UploadWindow.php.

References getUploadForm(), and showUploadForm().

Referenced by processUpload(), and processVerificationError().

SFUploadWindowProto::processUpload (  )  [protected]

Do the upload.

Checks are made in SpecialUpload::execute()

Definition at line 335 of file SF_UploadWindow.php.

References END, getUploadForm(), processVerificationError(), showUploadForm(), uploadError(), and uploadWarning().

Referenced by execute().

static SFUploadWindowProto::getInitialPageText ( comment = '',
license = '',
copyStatus = '',
source = '' 
) [static]

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

Definition at line 438 of file SF_UploadWindow.php.

SFUploadWindowProto::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.

Definition at line 472 of file SF_UploadWindow.php.

Referenced by getUploadForm().

SFUploadWindowProto::processVerificationError ( details  )  [protected]

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

Parameters:
array $details Result of UploadBase::verifyUpload

Statuses that only require name changing

Statuses that require reuploading

Definition at line 496 of file SF_UploadWindow.php.

References getUploadForm(), recoverableUploadError(), showUploadForm(), and uploadError().

Referenced by processUpload().

SFUploadWindowProto::unsaveUploadedFile (  )  [protected]

Remove a temporarily kept file stashed by saveTempUploadedFile().

private

Returns:
success

Definition at line 555 of file SF_UploadWindow.php.

Referenced by execute().

static SFUploadWindowProto::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 $exists The 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.

Definition at line 578 of file SF_UploadWindow.php.

static SFUploadWindowProto::ajaxGetExistsWarning ( filename  )  [static]

Get a list of warnings.

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

Definition at line 634 of file SF_UploadWindow.php.

static SFUploadWindowProto::ajaxGetLicensePreview ( license  )  [static]

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

Parameters:
string $license
Returns:
string

Definition at line 658 of file SF_UploadWindow.php.

static SFUploadWindowProto::getDupeWarning ( dupes  )  [static]

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

Definition at line 674 of file SF_UploadWindow.php.


Member Data Documentation

SFUploadWindowProto::$mRequest

Misc variables.

Definition at line 31 of file SF_UploadWindow.php.

SFUploadWindowProto::$mSourceType

Definition at line 32 of file SF_UploadWindow.php.

SFUploadWindowProto::$mUpload

Definition at line 33 of file SF_UploadWindow.php.

SFUploadWindowProto::$mLocalFile

Definition at line 34 of file SF_UploadWindow.php.

SFUploadWindowProto::$mUploadClicked

Definition at line 35 of file SF_UploadWindow.php.

SFUploadWindowProto::$mDesiredDestName

User input variables from the "description" section.

Definition at line 38 of file SF_UploadWindow.php.

SFUploadWindowProto::$mComment

Definition at line 39 of file SF_UploadWindow.php.

SFUploadWindowProto::$mLicense

Definition at line 40 of file SF_UploadWindow.php.

SFUploadWindowProto::$mIgnoreWarning

User input variables from the root section.

Definition at line 43 of file SF_UploadWindow.php.

SFUploadWindowProto::$mWatchThis

Definition at line 44 of file SF_UploadWindow.php.

SFUploadWindowProto::$mCopyrightStatus

Definition at line 45 of file SF_UploadWindow.php.

SFUploadWindowProto::$mCopyrightSource

Definition at line 46 of file SF_UploadWindow.php.

SFUploadWindowProto::$mForReUpload

Hidden variables.

Definition at line 49 of file SF_UploadWindow.php.

SFUploadWindowProto::$mCancelUpload

Definition at line 50 of file SF_UploadWindow.php.

SFUploadWindowProto::$mTokenOk

Definition at line 51 of file SF_UploadWindow.php.

SFUploadWindowProto::$mInputID

used by Semantic Forms

Definition at line 54 of file SF_UploadWindow.php.

SFUploadWindowProto::$mDelimiter

Definition at line 55 of file SF_UploadWindow.php.


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

Generated on Sun Mar 18 07:15:42 2012 for Semantic MediaWiki by  doxygen 1.5.6