Go to the documentation of this file.
65 $permissionErrors = $this->
title->getUserPermissionsErrors(
'delete', $wgUser );
66 if ( count( $permissionErrors ) ) {
74 if ( $wgUploadMaintenance ) {
75 throw new ErrorPageError(
'filedelete-maintenance-title',
'filedelete-maintenance' );
80 $this->oldimage = $wgRequest->getText(
'oldimage',
false );
81 $token = $wgRequest->getText(
'wpEditToken' );
82 # Flag to hide all contents of the archived revisions
83 $suppress = $wgRequest->getVal(
'wpSuppress' ) &&
$wgUser->isAllowed(
'suppressrevision' );
85 if ( $this->oldimage ) {
89 if ( !self::haveDeletableFile( $this->
file, $this->oldfile, $this->oldimage ) ) {
91 $wgOut->addReturnTo( $this->
title );
96 if ( $wgRequest->wasPosted() &&
$wgUser->matchEditToken( $token, $this->oldimage ) ) {
97 $deleteReasonList = $wgRequest->getText(
'wpDeleteReasonList' );
98 $deleteReason = $wgRequest->getText(
'wpReason' );
100 if ( $deleteReasonList ==
'other' ) {
101 $reason = $deleteReason;
102 } elseif ( $deleteReason !=
'' ) {
104 $reason = $deleteReasonList .
wfMessage(
'colon-separator' )
105 ->inContentLanguage()->text() . $deleteReason;
107 $reason = $deleteReasonList;
112 if ( !$status->isGood() ) {
114 $wgOut->addWikiText(
'<div class="error">' . $status->getWikiText(
'filedeleteerror-short',
'filedeleteerror-long' ) .
'</div>' );
145 if (
$user ===
null ) {
156 if ( trim( $reason ) !=
'' ) {
157 $logComment .=
wfMessage(
'colon-separator' )
158 ->inContentLanguage()->text() . $reason;
161 $logtype = $suppress ?
'suppress' :
'delete';
164 $logEntry->setPerformer(
$user );
165 $logEntry->setTarget(
$title );
166 $logEntry->setComment( $logComment );
167 $logid = $logEntry->insert();
168 $logEntry->publish( $logid );
179 $deleteStatus = $page->doDeleteArticleReal( $reason, $suppress, 0,
false,
$error,
$user );
182 if ( $deleteStatus->isOK() ) {
184 if ( $status->isOK() ) {
185 $dbw->commit( __METHOD__ );
187 $dbw->rollback( __METHOD__ );
192 $dbw->rollback( __METHOD__ );
197 if ( $status->isOK() ) {
210 if (
$wgUser->isAllowed(
'suppressrevision' ) ) {
211 $suppress =
"<tr id=\"wpDeleteSuppressRow\">
213 <td class='mw-input'><strong>" .
215 'wpSuppress',
'wpSuppress',
false,
array(
'tabindex' =>
'3' ) ) .
222 $checkWatch =
$wgUser->getBoolOption(
'watchdeletion' ) ||
$wgUser->isWatched( $this->
title );
224 'id' =>
'mw-img-deleteconfirm' ) ) .
227 Html::hidden(
'wpEditToken', $wgUser->getEditToken( $this->oldimage ) ) .
231 <td class='mw-label'>" .
234 <td class='mw-input'>" .
236 'wpDeleteReasonList',
237 wfMessage(
'filedelete-reason-dropdown' )->inContentLanguage()->
text(),
238 wfMessage(
'filedelete-reason-otherlist' )->inContentLanguage()->
text(),
246 <td class='mw-label'>" .
249 <td class='mw-input'>" .
250 Xml::input(
'wpReason', 60, $wgRequest->getText(
'wpReason' ),
251 array(
'type' =>
'text',
'maxlength' =>
'255',
'tabindex' =>
'2',
'id' =>
'wpReason' ) ) .
259 <td class='mw-input'>" .
261 'wpWatch',
'wpWatch', $checkWatch,
array(
'tabindex' =>
'3' ) ) .
268 <td class='mw-submit'>" .
270 array(
'name' =>
'mw-filedelete-submit',
'id' =>
'mw-filedelete-submit',
'tabindex' =>
'4' ) ) .
277 if (
$wgUser->isAllowed(
'editinterface' ) ) {
281 wfMessage(
'filedelete-edit-reasonlist' )->escaped(),
283 array(
'action' =>
'edit' )
285 $form .=
'<p class="mw-filedelete-editreasons">' .
$link .
'</p>';
296 $deleteLogPage =
new LogPage(
'delete' );
297 $wgOut->addHTML(
'<h2>' . $deleteLogPage->getName()->escaped() .
"</h2>\n" );
311 if ( $this->oldimage ) {
313 "{$message}-old", # To ensure grep
will find them:
'filedelete-intro-old',
'filedelete-nofile-old',
'filedelete-success-old'
315 $wgLang->date( $this->getTimestamp(),
true ),
331 $wgOut->setPageTitle(
wfMessage(
'filedelete', $this->
title->getText() ) );
332 $wgOut->setRobotPolicy(
'noindex,nofollow' );
370 $q[
'action'] =
'delete';
372 if ( $this->oldimage ) {
376 return $this->
title->getLocalURL( $q );
385 return $this->oldfile->getTimestamp();
Show an error when the wiki is locked/read-only and the user tries to do something that requires writ...
static checkLabel( $label, $name, $id, $checked=false, $attribs=array())
Convenience function to build an HTML checkbox with a label.
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
static singleton()
Get a RepoGroup instance.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
static newMainPage()
Create a new Title for the Main Page.
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead $form
getPrefixedText()
Get the prefixed title with spaces.
wfReadOnly()
Check whether the wiki is in read-only mode.
static hidden( $name, $value, $attribs=array())
Convenience function to produce an input element with type=hidden.
Show an error when a user tries to do something they do not have the necessary permissions for.
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting & $link
static openElement( $element, $attribs=null)
This opens an XML element.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
exists()
Returns true if file exists in the repository.
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
to move a page</td >< td > &*You are moving the page across *A non empty talk page already exists under the new or *You uncheck the box below In those you will have to move or merge the page manually if desired</td >< td > be sure to &You are responsible for making sure that links continue to point where they are supposed to go Note that the page will &a page at the new title
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going and make changes or fix bugs In we can take all the code that deals with the little used title reversing we can concentrate it all in an extension file
Implements some public methods and some protected utility functions which are required by multiple ch...
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
Class to simplify the use of log pages.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form externallinks including delete and has completed for all link tables default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
static doWatchOrUnwatch( $watch, Title $title, User $user)
Watch or unwatch a page.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
</td >< td > &</td >< td > t want your writing to be edited mercilessly and redistributed at will
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
delete( $reason, $suppress=false)
Delete all versions of the file.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
getTitle()
Return the associated title object.
Represents a title within MediaWiki.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
static closeElement( $element)
Shortcut to close an XML element.
static listDropDown( $name='', $list='', $other='', $selected='', $class='', $tabindex=null)
Build a drop-down box from a textual list.
isLocal()
Returns true if the file comes from the local file repository.
Class for creating log entries manually, for example to inject them into the database.
static submitButton( $value, $attribs=array())
Convenience function to build an HTML submit button.
static input( $name, $size=false, $value=false, $attribs=array())
Convenience function to build an HTML text input field.
usually copyright or history_copyright This message must be in HTML not wikitext $subpages will be ignored and the rest of subPageSubtitle() will run. 'SkinTemplateBuildNavUrlsNav_urlsAfterPermalink' whether MediaWiki currently thinks this is a CSS JS page Hooks may change this value to override the return value of Title::isCssOrJsPage(). 'TitleIsAlwaysKnown' whether MediaWiki currently thinks this page is known isMovable() always returns false. $title whether MediaWiki currently thinks this page is movable Hooks may change this value to override the return value of Title::isMovable(). 'TitleIsWikitextPage' whether MediaWiki currently thinks this is a wikitext page Hooks may change this value to override the return value of Title::isWikitextPage() 'TitleMove' use UploadVerification and UploadVerifyFile instead where the first element is the message key and the remaining elements are used as parameters to the message based on mime etc Preferred in most cases over UploadVerification object with all info about the upload string as detected by MediaWiki Handlers will typically only apply for specific mime types object & $error
static label( $label, $id, $attribs=array())
Convenience function to build an HTML form label.
An error page which can definitely be safely rendered using the OutputPage.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
static showLogExtract(&$out, $types=array(), $page='', $user='', $param=array())
Show log extract.
static newFatal( $message)
Factory function for fatal errors.