39 private $linkBatchFactory;
42 private $trackingCategories;
52 parent::__construct(
'TrackingCategories' );
53 $this->linkBatchFactory = $linkBatchFactory;
54 $this->trackingCategories = $trackingCategories;
61 $this->
getOutput()->setPreventClickjacking(
false );
63 'jquery.tablesorter.styles',
64 'mediawiki.pager.styles'
66 $this->
getOutput()->addModules(
'jquery.tablesorter' );
69 'id' =>
'mw-trackingcategories-table' ] ) .
"\n" .
72 $this->
msg(
'trackingcategories-msg' )->escaped() .
"
75 $this->
msg(
'trackingcategories-name' )->escaped() .
78 $this->
msg(
'trackingcategories-desc' )->escaped() .
"
83 $categoryList = $this->trackingCategories->getTrackingCategories();
85 $batch = $this->linkBatchFactory->newLinkBatch();
86 foreach ( $categoryList as $data ) {
87 $batch->addObj( $data[
'msg'] );
88 foreach ( $data[
'cats'] as $catTitle ) {
89 $batch->addObj( $catTitle );
94 $this->
getHookRunner()->onSpecialTrackingCategories__preprocess( $this, $categoryList );
98 foreach ( $categoryList as $catMsg => $data ) {
100 $catDesc = $catMsg .
'-desc';
102 $catMsgTitleText = $linkRenderer->makeLink(
107 foreach ( $data[
'cats'] as $catTitle ) {
108 $html = $linkRenderer->makeLink(
113 $this->
getHookRunner()->onSpecialTrackingCategories__generateCatLink(
114 $this, $catTitle, $html );
119 # Extra message, when no category was found
120 if ( $allMsgs === [] ) {
121 $allMsgs[] = $this->
msg(
'trackingcategories-disabled' )->parse();
128 $descMsg = $this->
msg( $catDesc );
129 if ( $descMsg->isBlank() ) {
130 $descMsg = $this->
msg(
'trackingcategories-nodesc' );
136 $this->
getLanguage()->commaList( array_unique( $allMsgs ) ) .
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
static closeElement( $element)
Returns "</$element>".
Parent class for all special pages.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getOutput()
Get the OutputPage being used for this instance.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getLanguage()
Shortcut to get user's language.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
A special page that displays list of tracking categories Tracking categories allow pages with certain...
__construct(LinkBatchFactory $linkBatchFactory, TrackingCategories $trackingCategories)
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
execute( $par)
Default execute method Checks user permissions.
This class performs some operations related to tracking categories, such as creating a list of all su...