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();
126 $riskDescriptionHTML =
' ' .
127 Html::element(
'span', [
'class' =>
"mw-grant mw-grantriskgroup-$riskGroup" ], $riskDescription );
129 $riskDescription =
'';
130 $riskDescriptionHTML =
'';
132 $results[] = htmlspecialchars( $description ) . $riskDescriptionHTML;
148 $riskGroupsByGrant = $this->grantsInfo->getRiskGroupsByGrant(
'unknown' );
149 $riskGroup = $riskGroupsByGrant[$grant] ??
'unknown';
150 return $this->linkRenderer->makeKnownLink(
151 SpecialPage::getTitleFor(
'Listgrants',
false, $grant ),
152 new HtmlArmor( $this->getGrantDescriptionsWithClasses( [ $grant ], $lang )[ 0 ] )
167 if ( is_string( $lang ) ) {
168 $lang = $this->languageFactory->getLanguage( $lang );
169 } elseif ( $lang ===
null ) {
170 $lang = $this->contentLanguage;
174 foreach ( $this->grantsInfo->getGrantGroups( $grantsFilter ) as $group => $grants ) {
175 if ( $group ===
'hidden' ) {
178 $grantDescriptionsWithClasses = $this->getGrantDescriptionsWithClasses( $grants, $lang );
185 $s .=
"*<span class=\"mw-grantgroup\">" .
187 wfMessage(
"grant-group-$group" )->inLanguage( $lang )->text() .
"</span>\n";
188 $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.