r13859 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13858‎ | r13859 | r13860 >
Date:01:44, 25 April 2006
Author:robchurch
Status:old
Tags:
Comment:
* Indicate when a protected page is an interface message ("protectedinterface")
* (bug 4259) Indicate when a protected page being edited is an interface message ("editinginterface")
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/languages/Messages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -799,12 +799,18 @@
800800 }
801801
802802 if( $this->mTitle->isProtected( 'edit' ) ) {
803 - if( $this->mTitle->isSemiProtected() ) {
 803+ # Is the protection due to the namespace, e.g. interface text?
 804+ if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
 805+ # Yes; remind the user
 806+ $notice = wfMsg( 'editinginterface' );
 807+ } elseif( $this->mTitle->isSemiProtected() ) {
 808+ # No; semi protected
804809 $notice = wfMsg( 'semiprotectedpagewarning' );
805810 if( wfEmptyMsg( 'semiprotectedpagewarning', $notice ) || $notice == '-' ) {
806811 $notice = '';
807812 }
808813 } else {
 814+ # No; regular protection
809815 $notice = wfMsg( 'protectedpagewarning' );
810816 }
811817 $wgOut->addWikiText( $notice );
Index: trunk/phase3/includes/OutputPage.php
@@ -812,7 +812,14 @@
813813 $skin = $wgUser->getSkin();
814814 $this->setPageTitle( wfMsg( 'viewsource' ) );
815815 $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );
816 - $this->addWikiText( wfMsg( 'protectedtext' ) );
 816+
 817+ # Determine if protection is due to the page being a system message
 818+ # and show an appropriate explanation
 819+ if( $wgTitle->getNamespace() == NS_MEDIAWIKI && !$wgUser->isAllowed( 'editinterface' ) ) {
 820+ $this->addWikiText( wfMsg( 'protectedinterface' ) );
 821+ } else {
 822+ $this->addWikiText( wfMsg( 'protectedtext' ) );
 823+ }
817824 } else {
818825 $this->setPageTitle( wfMsg( 'readonly' ) );
819826 if ( $wgReadOnly ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -120,6 +120,9 @@
121121 * (bug 5684) Introduce Special:Randomredirect
122122 * (bug 5611) Add a name attribute to the text box containing source text in
123123 read-only pages
 124+* Indicate when a protected page is an interface message ("protectedinterface")
 125+* (bug 4259) Indicate when a protected page being edited is an interface message
 126+ ("editinginterface")
124127
125128 == Compatibility ==
126129
Index: trunk/phase3/languages/Messages.php
@@ -342,6 +342,8 @@
343343 [[Project:Protected page]].
344344
345345 You can view and copy the source of this page:',
 346+'protectedinterface' => 'This page provides interface text for the software, and is locked to prevent abuse.',
 347+'editinginterface' => "'''Warning:''' You are editing a page which is used to provide interface text for the software. Changes to this page will affect the appearance of the user interface for other users.",
346348 'sqlhidden' => '(SQL query hidden)',
347349
348350 # Login and logout pages

Status & tagging log