MediaWiki master
|
This separate service is needed because the ::getGrantsLink method requires a LinkRenderer and if we tried to inject a LinkRenderer into the GrantsInfo service, it would result in recursive service instantiation for sessions using the BotPasswordSessionProvider, as a result of injecting the LinkRenderer when trying to use a GrantsInfo method that doesn't even need it. More...
Public Member Functions | |
__construct (GrantsInfo $grantsInfo, LinkRenderer $linkRenderer, LanguageFactory $languageFactory, Language $contentLanguage) | |
getGrantDescription (string $grant, $lang=null) | |
Fetch the description of the grant. | |
getGrantDescriptions (array $grants, $lang=null) | |
Fetch the descriptions for the grants. | |
getGrantDescriptionsWithClasses (array $grants, $lang=null) | |
Fetch the descriptions for the grants, like getGrantDescriptions, but with HTML classes for styling. | |
getGrantsLink (string $grant, $lang=null) | |
Generate a link to Special:ListGrants for a particular grant name. | |
getGrantsWikiText ( $grantsFilter, $lang=null) | |
Generate wikitext to display a list of grants. | |
This separate service is needed because the ::getGrantsLink method requires a LinkRenderer and if we tried to inject a LinkRenderer into the GrantsInfo service, it would result in recursive service instantiation for sessions using the BotPasswordSessionProvider, as a result of injecting the LinkRenderer when trying to use a GrantsInfo method that doesn't even need it.
Definition at line 39 of file GrantsLocalization.php.
MediaWiki\Permissions\GrantsLocalization::__construct | ( | GrantsInfo | $grantsInfo, |
LinkRenderer | $linkRenderer, | ||
LanguageFactory | $languageFactory, | ||
Language | $contentLanguage ) |
Definition at line 45 of file GrantsLocalization.php.
MediaWiki\Permissions\GrantsLocalization::getGrantDescription | ( | string | $grant, |
$lang = null ) |
Fetch the description of the grant.
string | $grant | |
Language | string | null | $lang |
Definition at line 63 of file GrantsLocalization.php.
MediaWiki\Permissions\GrantsLocalization::getGrantDescriptions | ( | array | $grants, |
$lang = null ) |
Fetch the descriptions for the grants.
string[] | $grants | |
Language | string | null | $lang |
Definition at line 96 of file GrantsLocalization.php.
MediaWiki\Permissions\GrantsLocalization::getGrantDescriptionsWithClasses | ( | array | $grants, |
$lang = null ) |
Fetch the descriptions for the grants, like getGrantDescriptions, but with HTML classes for styling.
The HTML is wikitext-compatible.
string[] | $grants | |
Language | string | null | $lang |
Definition at line 112 of file GrantsLocalization.php.
MediaWiki\Permissions\GrantsLocalization::getGrantsLink | ( | string | $grant, |
$lang = null ) |
Generate a link to Special:ListGrants for a particular grant name.
This can be used to link end users to a full description of what rights they are giving when they authorize a grant.
string | $grant | the grant name |
Language | string | null | $lang |
Definition at line 145 of file GrantsLocalization.php.
MediaWiki\Permissions\GrantsLocalization::getGrantsWikiText | ( | $grantsFilter, | |
$lang = null ) |
Generate wikitext to display a list of grants.
It will be in the format
string[] | null | $grantsFilter | If non-null, only display these grants. |
Language | string | null | $lang |
Definition at line 164 of file GrantsLocalization.php.