Index: trunk/phase3/includes/Article.php |
— | — | @@ -106,7 +106,12 @@ |
107 | 107 | wfProfileOut( $fname ); |
108 | 108 | $wgOut->setRobotpolicy( 'noindex,nofollow' ); |
109 | 109 | |
110 | | - $ret = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ); |
| 110 | + if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { |
| 111 | + $ret = wfMsgWeirdKey ( $this->mTitle->getText() ) ; |
| 112 | + } else { |
| 113 | + $ret = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ); |
| 114 | + } |
| 115 | + |
111 | 116 | return "<div class='noarticletext'>$ret</div>"; |
112 | 117 | } else { |
113 | 118 | $this->loadContent( $noredir ); |
— | — | @@ -376,7 +381,7 @@ |
377 | 382 | $redirect = ($redirect == 'no') ? 'no' : 'yes'; |
378 | 383 | $t .= ',redirect='.$redirect; |
379 | 384 | } |
380 | | - $this->mContent = wfMsg( 'missingarticle', $t ); |
| 385 | + $this->mContent = wfMsg( 'missingarticle', $t ) ; |
381 | 386 | |
382 | 387 | if( $oldid ) { |
383 | 388 | $revision = Revision::newFromId( $oldid ); |
— | — | @@ -2431,7 +2436,11 @@ |
2432 | 2437 | # first, see if the page exists at all. |
2433 | 2438 | $exists = $page->getArticleId() != 0; |
2434 | 2439 | if( !$exists ) { |
2435 | | - $wgOut->addHTML( wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) ); |
| 2440 | + if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { |
| 2441 | + $wgOut->addHTML(wfMsgWeirdKey ( $this->mTitle->getText() ) ); |
| 2442 | + } else { |
| 2443 | + $wgOut->addHTML(wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) ); |
| 2444 | + } |
2436 | 2445 | } else { |
2437 | 2446 | $dbr =& $this->getDB( DB_SLAVE ); |
2438 | 2447 | $wl_clause = array( |
Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -381,6 +381,25 @@ |
382 | 382 | } |
383 | 383 | |
384 | 384 | /** |
| 385 | + * This function provides the message source for messages to be edited which are *not* stored in the database |
| 386 | +*/ |
| 387 | + |
| 388 | +function wfMsgWeirdKey ( $key ) { |
| 389 | + $subsource = str_replace ( ' ' , '_' , $key ) ; |
| 390 | + $source = wfMsg ( $subsource ) ; |
| 391 | + if ( $source == "<{$subsource}>" ) { |
| 392 | + # Try again with first char lower case |
| 393 | + $subsource = strtolower ( substr ( $subsource , 0 , 1 ) ) . substr ( $subsource , 1 ) ; |
| 394 | + $source = wfMsg ( $subsource ) ; |
| 395 | + } |
| 396 | + if ( $source == "<{$subsource}>" ) { |
| 397 | + # Didn't work either, return blank text |
| 398 | + $source = "" ; |
| 399 | + } |
| 400 | + return $source ; |
| 401 | +} |
| 402 | + |
| 403 | +/** |
385 | 404 | * Fetch a message string value, but don't replace any keys yet. |
386 | 405 | * @param string $key |
387 | 406 | * @param bool $useDB |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -653,6 +653,8 @@ |
654 | 654 | $this->edittime = $this->mArticle->getTimestamp(); |
655 | 655 | $this->textbox1 = $this->mArticle->getContent( true ); |
656 | 656 | $this->summary = ''; |
| 657 | + if ( !$this->mArticle->exists() && $this->mArticle->mTitle->getNamespace() == NS_MEDIAWIKI ) |
| 658 | + $this->textbox1 = wfMsgWeirdKey ( $this->mArticle->mTitle->getText() ) ; |
657 | 659 | wfProxyCheck(); |
658 | 660 | } |
659 | 661 | |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -748,7 +748,12 @@ |
749 | 749 | |
750 | 750 | if( is_string( $source ) ) { |
751 | 751 | if( strcmp( $source, '' ) == 0 ) { |
752 | | - $source = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ); |
| 752 | + global $wgTitle ; |
| 753 | + if ( $wgTitle->getNamespace() == NS_MEDIAWIKI ) { |
| 754 | + $source = wfMsgWeirdKey ( $wgTitle->getText() ) ; |
| 755 | + } else { |
| 756 | + $source = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ); |
| 757 | + } |
753 | 758 | } |
754 | 759 | $rows = $wgUser->getOption( 'rows' ); |
755 | 760 | $cols = $wgUser->getOption( 'cols' ); |