MediaWiki REL1_31
SpecialMostlinkedcategories.php
Go to the documentation of this file.
1<?php
29
36 function __construct( $name = 'Mostlinkedcategories' ) {
37 parent::__construct( $name );
38 }
39
40 function isSyndicated() {
41 return false;
42 }
43
44 public function getQueryInfo() {
45 return [
46 'tables' => [ 'category' ],
47 'fields' => [ 'title' => 'cat_title',
48 'namespace' => NS_CATEGORY,
49 'value' => 'cat_pages' ],
50 'conds' => [ 'cat_pages > 0' ],
51 ];
52 }
53
54 function sortDescending() {
55 return true;
56 }
57
64 function preprocessResults( $db, $res ) {
66 }
67
73 function formatResult( $skin, $result ) {
74 global $wgContLang;
75
76 $nt = Title::makeTitleSafe( NS_CATEGORY, $result->title );
77 if ( !$nt ) {
78 return Html::element(
79 'span',
80 [ 'class' => 'mw-invalidtitle' ],
82 $this->getContext(),
84 $result->title )
85 );
86 }
87
88 $text = $wgContLang->convert( $nt->getText() );
89 $plink = $this->getLinkRenderer()->makeLink( $nt, $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}
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
Definition Linker.php:209
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:34
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
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
Definition design.txt:57
const NS_CATEGORY
Definition Defines.php:88
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.