wfProfileOut( $fname );
$wgOut->setRobotpolicy( 'noindex,nofollow' );
- $ret = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
+ if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
+ $ret = wfMsgWeirdKey ( $this->mTitle->getText() ) ;
+ } else {
+ $ret = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
+ }
+
return "<div class='noarticletext'>$ret</div>";
} else {
$this->loadContent( $noredir );
$redirect = ($redirect == 'no') ? 'no' : 'yes';
$t .= ',redirect='.$redirect;
}
- $this->mContent = wfMsg( 'missingarticle', $t );
+ $this->mContent = wfMsg( 'missingarticle', $t ) ;
if( $oldid ) {
$revision = Revision::newFromId( $oldid );
# first, see if the page exists at all.
$exists = $page->getArticleId() != 0;
if( !$exists ) {
- $wgOut->addHTML( wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) );
+ if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
+ $wgOut->addHTML(wfMsgWeirdKey ( $this->mTitle->getText() ) );
+ } else {
+ $wgOut->addHTML(wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) );
+ }
} else {
$dbr =& $this->getDB( DB_SLAVE );
$wl_clause = array(
$this->edittime = $this->mArticle->getTimestamp();
$this->textbox1 = $this->mArticle->getContent( true );
$this->summary = '';
+ if ( !$this->mArticle->exists() && $this->mArticle->mTitle->getNamespace() == NS_MEDIAWIKI )
+ $this->textbox1 = wfMsgWeirdKey ( $this->mArticle->mTitle->getText() ) ;
wfProxyCheck();
}
return $message;
}
+/**
+ * This function provides the message source for messages to be edited which are *not* stored in the database
+*/
+
+function wfMsgWeirdKey ( $key ) {
+ $subsource = str_replace ( ' ' , '_' , $key ) ;
+ $source = wfMsg ( $subsource ) ;
+ if ( $source == "<{$subsource}>" ) {
+ # Try again with first char lower case
+ $subsource = strtolower ( substr ( $subsource , 0 , 1 ) ) . substr ( $subsource , 1 ) ;
+ $source = wfMsg ( $subsource ) ;
+ }
+ if ( $source == "<{$subsource}>" ) {
+ # Didn't work either, return blank text
+ $source = "" ;
+ }
+ return $source ;
+}
+
/**
* Fetch a message string value, but don't replace any keys yet.
* @param string $key
if( is_string( $source ) ) {
if( strcmp( $source, '' ) == 0 ) {
- $source = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
+ global $wgTitle ;
+ if ( $wgTitle->getNamespace() == NS_MEDIAWIKI ) {
+ $source = wfMsgWeirdKey ( $wgTitle->getText() ) ;
+ } else {
+ $source = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
+ }
}
$rows = $wgUser->getOption( 'rows' );
$cols = $wgUser->getOption( 'cols' );