30 parent::__construct(
'TrackingCategories' );
38 $this->
getOutput()->getMetadata()->setPreventClickjacking(
false );
40 'jquery.tablesorter.styles',
41 'mediawiki.pager.styles'
43 $this->
getOutput()->addModules(
'jquery.tablesorter' );
45 Html::openElement(
'table', [
'class' => [
'mw-datatable',
'sortable' ],
46 'id' =>
'mw-trackingcategories-table' ] ) .
"\n" .
54 $categoryList = $this->trackingCategories->getTrackingCategories();
56 $batch = $this->linkBatchFactory->newLinkBatch()->setCaller( __METHOD__ );
57 foreach ( $categoryList as $data ) {
58 $batch->addObj( $data[
'msg'] );
59 foreach ( $data[
'cats'] as $catTitle ) {
60 $batch->addObj( $catTitle );
65 $this->
getHookRunner()->onSpecialTrackingCategories__preprocess( $this, $categoryList );
69 foreach ( $categoryList as $catMsg => $data ) {
71 $catDesc = $catMsg .
'-desc';
73 $catMsgTitleText = $linkRenderer->makeLink(
78 foreach ( $data[
'cats'] as $catTitle ) {
80 $linkRenderer->makeLink(
85 $this->
getHookRunner()->onSpecialTrackingCategories__generateCatLink(
86 $this, $catTitle, $html );
91 # Extra message, when no category was found
92 if ( $allMsgs === [] ) {
93 $allMsgs[] = $this->
msg(
'trackingcategories-disabled' )->parse();
100 $descMsg = $this->
msg( $catDesc );
101 if ( $descMsg->isBlank() ) {
102 $descMsg = $this->
msg(
'trackingcategories-nodesc' );
105 $this->
getOutput()->addHTML( Html::rawElement(
'tr', [],
106 Html::rawElement(
'td', [
'class' =>
'mw-trackingcategories-name' ],
107 $this->
getLanguage()->commaList( array_unique( $allMsgs ) )
109 Html::rawElement(
'td', [
'class' =>
'mw-trackingcategories-msg' ],
112 Html::rawElement(
'td', [
'class' =>
'mw-trackingcategories-desc' ],
117 $this->
getOutput()->addHTML( Html::closeElement(
'table' ) );
130class_alias( SpecialTrackingCategories::class,
'SpecialTrackingCategories' );
Factory for LinkBatch objects to batch query page metadata.
Parent class for all special pages.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
getContentLanguage()
Shortcut to get content language.
getLanguage()
Shortcut to get user's language.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages By default the message key is the canonical name of...
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.