51 $this->grantsInfo = $grantsInfo;
52 $this->linkRenderer = $linkRenderer;
53 $this->languageFactory = $languageFactory;
54 $this->contentLanguage = $contentLanguage;
78 $msg->inLanguage( $lang );
81 if ( !$msg->exists() ) {
83 ?
wfMessage(
'grant-generic', $grant )->inLanguage( $lang )
99 foreach ( $grants as $grant ) {
100 $ret[$grant] = $this->getGrantDescription( $grant, $lang );
113 $riskGroupsByGrant = $this->grantsInfo->getRiskGroupsByGrant(
'unknown' );
114 $grantDescriptions = $this->getGrantDescriptions( $grants, $lang );
116 foreach ( $grantDescriptions as $grant => $description ) {
117 $riskGroup = $riskGroupsByGrant[$grant] ??
'unknown';
120 $riskGroupMsg =
wfMessage(
"grantriskgroup-$riskGroup" );
122 $riskGroupMsg->inLanguage( $lang );
124 if ( $riskGroupMsg->exists() ) {
125 $riskDescription = $riskGroupMsg->text();
127 $riskDescription =
'';
129 $results[] = htmlspecialchars( $description ) .
' ' .
130 Html::element(
'span', [
'class' =>
"mw-grant mw-grantriskgroup-$riskGroup" ], $riskDescription );
146 $riskGroupsByGrant = $this->grantsInfo->getRiskGroupsByGrant(
'unknown' );
147 $riskGroup = $riskGroupsByGrant[$grant] ??
'unknown';
148 return $this->linkRenderer->makeKnownLink(
149 SpecialPage::getTitleFor(
'Listgrants',
false, $grant ),
150 new HtmlArmor( $this->getGrantDescriptionsWithClasses( [ $grant ], $lang )[ 0 ] )
165 if ( is_string( $lang ) ) {
166 $lang = $this->languageFactory->getLanguage( $lang );
167 } elseif ( $lang ===
null ) {
168 $lang = $this->contentLanguage;
172 foreach ( $this->grantsInfo->getGrantGroups( $grantsFilter ) as $group => $grants ) {
173 if ( $group ===
'hidden' ) {
176 $grantDescriptionsWithClasses = $this->getGrantDescriptionsWithClasses( $grants, $lang );
183 $s .=
"*<span class=\"mw-grantgroup\">" .
185 wfMessage(
"grant-group-$group" )->inLanguage( $lang )->text() .
"</span>\n";
186 $s .=
":" . $lang->semicolonList( $grantDescriptionsWithClasses ) .
"\n";
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
if(!defined('MW_SETUP_CALLBACK'))
Marks HTML that shouldn't be escaped.
Parent class for all special pages.