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();
87 $d =
$lang->date( $page->getTimestamp(),
true );
88 $t =
$lang->time( $page->getTimestamp(),
true );
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() ) {
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 ) {
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();
201 if ( $real ===
'' ) {
202 $real = $user->getName();
205 $real = $user->getName();
208 $page = $user->isAnon()
209 ? SpecialPage::getTitleFor(
'Contributions', $user->getName() )
210 : $user->getUserPage();
212 return MediaWikiServices::getInstance()
213 ->getLinkRenderer()->makeLink( $page, $real );
223 if ( $user->isAnon() ) {
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' ]
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
getTitle()
Shortcut to get the Title object from the page.
msg( $key)
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.
getAuthor(Page $page)
Get the last author with the last modification time.
canShowRealUserName()
Whether we can display the user's real name (not a hidden pref)
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.
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.
isAnon()
Get whether the user is anonymous.
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template to be included in the link
usually copyright or history_copyright This message must be in HTML not wikitext & $link
Interface for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage)
if(!isset( $args[0])) $lang