Go to the documentation of this file.
38 return $this->
msg(
'creditspage' )->escaped();
48 if ( $this->
page->getID() == 0 ) {
49 $s = $this->
msg(
'nocredits' )->parse();
69 if ( $cnt > 1 || $cnt < 0 ) {
85 $timestamp =
$page->getTimestamp();
95 return $this->
msg(
'lastmodifiedatby', $d,
$t )->rawParams(
106 $hiddenPrefs = $this->context->getConfig()->get(
'HiddenPrefs' );
107 return !in_array(
'realname', $hiddenPrefs );
119 $others_link =
false;
121 # Hmm... too many to fit!
125 return $this->
msg(
'othercontribs' )->rawParams(
134 # Sift for real versus user names
138 if (
$user->isLoggedIn() ) {
141 $real_names[] =
$link;
143 $user_names[] =
$link;
146 $anon_ips[] = $this->
link( $user );
156 if (
count( $real_names ) ) {
157 $real =
$lang->listToText( $real_names );
162 # "ThisSite user(s) A, B and C"
163 if (
count( $user_names ) ) {
164 $user = $this->
msg(
'siteusers' )->rawParams(
$lang->listToText( $user_names ) )->params(
165 count( $user_names ) )->escaped();
170 if (
count( $anon_ips ) ) {
171 $anon = $this->
msg(
'anonusers' )->rawParams(
$lang->listToText( $anon_ips ) )->params(
172 count( $anon_ips ) )->escaped();
177 # This is the big list, all mooshed together. We sift for blank strings
179 foreach ( [ $real,
$user, $anon, $others_link ]
as $s ) {
180 if (
$s !==
false ) {
181 array_push( $fulllist,
$s );
185 $count =
count( $fulllist );
187 # "Based on work by ..."
189 ? $this->
msg(
'othercontribs' )->rawParams(
190 $lang->listToText( $fulllist ) )->params( $count )->escaped()
201 $real =
$user->getRealName();
203 $real =
$user->getName();
208 :
$user->getUserPage();
210 return MediaWikiServices::getInstance()
211 ->getLinkRenderer()->makeLink(
$page, $real );
221 if (
$user->isAnon() ) {
222 return $this->
msg(
'anonuser' )->rawParams(
$link )->parse();
227 return $this->
msg(
'siteuser' )->rawParams(
$link )->params( $user->
getName() )->escaped();
237 return MediaWikiServices::getInstance()->getLinkRenderer()->makeKnownLink(
239 $this->
msg(
'others' )->
text(),
241 [
'action' =>
'credits' ]
canShowRealUserName()
Whether we can display the user's real name (not a hidden pref)
Interface for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage)
processing should stop and the error should be shown to the user * false
isAnon()
Get whether the user is anonymous.
if(!isset( $args[0])) $lang
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
getName()
Return the name of the action this object responds to.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
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
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
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,...
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
getAuthor(Page $page)
Get the last author with the last modification time.
othersLink()
Get a link to action=credits of $article page.
getCredits( $cnt, $showIfMax=true)
Get a list of contributors.
link(User $user)
Get a link to $user's user page.
getDescription()
Returns the description that goes below the <h1> tag.
getRealName()
Get the user's real name.
getTitle()
Shortcut to get the Title object from the page.
onView()
This is largely cadged from PageHistory::history.
msg()
Get a Message object with context set Parameters are the same as wfMessage()
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached my talk page
$page
Page on which we're performing the action.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
getLanguage()
Shortcut to get the user Language being used for this instance.
usually copyright or history_copyright This message must be in HTML not wikitext & $link
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
getContributors( $cnt, $showIfMax)
Get a list of contributors of $article.
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 MediaWikiServices
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
getName()
Get the user name, or the IP of an anonymous user.
userLink(User $user)
Get a link to $user's user page.