From: Fran Rogers Date: Mon, 11 Aug 2008 08:30:29 +0000 (+0000) Subject: Addressing concerns in r39801 regarding editnotices; the message names now use dbkeys... X-Git-Tag: 1.31.0-rc.0~45959 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=eb7b21fba843dc8dbaf5f3c4d0ef6843c1642f98;p=lhc%2Fweb%2Fwiklou.git Addressing concerns in r39801 regarding editnotices; the message names now use dbkeys instead, and wfMsgForContent is now used consistently. --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 160e0f1a89..3e67d06a79 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -455,6 +455,25 @@ class EditPage { $wgOut->addWikiMsg( 'talkpagetext' ); } + # Optional notices on a per-namespace and per-page basis + $editnotice_ns = 'editnotice-'.$this->mTitle->getNamespace(); + $editnotice_page = $editnotice_ns.'-'.$this->mTitle->getDBkey(); + if ( !wfEmptyMsg( $editnotice_ns, wfMsgForContent( $editnotice_ns ) ) ) { + $wgOut->addWikiText( wfMsgForContent( $editnotice_ns ) ); + } + if ( MWNamespace::hasSubpages( $this->mTitle->getNamespace() ) ) { + $parts = explode( '/', $this->mTitle->getDBkey() ); + $editnotice_base = $editnotice_ns; + while ( count( $parts ) > 0 ) { + $editnotice_base .= '-'.array_shift( $parts ); + if ( !wfEmptyMsg( $editnotice_base, wfMsgForContent( $editnotice_base ) ) ) { + $wgOut->addWikiText( wfMsgForContent( $editnotice_base ) ); + } + } + } else if ( !wfEmptyMsg( $editnotice_page, wfMsgForContent( $editnotice_page ) ) ) { + $wgOut->addWikiText( wfMsgForContent( $editnotice_page ) ); + } + # Attempt submission here. This will check for edit conflicts, # and redundantly check for locked database, blocked IPs, etc. # that edit() already checked just in case someone tries to sneak