60 $this->showThumb = $wgShowArchiveThumbnails && $this->img->canRender();
85 .
"<div id=\"mw-imagepage-section-filehistory\">\n"
86 . $this->
msg(
'filehist-help' )->parseAsBlock()
90 . ( $this->current->isLocal()
91 && ( $this->
getUser()->isAllowedAny(
'delete',
'deletedhistory' ) ) ?
'<th></th>' :
'' )
92 .
'<th>' . $this->
msg(
'filehist-datetime' )->escaped() .
'</th>'
93 . ( $this->showThumb ?
'<th>' . $this->
msg(
'filehist-thumb' )->escaped() .
'</th>' :
'' )
94 .
'<th>' . $this->
msg(
'filehist-dimensions' )->escaped() .
'</th>'
95 .
'<th>' . $this->
msg(
'filehist-user' )->escaped() .
'</th>'
96 .
'<th>' . $this->
msg(
'filehist-comment' )->escaped() .
'</th>'
105 return "</table>\n$navLinks\n</div>\n";
119 $img = $iscur ? $file->
getName() : $file->getArchiveName();
120 $userId = $file->getUser(
'id' );
121 $userText = $file->getUser(
'text' );
124 $local = $this->current->isLocal();
125 $row = $selected =
'';
128 if ( $local && (
$user->isAllowedAny(
'delete',
'deletedhistory' ) ) ) {
130 # Link to remove from history
131 if (
$user->isAllowed(
'delete' ) ) {
132 $q = [
'action' =>
'delete' ];
134 $q[
'oldimage'] =
$img;
138 $this->
msg( $iscur ?
'filehist-deleteall' :
'filehist-deleteone' )->escaped(),
142 # Link to hide content. Don't show useless link to people who cannot hide revisions.
143 $canHide =
$user->isAllowed(
'deleterevision' );
144 if ( $canHide || (
$user->isAllowed(
'deletedhistory' ) && $file->getVisibility() ) ) {
145 if (
$user->isAllowed(
'delete' ) ) {
152 list( $ts, ) = explode(
'!', $img, 2 );
154 'type' =>
'oldimage',
155 'target' => $this->
title->getPrefixedText(),
169 $row .= $this->
msg(
'filehist-current' )->escaped();
170 } elseif ( $local && $this->
title->quickUserCan(
'edit',
$user )
171 && $this->
title->quickUserCan(
'upload',
$user )
174 $row .= $this->
msg(
'filehist-revert' )->escaped();
178 $this->
msg(
'filehist-revert' )->escaped(),
181 'action' =>
'revert',
190 if ( $file->getTimestamp() === $this->img->getTimestamp() ) {
191 $selected =
"class='filehistory-selected'";
193 $row .=
"<td $selected style='white-space: nowrap;'>";
195 # Don't link to unviewable files
196 $row .=
'<span class="history-deleted">'
202 # Make a link to review the image
208 'target' => $this->
title->getPrefixedText(),
210 'token' =>
$user->getEditToken( $img )
216 $row .=
'<span class="history-deleted">' . $url .
'</span>';
217 } elseif ( !$file->exists() ) {
218 $row .=
'<span class="mw-file-missing">'
221 $url = $iscur ? $this->current->getUrl() : $this->current->getArchiveUrl( $img );
231 if ( $this->showThumb ) {
237 $row .= htmlspecialchars( $file->getDimensionsString() );
238 $row .= $this->
msg(
'word-separator' )->escaped();
239 $row .=
'<span style="white-space: nowrap;">';
240 $row .= $this->
msg(
'parentheses' )->sizeParams( $file->getSize() )->escaped();
248 $row .=
'<span class="history-deleted">'
249 . $this->
msg(
'rev-deleted-user' )->escaped() .
'</span>';
253 $row .=
'<span style="white-space: nowrap;">';
257 $row .= htmlspecialchars( $userText );
264 $row .=
'<td><span class="history-deleted">' .
265 $this->
msg(
'rev-deleted-comment' )->escaped() .
'</span></td>';
267 $row .=
'<td dir="' . $wgContLang->getDir() .
'">' .
272 Hooks::run(
'ImagePageFileHistoryLine', [ $this, $file, &$row, &$rowClass ] );
273 $classAttr = $rowClass ?
" class='$rowClass'" :
'';
275 return "<tr{$classAttr}>{$row}</tr>\n";
294 $thumbnail = $file->transform(
$params );
296 'alt' => $this->
msg(
'filehist-thumbtext',
304 return $this->
msg(
'filehist-nothumb' )->escaped();
307 return $thumbnail->toHtml(
$options );
309 return $this->
msg(
'filehist-nothumb' )->escaped();
setContext(IContextSource $context)
Set the IContextSource object.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
getLanguage()
Get the Language object.
static element($element, $attribs=null, $contents= '', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
static getTitleFor($name, $subpage=false, $fragment= '')
Get a localised Title object for a specified special page name If you don't need a full Title object...
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
getPage()
Get the WikiPage object of this instance.
if(!isset($args[0])) $lang
getName()
Return the name of this file.
when a variable name is used in a it is silently declared as a new local masking the global
Builds the image revision log shown on image pages.
endImageHistoryList($navLinks= '')
getContext()
Gets the context this Article is executed in.
wfTimestamp($outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
beginImageHistoryList($navLinks= '')
msg()
Get a Message object with context set Parameters are the same as wfMessage()
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
static openElement($element, $attribs=null)
This opens an XML element.
getTitle()
Get the title object of the article.
static revDeleteLinkDisabled($delete=true)
Creates a dead (show/hide) link for deleting revisions/log entries.
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
preventClickjacking($enable=true)
static linkKnown($target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
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 formatComment($comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
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 local account $user
static userLink($userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
static userToolLinks($userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
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 and the local content language as $wgContLang
imageHistoryLine($iscur, $file)
$wgShowArchiveThumbnails
Show thumbnails for old images on the image description page.
getUser()
Get the User object.
static revDeleteLink($query=[], $restricted=false, $delete=true)
Creates a (show/hide) link for deleting revisions/log entries.