r40519 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40518‎ | r40519 | r40520 >
Date:07:41, 6 September 2008
Author:aaron
Status:old
Tags:
Comment:
Add class to textarea for protected pages (bug 11825)
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -1190,6 +1190,7 @@
11911191 }
11921192 }
11931193
 1194+ $classes = array(); // Textarea CSS
11941195 if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
11951196 # Show a warning if editing an interface message
11961197 $wgOut->addWikiMsg( 'editinginterface' );
@@ -1197,9 +1198,11 @@
11981199 # Is the title semi-protected?
11991200 if( $this->mTitle->isSemiProtected() ) {
12001201 $noticeMsg = 'semiprotectedpagewarning';
 1202+ $classes[] = 'mw-textarea-sprotected';
12011203 } else {
12021204 # Then it must be protected based on static groups (regular)
12031205 $noticeMsg = 'protectedpagewarning';
 1206+ $classes[] = 'mw-textarea-protected';
12041207 }
12051208 $wgOut->addHTML( "<div id='mw-edit-$noticeMsg'>\n" );
12061209 $wgOut->addWikiMsg( $noticeMsg );
@@ -1396,7 +1399,7 @@
13971400 {$this->editFormTextBeforeContent}
13981401 END
13991402 );
1400 - $this->showTextbox1();
 1403+ $this->showTextbox1( $classes );
14011404
14021405 $wgOut->wrapWikiMsg( "<div id=\"editpage-copywarn\">\n$1\n</div>", $copywarnMsg );
14031406 $wgOut->addHTML( <<<END
@@ -1472,11 +1475,13 @@
14731476 <input type='hidden' value=\"{$this->scrolltop}\" name=\"wpScrolltop\" id=\"wpScrolltop\" />\n" );
14741477 }
14751478
1476 - protected function showTextbox1() {
 1479+ protected function showTextbox1( $classes ) {
14771480 $attribs = array( 'tabindex' => 1 );
14781481
14791482 if( $this->wasDeletedSinceLastEdit() )
14801483 $attribs['type'] = 'hidden';
 1484+ if( !empty($classes) )
 1485+ $attribs['class'] = implode(' ',$classes);
14811486
14821487 $this->showTextbox( $this->textbox1, 'wpTextbox1', $attribs );
14831488 }