BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
SpecialUpload Class Reference
Inheritance diagram for SpecialUpload:
Collaboration diagram for SpecialUpload:

Public Member Functions

 __construct ($request=null)
 
 doesWrites ()
 
 userCanExecute (User $user)
 
 execute ($par)
 
 getDupeWarning ($dupes)
 
- Public Member Functions inherited from SpecialPage
 __construct ($name= '', $restriction= '', $listed=true, $function=false, $file= '', $includable=false)
 
 getName ()
 
 getRestriction ()
 
 isListed ()
 
 setListed ($listed)
 
 listed ($x=null)
 
 isIncludable ()
 
 maxIncludeCacheTime ()
 
 including ($x=null)
 
 getLocalName ()
 
 isExpensive ()
 
 isCached ()
 
 isRestricted ()
 
 userCanExecute (User $user)
 
 displayRestrictionError ()
 
 checkPermissions ()
 
 checkReadOnly ()
 
 requireLogin ($reasonMsg= 'exception-nologin-text', $titleMsg= 'exception-nologin')
 
 prefixSearchSubpages ($search, $limit, $offset)
 
 setHeaders ()
 
 run ($subPage)
 
 execute ($subPage)
 
 outputHeader ($summaryMessageKey= '')
 
 getDescription ()
 
 getTitle ($subpage=false)
 
 getPageTitle ($subpage=false)
 
 setContext ($context)
 
 getContext ()
 
 getRequest ()
 
 getOutput ()
 
 getUser ()
 
 getSkin ()
 
 getLanguage ()
 
 getConfig ()
 
 getFullTitle ()
 
 msg ($key)
 
 addHelpLink ($to, $overrideBaseUrl=false)
 
 getFinalGroupName ()
 
 doesWrites ()
 
 getLinkRenderer ()
 
 setLinkRenderer (LinkRenderer $linkRenderer)
 

Static Public Member Functions

static getInitialPageText ($comment= '', $license= '', $copyStatus= '', $source= '', Config $config=null)
 
static getExistsWarning ($exists)
 
static rotationEnabled ()
 
- Static Public Member Functions inherited from SpecialPage
static getTitleFor ($name, $subpage=false, $fragment= '')
 
static getTitleValueFor ($name, $subpage=false, $fragment= '')
 
static getSafeTitleFor ($name, $subpage=false)
 

Public Attributes

 $mRequest
 
 $mSourceType
 
 $mUpload
 
 $mLocalFile
 
 $mUploadClicked
 
 $mDesiredDestName
 
 $mComment
 
 $mLicense
 
 $mIgnoreWarning
 
 $mWatchthis
 
 $mCopyrightStatus
 
 $mCopyrightSource
 
 $mDestWarningAck
 
 $mForReUpload
 
 $mCancelUpload
 
 $mTokenOk
 
 $mUploadSuccessful = false
 
 $uploadFormTextTop
 
 $uploadFormTextAfterSummary
 

Protected Member Functions

 loadRequest ()
 
 showUploadForm ($form)
 
 getUploadForm ($message= '', $sessionKey= '', $hideIgnoreWarning=false)
 
 showViewDeletedLinks ()
 
 showRecoverableUploadError ($message)
 
 showUploadWarning ($warnings)
 
 showUploadError ($message)
 
 processUpload ()
 
 getWatchCheck ()
 
 processVerificationError ($details)
 
 unsaveUploadedFile ()
 
 getGroupName ()
 
- Protected Member Functions inherited from SpecialPage
 getCacheTTL ()
 
 getLoginSecurityLevel ()
 
 checkLoginSecurityLevel ($level=null)
 
 getSubpagesForPrefixSearch ()
 
 prefixSearchString ($search, $limit, $offset)
 
 beforeExecute ($subPage)
 
 afterExecute ($subPage)
 
 getRobotPolicy ()
 
 addFeedLinks ($params)
 
 getGroupName ()
 
 useTransactionalTimeLimit ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from SpecialPage
static prefixSearchArray ($search, $limit, array $subpages, $offset)
 
- Protected Attributes inherited from SpecialPage
 $mName
 
 $mRestriction
 
 $mIncluding
 
 $mIncludable
 
 $mContext
 

Detailed Description

Form for handling uploads and special page.

Constructor & Destructor Documentation

SpecialUpload::__construct (   $request = null)

Get data POSTed through the form and assign them to the object

Parameters
WebRequest$requestData posted.

Member Function Documentation

SpecialUpload::execute (   $par)

Special page entry point

Parameters
string$par
Exceptions
ErrorPageError
Exception
FatalError
MWException
PermissionsError
ReadOnlyError
UserBlockedError
SpecialUpload::getDupeWarning (   $dupes)

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

Parameters
array$dupes
Returns
string
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

Parameters
array$existsThe result of UploadBase::getExistsWarning
Returns
string Empty string if there is no warning or an HTML fragment
static SpecialUpload::getInitialPageText (   $comment = '',
  $license = '',
  $copyStatus = '',
  $source = '',
Config  $config = null 
)
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
Config$configConfiguration object to load data from
Returns
string
SpecialUpload::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$hideIgnoreWarningWhether to hide "ignore warning" check box
Returns
UploadForm
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.

Returns
bool|string
SpecialUpload::loadRequest ( )
protected

Initialize instance variables from request and create an Upload handler

SpecialUpload::processUpload ( )
protected

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

SpecialUpload::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

static SpecialUpload::rotationEnabled ( )
static

Should we rotate images in the preview on Special:Upload.

This controls js: mw.config.get( 'wgFileCanRotate' )

Todo:
What about non-BitmapHandler handled files?
Returns
bool
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.

Parameters
string$messageHTML message to be passed to mainUploadForm
SpecialUpload::showUploadError (   $message)
protected

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

Parameters
string$messageHTML string
SpecialUpload::showUploadForm (   $form)
protected

Show the main upload form

Parameters
HTMLForm | string$formAn HTMLForm instance or HTML string to show
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.

Parameters
array$warnings
Returns
bool True if warnings were displayed, false if there are no warnings and it should continue processing
SpecialUpload::showViewDeletedLinks ( )
protected

Shows the "view X deleted revivions link""

SpecialUpload::unsaveUploadedFile ( )
protected

Remove a temporarily kept file stashed by saveTempUploadedFile().

Returns
bool Success
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.

Parameters
User$user
Returns
bool

Member Data Documentation

SpecialUpload::$mDestWarningAck

Hidden variables

SpecialUpload::$mIgnoreWarning

User input variables from the root section

SpecialUpload::$uploadFormTextTop

Text injection points for hooks not using HTMLForm


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