MediaWiki
1.28.0
|
File deletion user interface. More...
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 |
File deletion user interface.
Definition at line 30 of file FileDeleteForm.php.
FileDeleteForm::__construct | ( | $file | ) |
Constructor.
Definition at line 53 of file FileDeleteForm.php.
References $file, file, File\getTitle(), and title.
|
static |
Really delete the file.
Title | $title | |
File | $file | |
string | $oldimage | Archive name |
string | $reason | Reason of the deletion |
bool | $suppress | Whether to mark all deleted versions as restricted |
User | $user | User object performing the request |
array | $tags | Tags to apply to the deletion action |
MWException |
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().
|
private |
Prepare the form action.
Definition at line 396 of file FileDeleteForm.php.
References $oldimage, and title.
Referenced by showForm().
|
private |
Extract the timestamp of the old version.
Definition at line 412 of file FileDeleteForm.php.
|
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?
Definition at line 385 of file FileDeleteForm.php.
References $oldimage, File\exists(), and File\isLocal().
|
static |
Is the provided oldimage
value valid?
string | $oldimage |
Definition at line 369 of file FileDeleteForm.php.
References $oldimage.
Referenced by ApiDelete\deleteFile().
|
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.
string | $message | Message base |
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().
|
private |
Set headers, titles and other bits.
Definition at line 356 of file FileDeleteForm.php.
References $wgOut, global, title, and wfMessage().
Referenced by execute().
|
private |
Show the confirmation form.
Definition at line 226 of file FileDeleteForm.php.
References $link, $wgOut, $wgRequest, $wgUser, Xml\checkLabel(), Xml\closeElement(), Xml\element(), getAction(), global, Html\hidden(), Xml\input(), Xml\label(), Linker\linkKnown(), Xml\listDropDown(), Xml\openElement(), prepareMessage(), Xml\submitButton(), text, title, and wfMessage().
Referenced by execute().
|
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().
|
private |
Definition at line 40 of file FileDeleteForm.php.
Referenced by __construct().
|
private |
Definition at line 45 of file FileDeleteForm.php.
|
private |
Definition at line 46 of file FileDeleteForm.php.
Referenced by doDelete(), getAction(), haveDeletableFile(), and isValidOldSpec().
|
private |
Definition at line 35 of file FileDeleteForm.php.
Referenced by execute().