Go to the documentation of this file.
36 parent::__construct(
'Listgrouprights' );
44 global $wgGroupPermissions, $wgRevokePermissions, $wgAddGroups, $wgRemoveGroups;
45 global $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf;
51 $out->addModuleStyles(
'mediawiki.special' );
53 $out->wrapWikiMsg(
"<div class=\"mw-listgrouprights-key\">\n$1\n</div>",
'listgrouprights-key' );
63 $allGroups = array_unique( array_merge(
64 array_keys( $wgGroupPermissions ),
65 array_keys( $wgRevokePermissions ),
66 array_keys( $wgAddGroups ),
67 array_keys( $wgRemoveGroups ),
68 array_keys( $wgGroupsAddToSelf ),
69 array_keys( $wgGroupsRemoveFromSelf )
73 foreach ( $allGroups
as $group ) {
74 $permissions = isset( $wgGroupPermissions[$group] )
75 ? $wgGroupPermissions[$group]
77 $groupname = ( $group ==
'*' )
81 $msg = $this->
msg(
'group-' . $groupname );
82 $groupnameLocalized = !$msg->isBlank() ? $msg->text() : $groupname;
84 $msg = $this->
msg(
'grouppage-' . $groupname )->inContentLanguage();
85 $grouppageLocalized = !$msg->isBlank() ?
89 if ( $group ==
'*' ) {
91 $grouppage = htmlspecialchars( $groupnameLocalized );
95 htmlspecialchars( $groupnameLocalized )
99 if ( $group ===
'user' ) {
103 $this->
msg(
'listgrouprights-members' )->escaped()
105 } elseif ( !in_array( $group, $wgImplicitGroups ) ) {
108 $this->
msg(
'listgrouprights-members' )->escaped(),
110 array(
'group' => $group )
117 $revoke = isset( $wgRevokePermissions[$group] ) ? $wgRevokePermissions[$group] :
array();
118 $addgroups = isset( $wgAddGroups[$group] ) ? $wgAddGroups[$group] :
array();
119 $removegroups = isset( $wgRemoveGroups[$group] ) ? $wgRemoveGroups[$group] :
array();
120 $addgroupsSelf = isset( $wgGroupsAddToSelf[$group] ) ? $wgGroupsAddToSelf[$group] :
array();
121 $removegroupsSelf = isset( $wgGroupsRemoveFromSelf[$group] ) ? $wgGroupsRemoveFromSelf[$group] :
array();
126 <td>$grouppage$grouplink</td>
129 $addgroupsSelf, $removegroupsSelf ) .
146 $header = $this->
msg(
'listgrouprights-namespaceprotection-header' )->parse();
149 'class' =>
'mw-headline',
150 'id' => $wgParser->guessSectionNameFromWikiText( $header )
156 $this->
msg(
'listgrouprights-namespaceprotection-namespace' )->text()
161 $this->
msg(
'listgrouprights-namespaceprotection-restrictedto' )->text()
172 $namespaceText = $this->
msg(
'blanknamespace' )->text();
174 $namespaceText =
$wgContLang->convertNamespace( $namespace );
186 array(
'namespace' => $namespace )
192 if ( !is_array( $rights ) ) {
193 $rights =
array( $rights );
199 'listgrouprights-right-display',
203 array(
'class' =>
'mw-listgrouprights-right-name' ),
230 private function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) {
232 foreach ( $permissions
as $permission => $granted ) {
234 if ( $granted && ( !isset( $revoke[$permission] ) || !$revoke[$permission] ) ) {
235 $description = $this->
msg(
'listgrouprights-right-display',
237 '<span class="mw-listgrouprights-right-name">' . $permission .
'</span>'
242 foreach ( $revoke
as $permission => $revoked ) {
244 $description = $this->
msg(
'listgrouprights-right-revoked',
246 '<span class="mw-listgrouprights-right-name">' . $permission .
'</span>'
256 if ( $add ===
true ) {
257 $r[] = $this->
msg(
'listgrouprights-addgroup-all' )->escaped();
258 } elseif ( is_array( $add ) && count( $add ) ) {
259 $add = array_values( array_unique( $add ) );
260 $r[] = $this->
msg(
'listgrouprights-addgroup',
261 $lang->listToText( array_map(
array(
'User',
'makeGroupLinkWiki' ), $add ) ),
266 if ( $remove ===
true ) {
267 $r[] = $this->
msg(
'listgrouprights-removegroup-all' )->escaped();
268 } elseif ( is_array( $remove ) && count( $remove ) ) {
269 $remove = array_values( array_unique( $remove ) );
270 $r[] = $this->
msg(
'listgrouprights-removegroup',
271 $lang->listToText( array_map(
array(
'User',
'makeGroupLinkWiki' ), $remove ) ),
276 if ( $addSelf ===
true ) {
277 $r[] = $this->
msg(
'listgrouprights-addgroup-self-all' )->escaped();
278 } elseif ( is_array( $addSelf ) && count( $addSelf ) ) {
279 $addSelf = array_values( array_unique( $addSelf ) );
280 $r[] = $this->
msg(
'listgrouprights-addgroup-self',
281 $lang->listToText( array_map(
array(
'User',
'makeGroupLinkWiki' ), $addSelf ) ),
286 if ( $removeSelf ===
true ) {
287 $r[] = $this->
msg(
'listgrouprights-removegroup-self-all' )->parse();
288 } elseif ( is_array( $removeSelf ) && count( $removeSelf ) ) {
289 $removeSelf = array_values( array_unique( $removeSelf ) );
290 $r[] = $this->
msg(
'listgrouprights-removegroup-self',
291 $lang->listToText( array_map(
array(
'User',
'makeGroupLinkWiki' ), $removeSelf ) ),
299 return '<ul><li>' . implode(
"</li>\n<li>", $r ) .
'</li></ul>';
execute( $par)
Show the special page.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
static getValidNamespaces()
Returns an array of the namespaces (by integer id) that exist on the wiki.
getOutput()
Get the OutputPage being used for this instance.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
return false if a UserGetRights hook might remove the named right $right
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
outputNamespaceProtectionInfo()
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
getLanguage()
Shortcut to get user's language.
__construct()
Constructor.
static openElement( $element, $attribs=null)
This opens an XML element.
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf)
Create a user-readable list of permissions from the given array.
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
when a variable name is used in a it is silently declared as a new masking the global
processing should stop and the error should be shown to the user * false
static escapeId( $id, $options=array())
Given a value, escape it so that it can be used in an id attribute and return it.
msg()
Wrapper around wfMessage that sets the current context.
Parent class for all special pages.
static closeElement( $element)
Shortcut to close an XML element.
static getRightDescription( $right)
Get the description of a given right.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
This special page lists all defined user groups and the associated rights.
if(!isset( $wgVersion)) if( $wgScript===false) if( $wgLoadScript===false) if( $wgArticlePath===false) if(!empty( $wgActionPaths) &&!isset( $wgActionPaths['view'])) if( $wgStylePath===false) if( $wgLocalStylePath===false) if( $wgStyleDirectory===false) if( $wgExtensionAssetsPath===false) if( $wgLogo===false) if( $wgUploadPath===false) if( $wgUploadDirectory===false) if( $wgReadOnlyFile===false) if( $wgFileCacheDirectory===false) if( $wgDeletedDirectory===false) if(isset( $wgFileStore['deleted']['directory'])) if(isset( $wgFooterIcons['copyright']) &&isset( $wgFooterIcons['copyright']['copyright']) && $wgFooterIcons['copyright']['copyright']===array()) if(isset( $wgFooterIcons['poweredby']) &&isset( $wgFooterIcons['poweredby']['mediawiki']) && $wgFooterIcons['poweredby']['mediawiki']['src']===null) $wgNamespaceProtection[NS_MEDIAWIKI]
Unconditional protection for NS_MEDIAWIKI since otherwise it's too easy for a sysadmin to set $wgName...
static rawElement( $element, $attribs=array(), $contents='')
Returns an HTML element in a string.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
static getCanonicalName( $index)
Returns the canonical (English) name for a given index.