MediaWiki REL1_33
SpecialMostlinkedcategories.php
Go to the documentation of this file.
1<?php
30
37 function __construct( $name = 'Mostlinkedcategories' ) {
38 parent::__construct( $name );
39 }
40
41 function isSyndicated() {
42 return false;
43 }
44
45 public function getQueryInfo() {
46 return [
47 'tables' => [ 'category' ],
48 'fields' => [ 'title' => 'cat_title',
49 'namespace' => NS_CATEGORY,
50 'value' => 'cat_pages' ],
51 'conds' => [ 'cat_pages > 0' ],
52 ];
53 }
54
55 function sortDescending() {
56 return true;
57 }
58
65 function preprocessResults( $db, $res ) {
67 }
68
74 function formatResult( $skin, $result ) {
75 $nt = Title::makeTitleSafe( NS_CATEGORY, $result->title );
76 if ( !$nt ) {
77 return Html::element(
78 'span',
79 [ 'class' => 'mw-invalidtitle' ],
81 $this->getContext(),
83 $result->title )
84 );
85 }
86
87 $text = MediaWikiServices::getInstance()->getContentLanguage()
88 ->convert( htmlspecialchars( $nt->getText() ) );
89 $plink = $this->getLinkRenderer()->makeLink( $nt, new HtmlArmor( $text ) );
90 $nlinks = $this->msg( 'nmembers' )->numParams( $result->value )->escaped();
91
92 return $this->getLanguage()->specialList( $plink, $nlinks );
93 }
94
95 protected function getGroupName() {
96 return 'highuse';
97 }
98}
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
Marks HTML that shouldn't be escaped.
Definition HtmlArmor.php:28
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
Definition Linker.php:191
MediaWikiServices is the service locator for the application scope of MediaWiki.
A querypage to show categories ordered in descending order by the pages in them.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
__construct( $name='Mostlinkedcategories')
isSyndicated()
Sometime we don't want to build rss / atom feeds.
preprocessResults( $db, $res)
Fetch user page links and cache their existence.
sortDescending()
Override to sort by increasing values.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
Definition QueryPage.php:35
executeLBFromResultWrapper(IResultWrapper $res, $ns=null)
Creates a new LinkBatch object, adds all pages from the passed ResultWrapper (MUST include title and ...
getContext()
Gets the context this SpecialPage is executed in.
msg( $key)
Wrapper around wfMessage that sets the current context.
getLanguage()
Shortcut to get user's language.
$res
Definition database.txt:21
const NS_CATEGORY
Definition Defines.php:87
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:38
Result wrapper for grabbing data queried from an IDatabase object.