Added support for separate noarticletextanon
authorTom Gilder <tomgilder@users.mediawiki.org>
Thu, 6 Oct 2005 14:20:45 +0000 (14:20 +0000)
committerTom Gilder <tomgilder@users.mediawiki.org>
Thu, 6 Oct 2005 14:20:45 +0000 (14:20 +0000)
includes/Article.php
includes/EditPage.php
includes/OutputPage.php
languages/Language.php

index 6775cff..cf4c713 100644 (file)
@@ -105,7 +105,7 @@ class Article {
                        }
                        wfProfileOut( $fname );
                        $wgOut->setRobotpolicy( 'noindex,nofollow' );
-                       return wfMsg( 'noarticletext' );
+                       return wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
                } else {
                        $this->loadContent( $noredir );
                        # check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page
@@ -2421,7 +2421,7 @@ class Article {
         * @access public
         */
        function info() {
-               global $wgLang, $wgOut, $wgAllowPageInfo;
+               global $wgLang, $wgOut, $wgAllowPageInfo, $wgUser;
                $fname = 'Article::info';
 
                if ( !$wgAllowPageInfo ) {
@@ -2437,7 +2437,7 @@ class Article {
                # first, see if the page exists at all.
                $exists = $page->getArticleId() != 0;
                if( !$exists ) {
-                       $wgOut->addHTML( wfMsg('noarticletext') );
+                       $wgOut->addHTML( wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) );
                } else {
                        $dbr =& $this->getDB( DB_SLAVE );
                        $wl_clause = array(
index 88100c2..d64bb14 100644 (file)
@@ -1315,13 +1315,15 @@ END
         * @return string HTML
         */
        function getDiff() {
+               global $wgUser;
+
                require_once( 'DifferenceEngine.php' );
                $oldtext = $this->mArticle->fetchContent();
                $newtext = $this->mArticle->replaceSection(
                        $this->section, $this->textbox1, $this->summary, $this->edittime );
                $oldtitle = wfMsg( 'currentrev' );
                $newtitle = wfMsg( 'yourtext' );
-               if ( $oldtext != wfMsg( 'noarticletext' ) || $newtext != '' ) {
+               if ( $oldtext != wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) || $newtext != '' ) {
                        $difftext = DifferenceEngine::getDiff( $oldtext, $newtext, $oldtitle, $newtitle );
                }
 
index 2c960bd..0c24e89 100644 (file)
@@ -687,7 +687,7 @@ class OutputPage {
 
                if( is_string( $source ) ) {
                        if( strcmp( $source, '' ) == 0 ) {
-                               $source = wfMsg( 'noarticletext' );
+                               $source = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
                        }
                        $rows = $wgUser->getOption( 'rows' );
                        $cols = $wgUser->getOption( 'cols' );
index f4fadf8..a3aa0c8 100644 (file)
@@ -707,6 +707,7 @@ If you are here by mistake, just click your browser's '''back''' button.",
 'talkpagetext' => '<!-- MediaWiki:talkpagetext -->',
 'anontalkpagetext' => "----''This is the discussion page for an anonymous user who has not created an account yet or who does not use it. We therefore have to use the numerical [[IP address]] to identify him/her. Such an IP address can be shared by several users. If you are an anonymous user and feel that irrelevant comments have been directed at you, please [[Special:Userlogin|create an account or log in]] to avoid future confusion with other anonymous users.'' ",
 'noarticletext' => 'There is currently no text in this page, you can [[{{ns:special}}:Search/{{PAGENAME}}|search for this page title]] in other pages or [{{fullurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} edit this page].',
+'noarticletextanon' => '{{int:noarticletext}}',
 'clearyourcache' => "'''Note:''' After saving, you may have to bypass your browser's cache to see the changes. '''Mozilla / Firefox / Safari:''' hold down ''Shift'' while clicking ''Reload'', or press ''Ctrl-Shift-R'' (''Cmd-Shift-R'' on Apple Mac); '''IE:''' hold ''Ctrl'' while clicking ''Refresh'', or press ''Ctrl-F5''; '''Konqueror:''': simply click the ''Reload'' button, or press ''F5''; '''Opera''' users may need to completely clear their cache in ''Tools&rarr;Preferences''.",
 'usercssjsyoucanpreview' => "<strong>Tip:</strong> Use the 'Show preview' button to test your new CSS/JS before saving.",
 'usercsspreview' => "'''Remember that you are only previewing your user CSS, it has not yet been saved!'''",