51 parent::__construct(
'TrackingCategories' );
52 $this->linkBatchFactory = $linkBatchFactory;
53 $this->trackingCategories = $trackingCategories;
60 $this->
getOutput()->getMetadata()->setPreventClickjacking(
false );
62 'jquery.tablesorter.styles',
63 'mediawiki.pager.styles'
65 $this->
getOutput()->addModules(
'jquery.tablesorter' );
67 Html::openElement(
'table', [
'class' =>
'mw-datatable sortable',
68 'id' =>
'mw-trackingcategories-table' ] ) .
"\n" .
76 $categoryList = $this->trackingCategories->getTrackingCategories();
78 $batch = $this->linkBatchFactory->newLinkBatch();
79 foreach ( $categoryList as $data ) {
80 $batch->addObj( $data[
'msg'] );
81 foreach ( $data[
'cats'] as $catTitle ) {
82 $batch->addObj( $catTitle );
87 $this->
getHookRunner()->onSpecialTrackingCategories__preprocess( $this, $categoryList );
91 foreach ( $categoryList as $catMsg => $data ) {
93 $catDesc = $catMsg .
'-desc';
95 $catMsgTitleText = $linkRenderer->makeLink(
100 foreach ( $data[
'cats'] as $catTitle ) {
102 $linkRenderer->makeLink(
107 $this->
getHookRunner()->onSpecialTrackingCategories__generateCatLink(
108 $this, $catTitle, $html );
113 # Extra message, when no category was found
114 if ( $allMsgs === [] ) {
115 $allMsgs[] = $this->
msg(
'trackingcategories-disabled' )->parse();
122 $descMsg = $this->
msg( $catDesc );
123 if ( $descMsg->isBlank() ) {
124 $descMsg = $this->
msg(
'trackingcategories-nodesc' );
128 Html::openElement(
'tr' ) .
129 Html::openElement(
'td', [
'class' =>
'mw-trackingcategories-name' ] ) .
130 $this->
getLanguage()->commaList( array_unique( $allMsgs ) ) .
131 Html::closeElement(
'td' ) .
132 Html::openElement(
'td', [
'class' =>
'mw-trackingcategories-msg' ] ) .
134 Html::closeElement(
'td' ) .
135 Html::openElement(
'td', [
'class' =>
'mw-trackingcategories-desc' ] ) .
137 Html::closeElement(
'td' ) .
138 Html::closeElement(
'tr' )
141 $this->
getOutput()->addHTML( Html::closeElement(
'table' ) );
153class_alias( SpecialTrackingCategories::class,
'SpecialTrackingCategories' );
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.