Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -455,6 +455,25 @@ |
456 | 456 | $wgOut->addWikiMsg( 'talkpagetext' ); |
457 | 457 | } |
458 | 458 | |
| 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 | + |
459 | 478 | # Attempt submission here. This will check for edit conflicts, |
460 | 479 | # and redundantly check for locked database, blocked IPs, etc. |
461 | 480 | # that edit() already checked just in case someone tries to sneak |