36 return $this->
msg(
'creditspage' )->escaped();
46 if ( $this->
page->getID() == 0 ) {
47 $s = $this->
msg(
'nocredits' )->parse();
67 if ( $cnt > 1 || $cnt < 0 ) {
86 $d =
$lang->date( $page->getTimestamp(),
true );
93 return $this->
msg(
'lastmodifiedatby', $d,
$t )->rawParams(
104 $hiddenPrefs = $this->context->getConfig()->get(
'HiddenPrefs' );
105 return !in_array(
'realname', $hiddenPrefs );
117 $others_link =
false;
119 # Hmm... too many to fit!
123 return $this->
msg(
'othercontribs' )->rawParams(
132 # Sift for real versus user names
136 if ( $user->isLoggedIn() ) {
139 $real_names[] =
$link;
141 $user_names[] =
$link;
144 $anon_ips[] = $this->
link( $user );
154 if ( count( $real_names ) ) {
155 $real =
$lang->listToText( $real_names );
160 # "ThisSite user(s) A, B and C"
161 if ( count( $user_names ) ) {
162 $user = $this->
msg(
'siteusers' )->rawParams(
$lang->listToText( $user_names ) )->params(
163 count( $user_names ) )->escaped();
168 if ( count( $anon_ips ) ) {
169 $anon = $this->
msg(
'anonusers' )->rawParams(
$lang->listToText( $anon_ips ) )->params(
170 count( $anon_ips ) )->escaped();
175 # This is the big list, all mooshed together. We sift for blank strings
177 foreach ( [ $real, $user, $anon, $others_link ]
as $s ) {
178 if ( $s !==
false ) {
179 array_push( $fulllist, $s );
183 $count = count( $fulllist );
185 # "Based on work by ..."
187 ? $this->
msg(
'othercontribs' )->rawParams(
188 $lang->listToText( $fulllist ) )->params(
$count )->escaped()
219 return $this->
msg(
'anonuser' )->rawParams(
$link )->parse();
224 return $this->
msg(
'siteuser' )->rawParams(
$link )->params( $user->
getName() )->escaped();
236 $this->
msg(
'others' )->escaped(),
238 [
'action' =>
'credits' ]
static newFromName($name, $validate= 'valid')
Static factory method for creation from username.
processing should stop and the error should be shown to the user * false
getTitle()
Shortcut to get the Title object from the page.
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...
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
if(!isset($args[0])) $lang
getRealName()
Get the user's real name.
getLanguage()
Shortcut to get the user Language being used for this instance.
getAuthor(Page $page)
Get the last author with the last modification time.
userLink(User $user)
Get a link to $user's user page.
canShowRealUserName()
Whether we can display the user's real name (not a hidden pref)
getName()
Get the user name, or the IP of an anonymous user.
getCredits($cnt, $showIfMax=true)
Get a list of contributors.
link(User $user)
Get a link to $user's user page.
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
Interface for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage)
onView()
This is largely cadged from PageHistory::history.
isAnon()
Get whether the user is anonymous.
static linkKnown($target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
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
$page
Page on which we're performing the action.
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 link($target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
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 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
getUserPage()
Get this user's personal page title.
othersLink()
Get a link to action=credits of $article page.
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 one of or reset my talk page