r39121 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39120‎ | r39121 | r39122 >
Date:08:30, 11 August 2008
Author:krimpet
Status:old
Tags:
Comment:
Addressing concerns in r39801 regarding editnotices; the message names now use dbkeys instead, and wfMsgForContent is now used consistently.
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -455,6 +455,25 @@
456456 $wgOut->addWikiMsg( 'talkpagetext' );
457457 }
458458
 459+ # Optional notices on a per-namespace and per-page basis
 460+ $editnotice_ns = 'editnotice-'.$this->mTitle->getNamespace();
 461+ $editnotice_page = $editnotice_ns.'-'.$this->mTitle->getDBkey();
 462+ if ( !wfEmptyMsg( $editnotice_ns, wfMsgForContent( $editnotice_ns ) ) ) {
 463+ $wgOut->addWikiText( wfMsgForContent( $editnotice_ns ) );
 464+ }
 465+ if ( MWNamespace::hasSubpages( $this->mTitle->getNamespace() ) ) {
 466+ $parts = explode( '/', $this->mTitle->getDBkey() );
 467+ $editnotice_base = $editnotice_ns;
 468+ while ( count( $parts ) > 0 ) {
 469+ $editnotice_base .= '-'.array_shift( $parts );
 470+ if ( !wfEmptyMsg( $editnotice_base, wfMsgForContent( $editnotice_base ) ) ) {
 471+ $wgOut->addWikiText( wfMsgForContent( $editnotice_base ) );
 472+ }
 473+ }
 474+ } else if ( !wfEmptyMsg( $editnotice_page, wfMsgForContent( $editnotice_page ) ) ) {
 475+ $wgOut->addWikiText( wfMsgForContent( $editnotice_page ) );
 476+ }
 477+
459478 # Attempt submission here. This will check for edit conflicts,
460479 # and redundantly check for locked database, blocked IPs, etc.
461480 # that edit() already checked just in case someone tries to sneak

Follow-up revisions

RevisionCommit summaryAuthorDate
r39270Updated release notes to reflect features added in r39269 and r39121krimpet02:56, 13 August 2008

Status & tagging log