Public Member Functions | |
__construct ($request=null) | |
Constructor : initialise object Get data POSTed through the form and assign them to the object. | |
userCanExecute ($user) | |
This page can be shown if uploading is enabled. | |
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 | 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 | |
$mDestWarningAck | |
Hidden variables. | |
$mForReUpload | |
$mCancelUpload | |
$mTokenOk | |
$mUploadSuccessful = false | |
$uploadFormTextTop | |
Text injection points for hooks not using HTMLForm. | |
$uploadFormTextAfterSummary | |
Protected Member Functions | |
loadRequest ($request) | |
Initialize instance variables from request and create an Upload handler. | |
showUploadForm ($form) | |
Show the main upload form. | |
getUploadForm ($message= '', $sessionKey= '', $hideIgnoreWarning=false) | |
Get an UploadForm instance with title and text properly set. | |
showViewDeletedLinks () | |
Shows the "view X deleted revivions link"". | |
showRecoverableUploadError ($message) | |
Stashes the upload and shows the main upload form. | |
showUploadWarning ($warnings) | |
Stashes the upload, shows the main form, but adds an "continue anyway button". | |
showUploadError ($message) | |
Show the upload form with error message, but do not stash the file. | |
processUpload () | |
Do the upload. | |
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. | |
processVerificationError ($details) | |
Provides output to the user for a result of UploadBase::verifyUpload. | |
unsaveUploadedFile () | |
Remove a temporarily kept file stashed by saveTempUploadedFile(). |
Definition at line 11 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 17 of file SpecialUpload.php.
References $wgRequest, and loadRequest().
static SpecialUpload::ajaxGetExistsWarning | ( | $ | filename | ) | [static] |
Get a list of warnings.
string | local filename, e.g. 'file exists', 'non-descriptive filename' |
Definition at line 644 of file SpecialUpload.php.
References $filename, $s, getExistsWarning(), wfFindFile(), and wfLocalFile().
SpecialUpload::execute | ( | $ | par | ) |
Special page entry point.
Reimplemented from SpecialPage.
Definition at line 120 of file SpecialUpload.php.
References $wgGroupPermissions, $wgOut, $wgRequest, $wgUser, getUploadForm(), UploadBase::isEnabled(), SpecialPage::outputHeader(), processUpload(), SpecialPage::setHeaders(), showUploadForm(), unsaveUploadedFile(), wfDebug(), wfReadOnly(), and wfRunHooks().
static SpecialUpload::getDupeWarning | ( | $ | dupes | ) | [static] |
Construct a warning and a gallery from an array of duplicate files.
Definition at line 665 of file SpecialUpload.php.
References $msg, $title, $wgOut, and wfMsgExt().
Referenced by showUploadWarning().
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 588 of file SpecialUpload.php.
References $filename, $name, $wgContLang, $wgUser, SpecialPage::getTitle(), SpecialPage::getTitleFor(), wfMsgExt(), wfMsgHtml(), and wfMsgWikiHtml().
Referenced by ajaxGetExistsWarning(), and showUploadWarning().
static SpecialUpload::getInitialPageText | ( | $ | comment = '' , |
|
$ | license = '' , |
|||
$ | copyStatus = '' , |
|||
$ | source = '' | |||
) | [static] |
Get the initial image page text based on a comment and optional file status information.
Definition at line 442 of file SpecialUpload.php.
References $wgUseCopyrightUpload, and wfMsgForContent().
Referenced by processUpload(), and LocalFile::recordUpload().
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 |
Definition at line 211 of file SpecialUpload.php.
References $wgOut, SpecialPage::getTitle(), getWatchCheck(), wfEmptyMsg(), wfMsgExt(), and wfMsgNoTrans().
Referenced by execute(), processUpload(), processVerificationError(), showRecoverableUploadError(), showUploadError(), and showUploadWarning().
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 476 of file SpecialUpload.php.
References $wgUser, and wfLocalFile().
Referenced by getUploadForm().
SpecialUpload::loadRequest | ( | $ | request | ) | [protected] |
Initialize instance variables from request and create an Upload handler.
WebRequest | $request The request to extract variables from |
Definition at line 60 of file SpecialUpload.php.
References $wgUser, and UploadBase::createFromRequest().
Referenced by __construct().
SpecialUpload::processUpload | ( | ) | [protected] |
Do the upload.
Checks are made in SpecialUpload::execute()
Definition at line 377 of file SpecialUpload.php.
References $wgOut, $wgUser, getInitialPageText(), getUploadForm(), UploadBase::OK, processVerificationError(), showUploadError(), showUploadForm(), showUploadWarning(), wfDebug(), and wfRunHooks().
Referenced by execute().
SpecialUpload::processVerificationError | ( | $ | details | ) | [protected] |
Provides output to the user for a result of UploadBase::verifyUpload.
array | $details Result of UploadBase::verifyUpload |
Definition at line 500 of file SpecialUpload.php.
References $code, $wgFileExtensions, $wgLang, UploadBase::EMPTY_FILE, UploadBase::FILETYPE_BADTYPE, UploadBase::FILETYPE_MISSING, getUploadForm(), UploadBase::HOOK_ABORTED, UploadBase::ILLEGAL_FILENAME, UploadBase::MIN_LENGTH_PARTNAME, UploadBase::OVERWRITE_EXISTING_FILE, showRecoverableUploadError(), showUploadError(), showUploadForm(), UploadBase::VERIFICATION_ERROR, wfMsgExt(), and wfMsgHtml().
Referenced by processUpload().
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 292 of file SpecialUpload.php.
References getUploadForm(), showUploadForm(), wfMsg(), and wfMsgHtml().
Referenced by processVerificationError().
SpecialUpload::showUploadError | ( | $ | message | ) | [protected] |
Show the upload form with error message, but do not stash the file.
string | $message |
Definition at line 367 of file SpecialUpload.php.
References getUploadForm(), showUploadForm(), and wfMsgHtml().
Referenced by processUpload(), and processVerificationError().
SpecialUpload::showUploadForm | ( | $ | form | ) | [protected] |
Show the main upload form.
mixed | $form An HTMLForm instance or HTML string to show |
Definition at line 189 of file SpecialUpload.php.
References $wgOut, and showViewDeletedLinks().
Referenced by execute(), processUpload(), processVerificationError(), showRecoverableUploadError(), showUploadError(), and showUploadWarning().
SpecialUpload::showUploadWarning | ( | $ | warnings | ) | [protected] |
Stashes the upload, shows the main form, but adds an "continue anyway button".
Also checks whether there are actually warnings to display.
array | $warnings |
Definition at line 309 of file SpecialUpload.php.
References $msg, $wgUser, getDupeWarning(), getExistsWarning(), getUploadForm(), Title::makeTitle(), showUploadForm(), wfMsg(), wfMsgExt(), and wfMsgHtml().
Referenced by processUpload().
SpecialUpload::showViewDeletedLinks | ( | ) | [protected] |
Shows the "view X deleted revivions link"".
Definition at line 255 of file SpecialUpload.php.
References $title, $wgOut, $wgUser, SpecialPage::getTitleFor(), Title::makeTitleSafe(), and wfMsgExt().
Referenced by showUploadForm().
SpecialUpload::unsaveUploadedFile | ( | ) | [protected] |
Remove a temporarily kept file stashed by saveTempUploadedFile().
Definition at line 566 of file SpecialUpload.php.
References $success, and $wgOut.
Referenced by execute().
SpecialUpload::userCanExecute | ( | $ | 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 113 of file SpecialUpload.php.
References UploadBase::isEnabled().
SpecialUpload::$mCancelUpload |
Definition at line 46 of file SpecialUpload.php.
SpecialUpload::$mComment |
Definition at line 34 of file SpecialUpload.php.
SpecialUpload::$mCopyrightSource |
Definition at line 41 of file SpecialUpload.php.
SpecialUpload::$mCopyrightStatus |
Definition at line 40 of file SpecialUpload.php.
SpecialUpload::$mDesiredDestName |
User input variables from the "description" section.
Definition at line 33 of file SpecialUpload.php.
SpecialUpload::$mDestWarningAck |
SpecialUpload::$mForReUpload |
Definition at line 45 of file SpecialUpload.php.
SpecialUpload::$mIgnoreWarning |
SpecialUpload::$mLicense |
Definition at line 35 of file SpecialUpload.php.
SpecialUpload::$mLocalFile |
Definition at line 29 of file SpecialUpload.php.
SpecialUpload::$mRequest |
SpecialUpload::$mSourceType |
Definition at line 27 of file SpecialUpload.php.
SpecialUpload::$mTokenOk |
Definition at line 47 of file SpecialUpload.php.
SpecialUpload::$mUpload |
Definition at line 28 of file SpecialUpload.php.
SpecialUpload::$mUploadClicked |
Definition at line 30 of file SpecialUpload.php.
SpecialUpload::$mUploadSuccessful = false |
Definition at line 48 of file SpecialUpload.php.
SpecialUpload::$mWatchThis |
Definition at line 39 of file SpecialUpload.php.
SpecialUpload::$uploadFormTextAfterSummary |
Definition at line 52 of file SpecialUpload.php.
SpecialUpload::$uploadFormTextTop |
Text injection points for hooks not using HTMLForm.
Definition at line 51 of file SpecialUpload.php.