MediaWiki  1.28.0
FileDeleteForm Class Reference

File deletion user interface. More...

Collaboration diagram for FileDeleteForm:

Public Member Functions

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

Static Public Member Functions

static doDelete (&$title, &$file, &$oldimage, $reason, $suppress, User $user=null, $tags=[])
 Really delete the file. More...
 
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? More...
 
static isValidOldSpec ($oldimage)
 Is the provided oldimage value valid? More...
 

Private Member Functions

 getAction ()
 Prepare the form action. More...
 
 getTimestamp ()
 Extract the timestamp of the old version. More...
 
 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. More...
 
 setHeaders ()
 Set headers, titles and other bits. More...
 
 showForm ()
 Show the confirmation form. More...
 
 showLogEntries ()
 Show deletion log fragments pertaining to the current file. More...
 

Private Attributes

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

Detailed Description

File deletion user interface.

Definition at line 30 of file FileDeleteForm.php.

Constructor & Destructor Documentation

FileDeleteForm::__construct (   $file)

Constructor.

Parameters
File$fileFile object we're deleting

Definition at line 53 of file FileDeleteForm.php.

References $file, file, File\getTitle(), and title.

Member Function Documentation

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
bool|Status

Definition at line 157 of file FileDeleteForm.php.

References $oldimage, $page, $status, $user, $wgUser, DB_MASTER, File\delete(), WikiPage\factory(), Title\getPrefixedText(), global, StatusValue\newFatal(), Hooks\run(), wfEscapeWikiText(), wfGetDB(), wfGetLBFactory(), and wfMessage().

Referenced by UploadFromUrlTest\deleteFile(), ApiDelete\deleteFile(), and ApiTestCaseUpload\deleteFileByTitle().

FileDeleteForm::execute ( )

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

Definition at line 62 of file FileDeleteForm.php.

References $status, $title, $wgOut, $wgRequest, $wgUser, WatchAction\doWatchOrUnwatch(), file, global, Title\newMainPage(), prepareMessage(), setHeaders(), showForm(), showLogEntries(), RepoGroup\singleton(), title, wfMessage(), and wfReadOnly().

FileDeleteForm::getAction ( )
private

Prepare the form action.

Returns
string

Definition at line 396 of file FileDeleteForm.php.

References $oldimage, and title.

Referenced by showForm().

FileDeleteForm::getTimestamp ( )
private

Extract the timestamp of the old version.

Returns
string

Definition at line 412 of file FileDeleteForm.php.

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 385 of file FileDeleteForm.php.

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

static FileDeleteForm::isValidOldSpec (   $oldimage)
static

Is the provided oldimage value valid?

Parameters
string$oldimage
Returns
bool

Definition at line 369 of file FileDeleteForm.php.

References $oldimage.

Referenced by ApiDelete\deleteFile().

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 334 of file FileDeleteForm.php.

References $wgLang, file, global, PROTO_CURRENT, title, true, wfEscapeWikiText(), wfExpandUrl(), and wfMessage().

Referenced by execute(), and showForm().

FileDeleteForm::setHeaders ( )
private

Set headers, titles and other bits.

Definition at line 356 of file FileDeleteForm.php.

References $wgOut, global, title, and wfMessage().

Referenced by execute().

FileDeleteForm::showLogEntries ( )
private

Show deletion log fragments pertaining to the current file.

Definition at line 319 of file FileDeleteForm.php.

References $wgOut, global, LogEventsList\showLogExtract(), and title.

Referenced by execute().

Member Data Documentation

File FileDeleteForm::$file = null
private

Definition at line 40 of file FileDeleteForm.php.

Referenced by __construct().

File FileDeleteForm::$oldfile = null
private

Definition at line 45 of file FileDeleteForm.php.

FileDeleteForm::$oldimage = ''
private

Definition at line 46 of file FileDeleteForm.php.

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

Title FileDeleteForm::$title = null
private

Definition at line 35 of file FileDeleteForm.php.

Referenced by execute().


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