MediaWiki  REL1_19
FileDeleteForm Class Reference

File deletion user interface. More...

List of all members.

Public Member Functions

 __construct ($file)
 Constructor.
 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)
 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 = null
 $oldfile = null
 $oldimage = ''
 $title = null

Detailed Description

File deletion user interface.

Author:
Rob Church <[email protected]>

Definition at line 9 of file FileDeleteForm.php.


Constructor & Destructor Documentation

Constructor.

Parameters:
$fileFile object we're deleting

Definition at line 32 of file FileDeleteForm.php.

References $file.


Member Function Documentation

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

Really delete the file.

Parameters:
$titleTitle object
File$file,:file object
$oldimageString: archive name
$reasonString: reason of the deletion
$suppressBoolean: whether to mark all deleted versions as restricted
$userUser object performing the request

Definition at line 126 of file FileDeleteForm.php.

References $file, $oldimage, $page, $title, $user, $wgUser, WikiPage\DELETE_SUCCESS, WikiPage\factory(), Status\newFatal(), wfEscapeWikiText(), wfGetDB(), wfMsgForContent(), and wfRunHooks().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 41 of file FileDeleteForm.php.

References $wgOut, $wgUploadMaintenance, $wgUser, doDelete(), WatchAction\doUnwatch(), WatchAction\doWatch(), Title\newMainPage(), prepareMessage(), setHeaders(), showForm(), showLogEntries(), RepoGroup\singleton(), wfMessage(), wfMsgForContent(), and wfReadOnly().

Here is the call graph for this function:

Prepare the form action.

Returns:
string

Definition at line 335 of file FileDeleteForm.php.

Referenced by showForm().

Here is the caller graph for this function:

Extract the timestamp of the old version.

Returns:
string

Definition at line 350 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:
$fileFile
$oldfileFile
$oldimageFile
Returns:
bool

Definition at line 324 of file FileDeleteForm.php.

References $file, $oldfile, and $oldimage.

static FileDeleteForm::isValidOldSpec ( oldimage) [static]

Is the provided `oldimage` value valid?

Returns:
bool

Definition at line 308 of file FileDeleteForm.php.

References $oldimage.

Referenced by ApiDelete\deleteFile().

Here is the caller graph for this function:

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:
$messageString: message base
Returns:
String

Definition at line 274 of file FileDeleteForm.php.

References $wgLang, wfEscapeWikiText(), wfExpandUrl(), and wfMsgExt().

Referenced by execute(), and showForm().

Here is the call graph for this function:

Here is the caller graph for this function:

Set headers, titles and other bits.

Definition at line 296 of file FileDeleteForm.php.

References $wgOut, and wfMessage().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

FileDeleteForm::showForm ( ) [private]

Show the confirmation form.

Definition at line 178 of file FileDeleteForm.php.

References $title, $wgOut, $wgUser, Xml\checkLabel(), Xml\closeElement(), Xml\element(), getAction(), Html\hidden(), Xml\input(), Xml\label(), Linker\link(), Xml\listDropDown(), Title\makeTitle(), Xml\openElement(), prepareMessage(), Xml\submitButton(), wfMsg(), wfMsgForContent(), and wfMsgHtml().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

Show deletion log fragments pertaining to the current file.

Definition at line 260 of file FileDeleteForm.php.

References $wgOut, LogPage\logName(), and LogEventsList\showLogExtract().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

FileDeleteForm::$file = null [private]

Definition at line 19 of file FileDeleteForm.php.

Referenced by __construct(), doDelete(), and haveDeletableFile().

FileDeleteForm::$oldfile = null [private]

Definition at line 24 of file FileDeleteForm.php.

Referenced by haveDeletableFile().

FileDeleteForm::$oldimage = '' [private]

Definition at line 25 of file FileDeleteForm.php.

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

FileDeleteForm::$title = null [private]

Definition at line 14 of file FileDeleteForm.php.

Referenced by doDelete(), and showForm().


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