Go to the documentation of this file.
38 return $this->
msg(
'creditspage' )->escaped();
47 if ( $this->
page->getID() == 0 ) {
48 $s = $this->
msg(
'nocredits' )->parse();
68 if ( $cnt > 1 || $cnt < 0 ) {
84 $timestamp =
$page->getTimestamp();
94 return $this->
msg(
'lastmodifiedatby', $d,
$t )->rawParams(
105 $hiddenPrefs = $this->context->getConfig()->get(
'HiddenPrefs' );
106 return !in_array(
'realname', $hiddenPrefs );
118 $others_link =
false;
120 # Hmm... too many to fit!
124 return $this->
msg(
'othercontribs' )->rawParams(
133 # Sift for real versus user names
137 if (
$user->isLoggedIn() ) {
140 $real_names[] =
$link;
142 $user_names[] =
$link;
145 $anon_ips[] = $this->
link( $user );
155 if (
count( $real_names ) ) {
156 $real =
$lang->listToText( $real_names );
161 # "ThisSite user(s) A, B and C"
162 if (
count( $user_names ) ) {
163 $user = $this->
msg(
'siteusers' )->rawParams(
$lang->listToText( $user_names ) )->params(
164 count( $user_names ) )->escaped();
169 if (
count( $anon_ips ) ) {
170 $anon = $this->
msg(
'anonusers' )->rawParams(
$lang->listToText( $anon_ips ) )->params(
171 count( $anon_ips ) )->escaped();
176 # This is the big list, all mooshed together. We sift for blank strings
178 foreach ( [ $real,
$user, $anon, $others_link ]
as $s ) {
179 if (
$s !==
false ) {
180 array_push( $fulllist,
$s );
184 $count =
count( $fulllist );
186 # "Based on work by ..."
188 ? $this->
msg(
'othercontribs' )->rawParams(
189 $lang->listToText( $fulllist ) )->params( $count )->escaped()
200 $real =
$user->getRealName();
202 $real =
$user->getName();
207 :
$user->getUserPage();
209 return MediaWikiServices::getInstance()
210 ->getLinkRenderer()->makeLink(
$page, $real );
220 if (
$user->isAnon() ) {
221 return $this->
msg(
'anonuser' )->rawParams(
$link )->parse();
226 return $this->
msg(
'siteuser' )->rawParams(
$link )->params( $user->
getName() )->escaped();
236 return MediaWikiServices::getInstance()->getLinkRenderer()->makeKnownLink(
238 $this->
msg(
'others' )->
text(),
240 [
'action' =>
'credits' ]
canShowRealUserName()
Whether we can display the user's real name (not a hidden pref)
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
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
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.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
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.
$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.