54 parent::__construct(
'TrackingCategories' );
55 $this->linkBatchFactory = $linkBatchFactory;
56 $this->trackingCategories = $trackingCategories;
63 $this->
getOutput()->setPreventClickjacking(
false );
65 'jquery.tablesorter.styles',
66 'mediawiki.pager.styles'
68 $this->
getOutput()->addModules(
'jquery.tablesorter' );
70 Html::openElement(
'table', [
'class' =>
'mw-datatable sortable',
71 'id' =>
'mw-trackingcategories-table' ] ) .
"\n" .
74 $this->
msg(
'trackingcategories-msg' )->escaped() .
"
77 $this->
msg(
'trackingcategories-name' )->escaped() .
80 $this->
msg(
'trackingcategories-desc' )->escaped() .
"
85 $categoryList = $this->trackingCategories->getTrackingCategories();
87 $batch = $this->linkBatchFactory->newLinkBatch();
88 foreach ( $categoryList as $data ) {
89 $batch->addObj( $data[
'msg'] );
90 foreach ( $data[
'cats'] as $catTitle ) {
91 $batch->addObj( $catTitle );
96 $this->
getHookRunner()->onSpecialTrackingCategories__preprocess( $this, $categoryList );
100 foreach ( $categoryList as $catMsg => $data ) {
102 $catDesc = $catMsg .
'-desc';
104 $catMsgTitleText = $linkRenderer->makeLink(
109 foreach ( $data[
'cats'] as $catTitle ) {
110 $html = $linkRenderer->makeLink(
115 $this->
getHookRunner()->onSpecialTrackingCategories__generateCatLink(
116 $this, $catTitle, $html );
121 # Extra message, when no category was found
122 if ( $allMsgs === [] ) {
123 $allMsgs[] = $this->
msg(
'trackingcategories-disabled' )->parse();
130 $descMsg = $this->
msg( $catDesc );
131 if ( $descMsg->isBlank() ) {
132 $descMsg = $this->
msg(
'trackingcategories-nodesc' );
136 Html::openElement(
'tr' ) .
137 Html::openElement(
'td', [
'class' =>
'mw-trackingcategories-name' ] ) .
138 $this->
getLanguage()->commaList( array_unique( $allMsgs ) ) .
139 Html::closeElement(
'td' ) .
140 Html::openElement(
'td', [
'class' =>
'mw-trackingcategories-msg' ] ) .
142 Html::closeElement(
'td' ) .
143 Html::openElement(
'td', [
'class' =>
'mw-trackingcategories-desc' ] ) .
145 Html::closeElement(
'td' ) .
146 Html::closeElement(
'tr' )
149 $this->
getOutput()->addHTML( Html::closeElement(
'table' ) );
161class_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.
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.