38 return $this->
msg(
'creditspage' )->escaped();
48 $s = $this->
msg(
'nocredits' )->parse();
53 return Html::rawElement(
'div', [
'id' =>
'mw-credits' ],
$s );
68 if ( $cnt > 1 || $cnt < 0 ) {
95 return $this->
msg(
'lastmodifiedatby', $d,
$t )->rawParams(
96 $this->
userLink( $user ) )->params( $user->getName() )->escaped();
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() ) {
139 $link = $this->
link( $user );
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()
202 if ( $real ===
'' ) {
213 return MediaWikiServices::getInstance()
214 ->getLinkRenderer()->makeLink(
$page, $real );
223 $link = $this->
link( $user );
225 return $this->
msg(
'anonuser' )->rawParams( $link )->parse();
229 return $this->
msg(
'siteuser' )->rawParams( $link )->params( $user->
getName() )->escaped();
238 return MediaWikiServices::getInstance()->getLinkRenderer()->makeKnownLink(
240 $this->
msg(
'others' )->text(),
242 [
'action' =>
'credits' ]
getWikiPage()
Get a WikiPage object.
WikiPage Article ImagePage CategoryPage Page $page
Page on which we're performing the action.
getTitle()
Shortcut to get the Title object from the page.
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
getLanguage()
Shortcut to get the user Language being used for this instance.
getCredits( $cnt, $showIfMax=true)
Get a list of contributors.
getName()
Return the name of the action this object responds to.
getContributors( $cnt, $showIfMax)
Get a list of contributors of $article.
canShowRealUserName()
Whether we can display the user's real name (not a hidden pref)
getAuthor()
Get the last author with the last modification time.
othersLink()
Get a link to action=credits of $article page.
getDescription()
Returns the description that goes below the <h1> tag.
link(User $user)
Get a link to $user's user page.
onView()
This is largely cadged from PageHistory::history.
userLink(User $user)
Get a link to $user's user 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,...
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.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
getRealName()
Get the user's real name.
getUserPage()
Get this user's personal page title.
isAnon()
Get whether the user is anonymous.
getUserText( $audience=RevisionRecord::FOR_PUBLIC, User $user=null)
if(!isset( $args[0])) $lang