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();
53 return Html::rawElement(
'div', [
'id' =>
'mw-credits' ],
$s );
68 if ( $cnt > 1 || $cnt < 0 ) {
84 $timestamp =
$page->getTimestamp();
94 return $this->
msg(
'lastmodifiedatby', $d,
$t )->rawParams(
95 $this->
userLink( $user ) )->params( $user->getName() )->escaped();
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() ) {
138 $link = $this->
link( $user );
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()
201 if ( $real ===
'' ) {
212 return MediaWikiServices::getInstance()
213 ->getLinkRenderer()->makeLink(
$page, $real );
222 $link = $this->
link( $user );
224 return $this->
msg(
'anonuser' )->rawParams( $link )->parse();
228 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)
isAnon()
Get whether the user is anonymous.
if(!isset( $args[0])) $lang
getName()
Return the name of the action this object responds to.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
getUserPage()
Get this user's personal page title.
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,...
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.
$page
Page on which we're performing the action.
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.
getContributors( $cnt, $showIfMax)
Get a list of contributors of $article.
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.