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)
 Really delete the file.
static isValidOldSpec ($oldimage)
 Is the provided `oldimage` value valid?
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?

Private Member Functions

 showForm ()
 Show the confirmation form.
 showLogEntries ()
 Show deletion log fragments pertaining to the current file.
 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.
 getAction ()
 Prepare the form action.
 getTimestamp ()
 Extract the timestamp of the old version.

Private Attributes

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


Detailed Description

File deletion user interface.

Author:
Rob Church <robchur@gmail.com>

Definition at line 9 of file FileDeleteForm.php.


Constructor & Destructor Documentation

FileDeleteForm::__construct ( file  ) 

Constructor.

Parameters:
$file File object we're deleting

Definition at line 22 of file FileDeleteForm.php.

References $file.


Member Function Documentation

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

Really delete the file.

Parameters:
$title Title object
$file File object
$oldimage String: archive name
$reason String: reason of the deletion
$suppress Boolean: whether to mark all deleted versions as restricted

Definition at line 102 of file FileDeleteForm.php.

References $file, $oldimage, $title, $wgRequest, $wgUser, wfMsgForContent(), and wfRunHooks().

Referenced by ApiDelete::deleteFile(), and execute().

FileDeleteForm::execute (  ) 

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

Definition at line 31 of file FileDeleteForm.php.

References $wgOut, $wgRequest, $wgUser, doDelete(), Title::newMainPage(), prepareMessage(), setHeaders(), showForm(), showLogEntries(), RepoGroup::singleton(), wfMsg(), wfMsgForContent(), and wfReadOnly().

FileDeleteForm::getAction (  )  [private]

Prepare the form action.

Returns:
string

Definition at line 309 of file FileDeleteForm.php.

Referenced by showForm().

FileDeleteForm::getTimestamp (  )  [private]

Extract the timestamp of the old version.

Returns:
string

Definition at line 324 of file FileDeleteForm.php.

Referenced by prepareMessage().

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?

Returns:
bool

Definition at line 298 of file FileDeleteForm.php.

References $file, $oldfile, and $oldimage.

Referenced by ApiDelete::deleteFile().

static FileDeleteForm::isValidOldSpec ( oldimage  )  [static]

Is the provided `oldimage` value valid?

Returns:
bool

Definition at line 285 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:
$message String: message base
Returns:
String

Definition at line 241 of file FileDeleteForm.php.

References $url, $wgLang, getTimestamp(), wfExpandUrl(), and wfMsgExt().

Referenced by execute(), and showForm().

FileDeleteForm::setHeaders (  )  [private]

Set headers, titles and other bits.

Definition at line 264 of file FileDeleteForm.php.

References $wgOut, $wgUser, and wfMsg().

Referenced by execute().

FileDeleteForm::showForm (  )  [private]

FileDeleteForm::showLogEntries (  )  [private]

Show deletion log fragments pertaining to the current file.

Definition at line 227 of file FileDeleteForm.php.

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

Referenced by execute().


Member Data Documentation

FileDeleteForm::$file = null [private]

Definition at line 12 of file FileDeleteForm.php.

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

FileDeleteForm::$oldfile = null [private]

Definition at line 14 of file FileDeleteForm.php.

Referenced by haveDeletableFile().

FileDeleteForm::$oldimage = '' [private]

Definition at line 15 of file FileDeleteForm.php.

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

FileDeleteForm::$title = null [private]

Definition at line 11 of file FileDeleteForm.php.

Referenced by doDelete(), and showForm().


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

Generated on Sat Apr 30 22:57:37 2011 for MediaWiki by  doxygen 1.5.9