MediaWiki
REL1_24
|
Form for handling uploads and special page. More...
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. | |
getDupeWarning ($dupes) | |
Construct a warning and a gallery from an array of duplicate files. | |
userCanExecute (User $user) | |
This page can be shown if uploading is enabled. | |
Static Public Member Functions | |
static | getExistsWarning ($exists) |
Formats a result of UploadBase::getExistsWarning as HTML This check is static and can be done pre-upload via AJAX. | |
static | getInitialPageText ($comment= '', $license= '', $copyStatus= '', $source= '') |
Get the initial image page text based on a comment and optional file status information. | |
static | rotationEnabled () |
Should we rotate images in the preview on Special:Upload. | |
Public Attributes | |
bool | $mCancelUpload |
The user clicked "Cancel and return to upload form" button *. | |
$mComment | |
$mCopyrightSource | |
$mCopyrightStatus | |
string | $mDesiredDestName |
User input variables from the "description" section. | |
$mDestWarningAck | |
Hidden variables. | |
bool | $mForReUpload |
The user followed an "overwrite this file" link *. | |
$mIgnoreWarning | |
User input variables from the root section. | |
$mLicense | |
LocalFile | $mLocalFile |
* | |
WebRequest FauxRequest | $mRequest |
Misc variables. | |
$mSourceType | |
$mTokenOk | |
UploadBase | $mUpload |
* | |
$mUploadClicked | |
bool | $mUploadSuccessful = false |
Subclasses can use this to determine whether a file was uploaded *. | |
$mWatchthis | |
$uploadFormTextAfterSummary | |
$uploadFormTextTop | |
Text injection points for hooks not using HTMLForm. | |
Protected Member Functions | |
getGroupName () | |
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'. | |
getUploadForm ($message= '', $sessionKey= '', $hideIgnoreWarning=false) | |
Get an UploadForm instance with title and text properly set. | |
getWatchCheck () | |
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. | |
loadRequest () | |
Initialize instance variables from request and create an Upload handler. | |
processUpload () | |
Do the upload. | |
processVerificationError ($details) | |
Provides output to the user for a result of UploadBase::verifyUpload. | |
showRecoverableUploadError ($message) | |
Stashes the upload and shows the main upload form. | |
showUploadError ($message) | |
Show the upload form with error message, but do not stash the file. | |
showUploadForm ($form) | |
Show the main upload form. | |
showUploadWarning ($warnings) | |
Stashes the upload, shows the main form, but adds a "continue anyway button". | |
showViewDeletedLinks () | |
Shows the "view X deleted revivions link"". | |
unsaveUploadedFile () | |
Remove a temporarily kept file stashed by saveTempUploadedFile(). |
Form for handling uploads and special page.
Definition at line 31 of file SpecialUpload.php.
SpecialUpload::__construct | ( | $ | request = null | ) |
Constructor : initialise object Get data POSTed through the form and assign them to the object.
WebRequest | $request | Data posted. |
Definition at line 37 of file SpecialUpload.php.
SpecialUpload::execute | ( | $ | par | ) |
Special page entry point.
string | $par |
Reimplemented from SpecialPage.
Definition at line 140 of file SpecialUpload.php.
SpecialUpload::getDupeWarning | ( | $ | dupes | ) |
Construct a warning and a gallery from an array of duplicate files.
array | $dupes |
Definition at line 715 of file SpecialUpload.php.
static SpecialUpload::getExistsWarning | ( | $ | exists | ) | [static] |
Formats a result of UploadBase::getExistsWarning as HTML This check is static and can be done pre-upload via AJAX.
array | $exists | The result of UploadBase::getExistsWarning |
Definition at line 663 of file SpecialUpload.php.
Referenced by ApiQueryImageInfo\getInfo().
SpecialUpload::getGroupName | ( | ) | [protected] |
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.
Reimplemented from SpecialPage.
Definition at line 731 of file SpecialUpload.php.
static SpecialUpload::getInitialPageText | ( | $ | comment = '' , |
$ | license = '' , |
||
$ | copyStatus = '' , |
||
$ | source = '' |
||
) | [static] |
Get the initial image page text based on a comment and optional file status information.
string | $comment | |
string | $license | |
string | $copyStatus | |
string | $source |
Definition at line 483 of file SpecialUpload.php.
SpecialUpload::getUploadForm | ( | $ | message = '' , |
$ | sessionKey = '' , |
||
$ | hideIgnoreWarning = false |
||
) | [protected] |
Get an UploadForm instance with title and text properly set.
string | $message | HTML string to add to the form |
string | $sessionKey | Session key in case this is a stashed upload |
bool | $hideIgnoreWarning | Whether to hide "ignore warning" check box |
Definition at line 222 of file SpecialUpload.php.
SpecialUpload::getWatchCheck | ( | ) | [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 535 of file SpecialUpload.php.
SpecialUpload::loadRequest | ( | ) | [protected] |
Initialize instance variables from request and create an Upload handler.
Definition at line 82 of file SpecialUpload.php.
SpecialUpload::processUpload | ( | ) | [protected] |
Do the upload.
Checks are made in SpecialUpload::execute()
Definition at line 401 of file SpecialUpload.php.
SpecialUpload::processVerificationError | ( | $ | details | ) | [protected] |
Provides output to the user for a result of UploadBase::verifyUpload.
array | $details | Result of UploadBase::verifyUpload |
MWException |
Definition at line 564 of file SpecialUpload.php.
References $error, $extensions, array(), details, UploadBase\EMPTY_FILE, UploadBase\FILE_TOO_LARGE, UploadBase\FILENAME_TOO_LONG, UploadBase\FILETYPE_BADTYPE, UploadBase\FILETYPE_MISSING, SpecialPage\getConfig(), SpecialPage\getLanguage(), UploadBase\HOOK_ABORTED, hooks, UploadBase\ILLEGAL_FILENAME, in, UploadBase\MIN_LENGTH_PARTNAME, SpecialPage\msg(), showRecoverableUploadError(), showUploadError(), UploadBase\VERIFICATION_ERROR, and UploadBase\WINDOWS_NONASCII_FILENAME.
static SpecialUpload::rotationEnabled | ( | ) | [static] |
Should we rotate images in the preview on Special:Upload.
This controls js: mw.config.get( 'wgFileCanRotate' )
Definition at line 742 of file SpecialUpload.php.
Referenced by ResourceLoaderStartUpModule\getConfigSettings().
SpecialUpload::showRecoverableUploadError | ( | $ | 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.
string | $message | HTML message to be passed to mainUploadForm |
Definition at line 311 of file SpecialUpload.php.
Referenced by processVerificationError().
SpecialUpload::showUploadError | ( | $ | message | ) | [protected] |
Show the upload form with error message, but do not stash the file.
string | $message | HTML string |
Definition at line 391 of file SpecialUpload.php.
Referenced by processVerificationError().
SpecialUpload::showUploadForm | ( | $ | form | ) | [protected] |
Show the main upload form.
Definition at line 201 of file SpecialUpload.php.
SpecialUpload::showUploadWarning | ( | $ | warnings | ) | [protected] |
Stashes the upload, shows the main form, but adds a "continue anyway button".
Also checks whether there are actually warnings to display.
array | $warnings |
Definition at line 329 of file SpecialUpload.php.
SpecialUpload::showViewDeletedLinks | ( | ) | [protected] |
Shows the "view X deleted revivions link"".
Definition at line 282 of file SpecialUpload.php.
SpecialUpload::unsaveUploadedFile | ( | ) | [protected] |
Remove a temporarily kept file stashed by saveTempUploadedFile().
Definition at line 640 of file SpecialUpload.php.
SpecialUpload::userCanExecute | ( | User $ | user | ) |
This page can be shown if uploading is enabled.
Handle permission checking elsewhere in order to be able to show custom error messages.
User | $user |
Reimplemented from SpecialPage.
Definition at line 132 of file SpecialUpload.php.
bool SpecialUpload::$mCancelUpload |
The user clicked "Cancel and return to upload form" button *.
Definition at line 70 of file SpecialUpload.php.
SpecialUpload::$mComment |
Definition at line 54 of file SpecialUpload.php.
SpecialUpload::$mCopyrightSource |
Definition at line 62 of file SpecialUpload.php.
SpecialUpload::$mCopyrightStatus |
Definition at line 61 of file SpecialUpload.php.
string SpecialUpload::$mDesiredDestName |
User input variables from the "description" section.
The requested target file name *
Definition at line 53 of file SpecialUpload.php.
SpecialUpload::$mDestWarningAck |
Hidden variables.
Definition at line 66 of file SpecialUpload.php.
bool SpecialUpload::$mForReUpload |
The user followed an "overwrite this file" link *.
Definition at line 68 of file SpecialUpload.php.
SpecialUpload::$mIgnoreWarning |
User input variables from the root section.
Definition at line 59 of file SpecialUpload.php.
SpecialUpload::$mLicense |
Definition at line 55 of file SpecialUpload.php.
LocalFile SpecialUpload::$mLocalFile |
*
Definition at line 48 of file SpecialUpload.php.
WebRequest FauxRequest SpecialUpload::$mRequest |
Misc variables.
The request this form is supposed to handle *
Definition at line 43 of file SpecialUpload.php.
SpecialUpload::$mSourceType |
Definition at line 44 of file SpecialUpload.php.
SpecialUpload::$mTokenOk |
Definition at line 71 of file SpecialUpload.php.
UploadBase SpecialUpload::$mUpload |
*
Definition at line 46 of file SpecialUpload.php.
SpecialUpload::$mUploadClicked |
Definition at line 49 of file SpecialUpload.php.
bool SpecialUpload::$mUploadSuccessful = false |
Subclasses can use this to determine whether a file was uploaded *.
Definition at line 73 of file SpecialUpload.php.
SpecialUpload::$mWatchthis |
Definition at line 60 of file SpecialUpload.php.
SpecialUpload::$uploadFormTextAfterSummary |
Definition at line 77 of file SpecialUpload.php.
SpecialUpload::$uploadFormTextTop |
Text injection points for hooks not using HTMLForm.
Definition at line 76 of file SpecialUpload.php.