MediaWiki REL1_31
FileDeleteForm Class Reference

File deletion user interface. More...

Collaboration diagram for FileDeleteForm:

Public Member Functions

 __construct ( $file)
 
 execute ()
 Fulfil the request; shows the form or deletes the file, pending authentication, confirmation, etc.
 

Static Public Member Functions

static doDelete (&$title, &$file, &$oldimage, $reason, $suppress, User $user=null, $tags=[])
 Really delete the file.
 
static haveDeletableFile (&$file, &$oldfile, $oldimage)
 Could we delete the file specified? If an oldimage value was provided, does it correspond to an existing, local, old version of this file?
 
static isValidOldSpec ( $oldimage)
 Is the provided oldimage value valid?
 

Private Member Functions

 getAction ()
 Prepare the form action.
 
 getTimestamp ()
 Extract the timestamp of the old version.
 
 prepareMessage ( $message)
 Prepare a message referring to the file being deleted, showing an appropriate message depending upon whether it's a current file or an old version.
 
 setHeaders ()
 Set headers, titles and other bits.
 
 showForm ()
 Show the confirmation form.
 
 showLogEntries ()
 Show deletion log fragments pertaining to the current file.
 

Private Attributes

File $file = null
 
File $oldfile = null
 
 $oldimage = ''
 
Title $title = null
 

Detailed Description

File deletion user interface.

Definition at line 31 of file FileDeleteForm.php.

Constructor & Destructor Documentation

◆ __construct()

FileDeleteForm::__construct ( $file)
Parameters
File$fileFile object we're deleting

Definition at line 52 of file FileDeleteForm.php.

References $file.

Member Function Documentation

◆ doDelete()

static FileDeleteForm::doDelete ( & $title,
& $file,
& $oldimage,
$reason,
$suppress,
User $user = null,
$tags = [] )
static

Really delete the file.

Parameters
Title&$title
File&$file
string&$oldimageArchive name
string$reasonReason of the deletion
bool$suppressWhether to mark all deleted versions as restricted
User$userUser object performing the request
array$tagsTags to apply to the deletion action
Exceptions
MWException
Returns
Status

Definition at line 156 of file FileDeleteForm.php.

References $oldimage, $wgUser, DB_MASTER, wfEscapeWikiText(), wfGetDB(), and wfMessage().

Referenced by UploadFromUrlTest\deleteFile(), ApiDelete\deleteFile(), ApiUploadTestCase\deleteFileByTitle(), SpecialNuke\doDelete(), and execute().

◆ execute()

FileDeleteForm::execute ( )

Fulfil the request; shows the form or deletes the file, pending authentication, confirmation, etc.

Definition at line 61 of file FileDeleteForm.php.

References $wgOut, $wgRequest, $wgUploadMaintenance, $wgUser, doDelete(), WatchAction\doWatchOrUnwatch(), prepareMessage(), setHeaders(), showForm(), showLogEntries(), RepoGroup\singleton(), wfMessage(), and wfReadOnly().

◆ getAction()

FileDeleteForm::getAction ( )
private

Prepare the form action.

Returns
string

Definition at line 429 of file FileDeleteForm.php.

References $oldimage.

Referenced by showForm().

◆ getTimestamp()

FileDeleteForm::getTimestamp ( )
private

Extract the timestamp of the old version.

Returns
string

Definition at line 445 of file FileDeleteForm.php.

◆ haveDeletableFile()

static FileDeleteForm::haveDeletableFile ( & $file,
& $oldfile,
$oldimage )
static

Could we delete the file specified? If an oldimage value was provided, does it correspond to an existing, local, old version of this file?

Parameters
File&$file
File&$oldfile
File$oldimage
Returns
bool

Definition at line 418 of file FileDeleteForm.php.

References $oldfile, $oldimage, File\exists(), and File\isLocal().

◆ isValidOldSpec()

static FileDeleteForm::isValidOldSpec ( $oldimage)
static

Is the provided oldimage value valid?

Parameters
string$oldimage
Returns
bool

Definition at line 402 of file FileDeleteForm.php.

References $oldimage.

Referenced by ApiDelete\deleteFile().

◆ prepareMessage()

FileDeleteForm::prepareMessage ( $message)
private

Prepare a message referring to the file being deleted, showing an appropriate message depending upon whether it's a current file or an old version.

Parameters
string$messageMessage base
Returns
string

Definition at line 367 of file FileDeleteForm.php.

References $wgLang, PROTO_CURRENT, wfEscapeWikiText(), wfExpandUrl(), and wfMessage().

Referenced by execute(), and showForm().

◆ setHeaders()

FileDeleteForm::setHeaders ( )
private

Set headers, titles and other bits.

Definition at line 389 of file FileDeleteForm.php.

References $wgOut, and wfMessage().

Referenced by execute().

◆ showForm()

FileDeleteForm::showForm ( )
private

Show the confirmation form.

Definition at line 246 of file FileDeleteForm.php.

References $link, $linkRenderer, $wgOut, $wgRequest, $wgUser, getAction(), RequestContext\getMain(), MIGRATION_OLD, prepareMessage(), text, and wfMessage().

Referenced by execute().

◆ showLogEntries()

FileDeleteForm::showLogEntries ( )
private

Show deletion log fragments pertaining to the current file.

Definition at line 352 of file FileDeleteForm.php.

References $wgOut, and LogEventsList\showLogExtract().

Referenced by execute().

Member Data Documentation

◆ $file

File FileDeleteForm::$file = null
private

Definition at line 41 of file FileDeleteForm.php.

Referenced by __construct().

◆ $oldfile

File FileDeleteForm::$oldfile = null
private

Definition at line 46 of file FileDeleteForm.php.

Referenced by haveDeletableFile().

◆ $oldimage

FileDeleteForm::$oldimage = ''
private

Definition at line 47 of file FileDeleteForm.php.

Referenced by doDelete(), getAction(), haveDeletableFile(), and isValidOldSpec().

◆ $title

Title FileDeleteForm::$title = null
private

Definition at line 36 of file FileDeleteForm.php.


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