Index: languages/Language.php =================================================================== --- languages/Language.php (revision 52193) +++ languages/Language.php (working copy) @@ -278,6 +278,12 @@ return strtr($ns, '_', ' '); } + function getDisplayNsText( $index ) { + if( $index == 0 ) + return $this->getMessage( 'blanknamespace' ); + return $this->getFormattedNsText( $index ); + } + /** * Get a namespace key by value, case insensitive. * Only matches namespace names for the current language, not the Index: languages/messages/MessagesEn.php =================================================================== --- languages/messages/MessagesEn.php (revision 52193) +++ languages/messages/MessagesEn.php (working copy) @@ -447,6 +447,9 @@ 'LinkSearch' => array( 'LinkSearch' ), 'DeletedContributions' => array( 'DeletedContributions' ), 'Tags' => array( 'Tags' ), + 'ListUserRestrictions' => array( 'ListUserRestrictions' ), + 'RemoveRestrictions' => array( 'RemoveRestrictions' ), + 'RestrictUser' => array( 'RestrictUser' ), ); /** @@ -1224,7 +1227,39 @@ 'edit-no-change' => 'Your edit was ignored, because no change was made to the text.', 'edit-already-exists' => 'Could not create a new page. It already exists.', +'userrestricted-page' => '\'\'\'Your user name or IP address has been restricted from editing page "$1".\'\'\' +The restriction was set by [[User:$2|$2]]. +The reason given is \'\'$3\'\'. + +The restriction was set on $4 at $5 and expires on $6 at $7. + +You can contact [[User:$2|$2]] or another [[{{MediaWiki:Grouppage-sysop}}|administrator]] to discuss the restriction.', +'userrestricted-namespace' => "'''Your user name or IP address has been restricted from editing the $1 namespace.''' + +The restriction was put by [[User:$2|$2]]. +The reason given is ''$3''. + +Restriction was put on $4 at $5 and expires on $6 at $7. + +You can contact [[User:$2|$2]] or another [[{{MediaWiki:Grouppage-sysop}}|administrator]] to discuss the restriction.", +'userrestricted-page-indef' => '\'\'\'Your user name or IP address has been restricted from editing page "$1".\'\'\' + +The restriction was set by [[User:$2|$2]]. +The reason given is \'\'$3\'\'. + +The restriction was set on $4 at $5 and will not expire. + +You can contact [[User:$2|$2]] or another [[{{MediaWiki:Grouppage-sysop}}|administrator]] to discuss the restriction.', +'userrestricted-namespace-indef' => "'''Your user name or IP address has been restricted from editing $1 namespace.''' + +The restriction was put by [[User:$2|$2]]. +The reason given is ''$3''. + +Restriction was put on $4 at $5 and will not expire. + +You can contact [[User:$2|$2]] or another [[{{MediaWiki:Grouppage-sysop}}|administrator]] to discuss the restriction.", + # Parser/template warnings 'expensive-parserfunction-warning' => "'''Warning:''' This page contains too many expensive parser function calls. @@ -2704,6 +2739,7 @@ 'ipbsubmit' => 'Block this user', 'ipbother' => 'Other time:', 'ipboptions' => '2 hours:2 hours,1 day:1 day,3 days:3 days,1 week:1 week,2 weeks:2 weeks,1 month:1 month,3 months:3 months,6 months:6 months,1 year:1 year,infinite:infinite', +'ipbinfinite' => 'infinite', 'ipbotheroption' => 'other', 'ipbotherreason' => 'Other/additional reason:', 'ipbhidename' => 'Hide username from edits and lists', @@ -2789,6 +2825,74 @@ You cannot create an account', 'cant-block-while-blocked' => 'You cannot block other users while you are blocked.', +# Special:ListUserRestrictions +'listuserrestrictions' => 'List of user restrictions', +'listuserrestrictions-intro' => 'This list contains all restrictions from editing certain pages and namespaces put on users. +[[Special:Ipblocklist|Blocks]] are not listed here.', +'listuserrestrictions-row-ns' => 'restricted $1 from editing $2 namespace ($3)', +'listuserrestrictions-row-page' => 'restricted $1 from editing $2 ($3)', +'listuserrestrictions-row-expiry' => 'expires on $1 at $2', +'listuserrestrictions-legend' => 'Find a restriction', +'listuserrestrictions-type' => 'Type:', +'listuserrestrictions-user' => 'User:', +'listuserrestrictions-namespace' => 'Namespace:', +'listuserrestrictions-page' => 'Page:', +'listuserrestrictions-submit' => 'Go', +'listuserrestrictions-notfound' => 'There is no restriction that matches specified criteria.', +'listuserrestrictions-empty' => 'This list is empty.', +'listuserrestrictions-remove' => 'remove', +'userrestrictiontype-none' => '(none)', +'userrestrictiontype-namespace' => 'Namespace', +'userrestrictiontype-page' => 'Page', + +# Special:RemoveRestrictions +'removerestrictions' => 'Remove the restriction for a user', +'removerestrictions-intro' => 'Use the form below to remove a restriction from a certain user.', +'removerestrictions-noid' => 'No restriction ID was specified.', +'removerestrictions-wrongid' => 'Restriction with that ID not found. +Most probably someone has removed it or it expired.', +'removerestrictions-legend' => 'Remove a restriction', +'removerestrictions-user' => 'Restricted user:', +'removerestrictions-type' => 'Restriction type:', +'removerestrictions-page' => 'Page:', +'removerestrictions-namespace' => 'Namespace:', +'removerestrictions-reason' => 'Reason:', +'removerestrictions-submit' => 'Remove the restriction', +'removerestrictions-success' => "'''Successfully removed the restriction from [[User:$1|$1]].''' + +Return to [[Special:ListUserRestrictions|user restrictions list]].", + +# Restrict user +'restrictuser' => 'Restrict user', +'restrictuser-userselect' => 'Select a user', +'restrictuser-user' => 'User:', +'restrictuser-go' => 'Restrict user', +'restrictuser-notfound' => 'User not found', +'restrictuser-existing' => 'Existing restrictions', +'restrictuser-legend' => 'Restrict user from editing', +'restrictuser-type' => 'Restriction type:', +'restrictuser-title' => 'Page to restrict:', +'restrictuser-namespace' => 'Namespace:', +'restrictuser-expiry' => 'Expires:', +'restrictuser-reason' => 'Reason:', +'restrictuser-submit' => 'Restrict user', +'restrictuser-badtitle' => 'Invalid title specified: $1.', +'restrictuser-badnamespace' => 'Invalid namespace specified.', +'restrictuser-badexpiry' => 'Invalid expiry specified: $1.', +'restrictuser-duptitle' => 'User is already restricted from editing this title.', +'restrictuser-dupnamespace' => 'User is already restricted from editing this namespace.', +'restrictuser-success' => 'Successfully restricted user $1.', +'restrictuser-description' => 'Use the form below to block write access to a specific page or namespace from a specific IP address or username. +This should be done only in accordance with policy. Fill in a specific reason below.', + +# Special:Log/restrict +'restrictionlog' => 'User restriction log', +'restrictionlogtext' => 'This log contains all restrictions put on users by administrators.', +'restrictentry' => 'restricted $1 from editing $2 (expiry set to $3)', +'restrictremoveentry' => 'removed restriction from $1 for editing $2', +'restrictlognamespace' => '$1 namespace', +'restrictlogpage' => '[[$1]]', + # Developer tools 'lockdb' => 'Lock database', 'unlockdb' => 'Unlock database', Index: skins/common/restrict.js =================================================================== --- skins/common/restrict.js (revision 0) +++ skins/common/restrict.js (revision 0) @@ -0,0 +1,22 @@ +addOnloadHook(updateRestrictForm); + +function updateRestrictForm() { + if (!document.getElementById) + return; + + var typeSelect = document.getElementById('mw-restrict-type'); + if (!typeSelect) + return; + + var type = typeSelect.value; + + var pageRow = document.getElementById('mw-restrictuser-title'); + if( pageRow ) { + pageRow.style.display = (type != 'page') ? 'none' : ''; + } + + var namespaceRow = document.getElementById('mw-restrictuser-namespace'); + if( namespaceRow ) { + namespaceRow.style.display = (type != 'namespace') ? 'none' : ''; + } +} Property changes on: skins/common/restrict.js ___________________________________________________________________ Added: svn:eol-style + native Index: includes/Xml.php =================================================================== --- includes/Xml.php (revision 52193) +++ includes/Xml.php (working copy) @@ -730,6 +730,25 @@ $s .= Xml::closeElement( 'tr' ); return $s; } + + /** + * Build a restriction type selector + * @param $name Name of type selector + * @param $value Initial value + * @param $id ID of