Localisation updates from http://translatewiki.net.
[mediawiki.git] / includes / actions / InfoAction.php
blobe3ea6fcc4a32b9556391df3b09863b09dec12de0
1 <?php
2 /**
3 * Displays information about a page.
5 * Copyright © 2011 Alexandre Emsenhuber
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 * @file
22 * @ingroup Actions
25 /**
26 * Displays information about a page.
28 * @ingroup Actions
30 class InfoAction extends FormlessAction {
31 /**
32 * Returns the name of the action this object responds to.
34 * @return string lowercase
36 public function getName() {
37 return 'info';
40 /**
41 * Whether this action can still be executed by a blocked user.
43 * @return bool
45 public function requiresUnblock() {
46 return false;
49 /**
50 * Whether this action requires the wiki not to be locked.
52 * @return bool
54 public function requiresWrite() {
55 return false;
58 /**
59 * Clear the info cache for a given Title.
61 * @since 1.22
62 * @param Title $title Title to clear cache for
64 public static function invalidateCache( Title $title ) {
65 global $wgMemc;
66 // Clear page info.
67 $revision = WikiPage::factory( $title )->getRevision();
68 if ( $revision !== null ) {
69 $key = wfMemcKey( 'infoaction', sha1( $title->getPrefixedText() ), $revision->getId() );
70 $wgMemc->delete( $key );
74 /**
75 * Shows page information on GET request.
77 * @return string Page information that will be added to the output
79 public function onView() {
80 $content = '';
82 // Validate revision
83 $oldid = $this->page->getOldID();
84 if ( $oldid ) {
85 $revision = $this->page->getRevisionFetched();
87 // Revision is missing
88 if ( $revision === null ) {
89 return $this->msg( 'missing-revision', $oldid )->parse();
92 // Revision is not current
93 if ( !$revision->isCurrent() ) {
94 return $this->msg( 'pageinfo-not-current' )->plain();
98 // Page header
99 if ( !$this->msg( 'pageinfo-header' )->isDisabled() ) {
100 $content .= $this->msg( 'pageinfo-header' )->parse();
103 // Hide "This page is a member of # hidden categories" explanation
104 $content .= Html::element( 'style', array(),
105 '.mw-hiddenCategoriesExplanation { display: none; }' ) . "\n";
107 // Hide "Templates used on this page" explanation
108 $content .= Html::element( 'style', array(),
109 '.mw-templatesUsedExplanation { display: none; }' ) . "\n";
111 // Get page information
112 $pageInfo = $this->pageInfo();
114 // Allow extensions to add additional information
115 wfRunHooks( 'InfoAction', array( $this->getContext(), &$pageInfo ) );
117 // Render page information
118 foreach ( $pageInfo as $header => $infoTable ) {
119 $content .= $this->makeHeader( $this->msg( "pageinfo-${header}" )->escaped() ) . "\n";
120 $table = "\n";
121 foreach ( $infoTable as $infoRow ) {
122 $name = ( $infoRow[0] instanceof Message ) ? $infoRow[0]->escaped() : $infoRow[0];
123 $value = ( $infoRow[1] instanceof Message ) ? $infoRow[1]->escaped() : $infoRow[1];
124 $table = $this->addRow( $table, $name, $value ) . "\n";
126 $content = $this->addTable( $content, $table ) . "\n";
129 // Page footer
130 if ( !$this->msg( 'pageinfo-footer' )->isDisabled() ) {
131 $content .= $this->msg( 'pageinfo-footer' )->parse();
134 // Page credits
135 /*if ( $this->page->exists() ) {
136 $content .= Html::rawElement( 'div', array( 'id' => 'mw-credits' ), $this->getContributors() );
139 return $content;
143 * Creates a header that can be added to the output.
145 * @param string $header The header text.
146 * @return string The HTML.
148 protected function makeHeader( $header ) {
149 $spanAttribs = array( 'class' => 'mw-headline', 'id' => Sanitizer::escapeId( $header ) );
150 return Html::rawElement( 'h2', array(), Html::element( 'span', $spanAttribs, $header ) );
154 * Adds a row to a table that will be added to the content.
156 * @param string $table The table that will be added to the content
157 * @param string $name The name of the row
158 * @param string $value The value of the row
159 * @return string The table with the row added
161 protected function addRow( $table, $name, $value ) {
162 return $table . Html::rawElement( 'tr', array(),
163 Html::rawElement( 'td', array( 'style' => 'vertical-align: top;' ), $name ) .
164 Html::rawElement( 'td', array(), $value )
169 * Adds a table to the content that will be added to the output.
171 * @param string $content The content that will be added to the output
172 * @param string $table The table
173 * @return string The content with the table added
175 protected function addTable( $content, $table ) {
176 return $content . Html::rawElement( 'table', array( 'class' => 'wikitable mw-page-info' ),
177 $table );
181 * Returns page information in an easily-manipulated format. Array keys are used so extensions
182 * may add additional information in arbitrary positions. Array values are arrays with one
183 * element to be rendered as a header, arrays with two elements to be rendered as a table row.
185 * @return array
187 protected function pageInfo() {
188 global $wgContLang, $wgRCMaxAge, $wgMemc,
189 $wgUnwatchedPageThreshold, $wgPageInfoTransclusionLimit;
191 $user = $this->getUser();
192 $lang = $this->getLanguage();
193 $title = $this->getTitle();
194 $id = $title->getArticleID();
196 $memcKey = wfMemcKey( 'infoaction',
197 sha1( $title->getPrefixedText() ), $this->page->getLatest() );
198 $pageCounts = $wgMemc->get( $memcKey );
199 if ( $pageCounts === false ) {
200 // Get page information that would be too "expensive" to retrieve by normal means
201 $pageCounts = self::pageCounts( $title );
203 $wgMemc->set( $memcKey, $pageCounts );
206 // Get page properties
207 $dbr = wfGetDB( DB_SLAVE );
208 $result = $dbr->select(
209 'page_props',
210 array( 'pp_propname', 'pp_value' ),
211 array( 'pp_page' => $id ),
212 __METHOD__
215 $pageProperties = array();
216 foreach ( $result as $row ) {
217 $pageProperties[$row->pp_propname] = $row->pp_value;
220 // Basic information
221 $pageInfo = array();
222 $pageInfo['header-basic'] = array();
224 // Display title
225 $displayTitle = $title->getPrefixedText();
226 if ( !empty( $pageProperties['displaytitle'] ) ) {
227 $displayTitle = $pageProperties['displaytitle'];
230 $pageInfo['header-basic'][] = array(
231 $this->msg( 'pageinfo-display-title' ), $displayTitle
234 // Is it a redirect? If so, where to?
235 if ( $title->isRedirect() ) {
236 $pageInfo['header-basic'][] = array(
237 $this->msg( 'pageinfo-redirectsto' ),
238 Linker::link( $this->page->getRedirectTarget() ) .
239 $this->msg( 'word-separator' )->text() .
240 $this->msg( 'parentheses', Linker::link(
241 $this->page->getRedirectTarget(),
242 $this->msg( 'pageinfo-redirectsto-info' )->escaped(),
243 array(),
244 array( 'action' => 'info' )
245 ) )->text()
249 // Default sort key
250 $sortKey = $title->getCategorySortkey();
251 if ( !empty( $pageProperties['defaultsort'] ) ) {
252 $sortKey = $pageProperties['defaultsort'];
255 $pageInfo['header-basic'][] = array( $this->msg( 'pageinfo-default-sort' ), $sortKey );
257 // Page length (in bytes)
258 $pageInfo['header-basic'][] = array(
259 $this->msg( 'pageinfo-length' ), $lang->formatNum( $title->getLength() )
262 // Page ID (number not localised, as it's a database ID)
263 $pageInfo['header-basic'][] = array( $this->msg( 'pageinfo-article-id' ), $id );
265 // Language in which the page content is (supposed to be) written
266 $pageLang = $title->getPageLanguage()->getCode();
267 $pageInfo['header-basic'][] = array( $this->msg( 'pageinfo-language' ),
268 Language::fetchLanguageName( $pageLang, $lang->getCode() )
269 . ' ' . $this->msg( 'parentheses', $pageLang ) );
271 // Search engine status
272 $pOutput = new ParserOutput();
273 if ( isset( $pageProperties['noindex'] ) ) {
274 $pOutput->setIndexPolicy( 'noindex' );
277 // Use robot policy logic
278 $policy = $this->page->getRobotPolicy( 'view', $pOutput );
279 $pageInfo['header-basic'][] = array(
280 $this->msg( 'pageinfo-robot-policy' ), $this->msg( "pageinfo-robot-${policy['index']}" )
283 if ( isset( $pageCounts['views'] ) ) {
284 // Number of views
285 $pageInfo['header-basic'][] = array(
286 $this->msg( 'pageinfo-views' ), $lang->formatNum( $pageCounts['views'] )
290 if (
291 $user->isAllowed( 'unwatchedpages' ) ||
292 ( $wgUnwatchedPageThreshold !== false &&
293 $pageCounts['watchers'] >= $wgUnwatchedPageThreshold )
295 // Number of page watchers
296 $pageInfo['header-basic'][] = array(
297 $this->msg( 'pageinfo-watchers' ), $lang->formatNum( $pageCounts['watchers'] )
299 } elseif ( $wgUnwatchedPageThreshold !== false ) {
300 $pageInfo['header-basic'][] = array(
301 $this->msg( 'pageinfo-watchers' ),
302 $this->msg( 'pageinfo-few-watchers' )->numParams( $wgUnwatchedPageThreshold )
306 // Redirects to this page
307 $whatLinksHere = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedText() );
308 $pageInfo['header-basic'][] = array(
309 Linker::link(
310 $whatLinksHere,
311 $this->msg( 'pageinfo-redirects-name' )->escaped(),
312 array(),
313 array( 'hidelinks' => 1, 'hidetrans' => 1 )
315 $this->msg( 'pageinfo-redirects-value' )
316 ->numParams( count( $title->getRedirectsHere() ) )
319 // Is it counted as a content page?
320 if ( $this->page->isCountable() ) {
321 $pageInfo['header-basic'][] = array(
322 $this->msg( 'pageinfo-contentpage' ),
323 $this->msg( 'pageinfo-contentpage-yes' )
327 // Subpages of this page, if subpages are enabled for the current NS
328 if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) {
329 $prefixIndex = SpecialPage::getTitleFor( 'Prefixindex', $title->getPrefixedText() . '/' );
330 $pageInfo['header-basic'][] = array(
331 Linker::link( $prefixIndex, $this->msg( 'pageinfo-subpages-name' )->escaped() ),
332 $this->msg( 'pageinfo-subpages-value' )
333 ->numParams(
334 $pageCounts['subpages']['total'],
335 $pageCounts['subpages']['redirects'],
336 $pageCounts['subpages']['nonredirects'] )
340 if ( $title->inNamespace( NS_CATEGORY ) ) {
341 $category = Category::newFromTitle( $title );
342 $pageInfo['category-info'] = array(
343 array(
344 $this->msg( 'pageinfo-category-pages' ),
345 $lang->formatNum( $category->getPageCount() )
347 array(
348 $this->msg( 'pageinfo-category-subcats' ),
349 $lang->formatNum( $category->getSubcatCount() )
351 array(
352 $this->msg( 'pageinfo-category-files' ),
353 $lang->formatNum( $category->getFileCount() )
358 // Page protection
359 $pageInfo['header-restrictions'] = array();
361 // Is this page effected by the cascading protection of something which includes it?
362 if ( $title->isCascadeProtected() ) {
363 $cascadingFrom = '';
364 $sources = $title->getCascadeProtectionSources(); // Array deferencing is in PHP 5.4 :(
366 foreach ( $sources[0] as $sourceTitle ) {
367 $cascadingFrom .= Html::rawElement( 'li', array(), Linker::linkKnown( $sourceTitle ) );
370 $cascadingFrom = Html::rawElement( 'ul', array(), $cascadingFrom );
371 $pageInfo['header-restrictions'][] = array(
372 $this->msg( 'pageinfo-protect-cascading-from' ),
373 $cascadingFrom
377 // Is out protection set to cascade to other pages?
378 if ( $title->areRestrictionsCascading() ) {
379 $pageInfo['header-restrictions'][] = array(
380 $this->msg( 'pageinfo-protect-cascading' ),
381 $this->msg( 'pageinfo-protect-cascading-yes' )
385 // Page protection
386 foreach ( $title->getRestrictionTypes() as $restrictionType ) {
387 $protectionLevel = implode( ', ', $title->getRestrictions( $restrictionType ) );
389 if ( $protectionLevel == '' ) {
390 // Allow all users
391 $message = $this->msg( 'protect-default' )->escaped();
392 } else {
393 // Administrators only
394 $message = $this->msg( "protect-level-$protectionLevel" );
395 if ( $message->isDisabled() ) {
396 // Require "$1" permission
397 $message = $this->msg( "protect-fallback", $protectionLevel )->parse();
398 } else {
399 $message = $message->escaped();
403 $pageInfo['header-restrictions'][] = array(
404 $this->msg( "restriction-$restrictionType" ), $message
408 if ( !$this->page->exists() ) {
409 return $pageInfo;
412 // Edit history
413 $pageInfo['header-edits'] = array();
415 $firstRev = $this->page->getOldestRevision();
416 $lastRev = $this->page->getRevision();
417 $batch = new LinkBatch;
419 if ( $firstRev ) {
420 $firstRevUser = $firstRev->getUserText( Revision::FOR_THIS_USER );
421 if ( $firstRevUser !== '' ) {
422 $batch->add( NS_USER, $firstRevUser );
423 $batch->add( NS_USER_TALK, $firstRevUser );
427 if ( $lastRev ) {
428 $lastRevUser = $lastRev->getUserText( Revision::FOR_THIS_USER );
429 if ( $lastRevUser !== '' ) {
430 $batch->add( NS_USER, $lastRevUser );
431 $batch->add( NS_USER_TALK, $lastRevUser );
435 $batch->execute();
437 if ( $firstRev ) {
438 // Page creator
439 $pageInfo['header-edits'][] = array(
440 $this->msg( 'pageinfo-firstuser' ),
441 Linker::revUserTools( $firstRev )
444 // Date of page creation
445 $pageInfo['header-edits'][] = array(
446 $this->msg( 'pageinfo-firsttime' ),
447 Linker::linkKnown(
448 $title,
449 $lang->userTimeAndDate( $firstRev->getTimestamp(), $user ),
450 array(),
451 array( 'oldid' => $firstRev->getId() )
456 if ( $lastRev ) {
457 // Latest editor
458 $pageInfo['header-edits'][] = array(
459 $this->msg( 'pageinfo-lastuser' ),
460 Linker::revUserTools( $lastRev )
463 // Date of latest edit
464 $pageInfo['header-edits'][] = array(
465 $this->msg( 'pageinfo-lasttime' ),
466 Linker::linkKnown(
467 $title,
468 $lang->userTimeAndDate( $this->page->getTimestamp(), $user ),
469 array(),
470 array( 'oldid' => $this->page->getLatest() )
475 // Total number of edits
476 $pageInfo['header-edits'][] = array(
477 $this->msg( 'pageinfo-edits' ), $lang->formatNum( $pageCounts['edits'] )
480 // Total number of distinct authors
481 $pageInfo['header-edits'][] = array(
482 $this->msg( 'pageinfo-authors' ), $lang->formatNum( $pageCounts['authors'] )
485 // Recent number of edits (within past 30 days)
486 $pageInfo['header-edits'][] = array(
487 $this->msg( 'pageinfo-recent-edits', $lang->formatDuration( $wgRCMaxAge ) ),
488 $lang->formatNum( $pageCounts['recent_edits'] )
491 // Recent number of distinct authors
492 $pageInfo['header-edits'][] = array(
493 $this->msg( 'pageinfo-recent-authors' ), $lang->formatNum( $pageCounts['recent_authors'] )
496 // Array of MagicWord objects
497 $magicWords = MagicWord::getDoubleUnderscoreArray();
499 // Array of magic word IDs
500 $wordIDs = $magicWords->names;
502 // Array of IDs => localized magic words
503 $localizedWords = $wgContLang->getMagicWords();
505 $listItems = array();
506 foreach ( $pageProperties as $property => $value ) {
507 if ( in_array( $property, $wordIDs ) ) {
508 $listItems[] = Html::element( 'li', array(), $localizedWords[$property][1] );
512 $localizedList = Html::rawElement( 'ul', array(), implode( '', $listItems ) );
513 $hiddenCategories = $this->page->getHiddenCategories();
515 if (
516 count( $listItems ) > 0 ||
517 count( $hiddenCategories ) > 0 ||
518 $pageCounts['transclusion']['from'] > 0 ||
519 $pageCounts['transclusion']['to'] > 0
521 $options = array( 'LIMIT' => $wgPageInfoTransclusionLimit );
522 $transcludedTemplates = $title->getTemplateLinksFrom( $options );
523 $transcludedTargets = $title->getTemplateLinksTo( $options );
525 // Page properties
526 $pageInfo['header-properties'] = array();
528 // Magic words
529 if ( count( $listItems ) > 0 ) {
530 $pageInfo['header-properties'][] = array(
531 $this->msg( 'pageinfo-magic-words' )->numParams( count( $listItems ) ),
532 $localizedList
536 // Hidden categories
537 if ( count( $hiddenCategories ) > 0 ) {
538 $pageInfo['header-properties'][] = array(
539 $this->msg( 'pageinfo-hidden-categories' )
540 ->numParams( count( $hiddenCategories ) ),
541 Linker::formatHiddenCategories( $hiddenCategories )
545 // Transcluded templates
546 if ( $pageCounts['transclusion']['from'] > 0 ) {
547 if ( $pageCounts['transclusion']['from'] > count( $transcludedTemplates ) ) {
548 $more = $this->msg( 'morenotlisted' )->escaped();
549 } else {
550 $more = null;
553 $pageInfo['header-properties'][] = array(
554 $this->msg( 'pageinfo-templates' )
555 ->numParams( $pageCounts['transclusion']['from'] ),
556 Linker::formatTemplates(
557 $transcludedTemplates,
558 false,
559 false,
560 $more )
564 if ( $pageCounts['transclusion']['to'] > 0 ) {
565 if ( $pageCounts['transclusion']['to'] > count( $transcludedTargets ) ) {
566 $more = Linker::link(
567 $whatLinksHere,
568 $this->msg( 'moredotdotdot' )->escaped(),
569 array(),
570 array( 'hidelinks' => 1, 'hideredirs' => 1 )
572 } else {
573 $more = null;
576 $pageInfo['header-properties'][] = array(
577 $this->msg( 'pageinfo-transclusions' )
578 ->numParams( $pageCounts['transclusion']['to'] ),
579 Linker::formatTemplates(
580 $transcludedTargets,
581 false,
582 false,
583 $more )
588 return $pageInfo;
592 * Returns page counts that would be too "expensive" to retrieve by normal means.
594 * @param Title $title Title to get counts for
595 * @return array
597 protected static function pageCounts( Title $title ) {
598 global $wgRCMaxAge, $wgDisableCounters;
600 wfProfileIn( __METHOD__ );
601 $id = $title->getArticleID();
603 $dbr = wfGetDB( DB_SLAVE );
604 $result = array();
606 if ( !$wgDisableCounters ) {
607 // Number of views
608 $views = (int) $dbr->selectField(
609 'page',
610 'page_counter',
611 array( 'page_id' => $id ),
612 __METHOD__
614 $result['views'] = $views;
617 // Number of page watchers
618 $watchers = (int) $dbr->selectField(
619 'watchlist',
620 'COUNT(*)',
621 array(
622 'wl_namespace' => $title->getNamespace(),
623 'wl_title' => $title->getDBkey(),
625 __METHOD__
627 $result['watchers'] = $watchers;
629 // Total number of edits
630 $edits = (int) $dbr->selectField(
631 'revision',
632 'COUNT(rev_page)',
633 array( 'rev_page' => $id ),
634 __METHOD__
636 $result['edits'] = $edits;
638 // Total number of distinct authors
639 $authors = (int) $dbr->selectField(
640 'revision',
641 'COUNT(DISTINCT rev_user_text)',
642 array( 'rev_page' => $id ),
643 __METHOD__
645 $result['authors'] = $authors;
647 // "Recent" threshold defined by $wgRCMaxAge
648 $threshold = $dbr->timestamp( time() - $wgRCMaxAge );
650 // Recent number of edits
651 $edits = (int) $dbr->selectField(
652 'revision',
653 'COUNT(rev_page)',
654 array(
655 'rev_page' => $id,
656 "rev_timestamp >= " . $dbr->addQuotes( $threshold )
658 __METHOD__
660 $result['recent_edits'] = $edits;
662 // Recent number of distinct authors
663 $authors = (int) $dbr->selectField(
664 'revision',
665 'COUNT(DISTINCT rev_user_text)',
666 array(
667 'rev_page' => $id,
668 "rev_timestamp >= " . $dbr->addQuotes( $threshold )
670 __METHOD__
672 $result['recent_authors'] = $authors;
674 // Subpages (if enabled)
675 if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) {
676 $conds = array( 'page_namespace' => $title->getNamespace() );
677 $conds[] = 'page_title ' . $dbr->buildLike( $title->getDBkey() . '/', $dbr->anyString() );
679 // Subpages of this page (redirects)
680 $conds['page_is_redirect'] = 1;
681 $result['subpages']['redirects'] = (int) $dbr->selectField(
682 'page',
683 'COUNT(page_id)',
684 $conds,
685 __METHOD__ );
687 // Subpages of this page (non-redirects)
688 $conds['page_is_redirect'] = 0;
689 $result['subpages']['nonredirects'] = (int) $dbr->selectField(
690 'page',
691 'COUNT(page_id)',
692 $conds,
693 __METHOD__
696 // Subpages of this page (total)
697 $result['subpages']['total'] = $result['subpages']['redirects']
698 + $result['subpages']['nonredirects'];
701 // Counts for the number of transclusion links (to/from)
702 $result['transclusion']['to'] = (int) $dbr->selectField(
703 'templatelinks',
704 'COUNT(tl_from)',
705 array(
706 'tl_namespace' => $title->getNamespace(),
707 'tl_title' => $title->getDBkey()
709 __METHOD__
712 $result['transclusion']['from'] = (int) $dbr->selectField(
713 'templatelinks',
714 'COUNT(*)',
715 array( 'tl_from' => $title->getArticleID() ),
716 __METHOD__
719 wfProfileOut( __METHOD__ );
720 return $result;
724 * Returns the name that goes in the "<h1>" page title.
726 * @return string
728 protected function getPageTitle() {
729 return $this->msg( 'pageinfo-title', $this->getTitle()->getPrefixedText() )->text();
733 * Get a list of contributors of $article
734 * @return string: html
736 protected function getContributors() {
737 global $wgHiddenPrefs;
739 $contributors = $this->page->getContributors();
740 $real_names = array();
741 $user_names = array();
742 $anon_ips = array();
744 # Sift for real versus user names
745 foreach ( $contributors as $user ) {
746 $page = $user->isAnon()
747 ? SpecialPage::getTitleFor( 'Contributions', $user->getName() )
748 : $user->getUserPage();
750 if ( $user->getID() == 0 ) {
751 $anon_ips[] = Linker::link( $page, htmlspecialchars( $user->getName() ) );
752 } elseif ( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() ) {
753 $real_names[] = Linker::link( $page, htmlspecialchars( $user->getRealName() ) );
754 } else {
755 $user_names[] = Linker::link( $page, htmlspecialchars( $user->getName() ) );
759 $lang = $this->getLanguage();
761 $real = $lang->listToText( $real_names );
763 # "ThisSite user(s) A, B and C"
764 if ( count( $user_names ) ) {
765 $user = $this->msg( 'siteusers' )->rawParams( $lang->listToText( $user_names ) )->params(
766 count( $user_names ) )->escaped();
767 } else {
768 $user = false;
771 if ( count( $anon_ips ) ) {
772 $anon = $this->msg( 'anonusers' )->rawParams( $lang->listToText( $anon_ips ) )->params(
773 count( $anon_ips ) )->escaped();
774 } else {
775 $anon = false;
778 # This is the big list, all mooshed together. We sift for blank strings
779 $fulllist = array();
780 foreach ( array( $real, $user, $anon ) as $s ) {
781 if ( $s !== '' ) {
782 array_push( $fulllist, $s );
786 $count = count( $fulllist );
787 # "Based on work by ..."
788 return $count
789 ? $this->msg( 'othercontribs' )->rawParams(
790 $lang->listToText( $fulllist ) )->params( $count )->escaped()
791 : '';
795 * Returns the description that goes below the "<h1>" tag.
797 * @return string
799 protected function getDescription() {
800 return '';