Index: trunk/phase3/includes/Article.php |
— | — | @@ -1253,14 +1253,23 @@ |
1254 | 1254 | // Use the default message text |
1255 | 1255 | $text = $this->getContent(); |
1256 | 1256 | } else { |
| 1257 | + # If it is a user (talk) page of the current user, add true as parameter, otherwise false. |
| 1258 | + $isCurrent = false; |
| 1259 | + if ( ( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) |
| 1260 | + && $wgUser->getName() == $this->mTitle->getBaseText() ) |
| 1261 | + { |
| 1262 | + $isCurrent = true; |
| 1263 | + } |
| 1264 | + |
| 1265 | + # Don't show option "create this page" in the message if the user isn't allowed to. |
1257 | 1266 | $createErrors = $this->mTitle->getUserPermissionsErrors( 'create', $wgUser ); |
1258 | 1267 | $editErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser ); |
1259 | 1268 | $errors = array_merge( $createErrors, $editErrors ); |
1260 | 1269 | |
1261 | 1270 | if ( !count( $errors ) ) |
1262 | | - $text = wfMsgNoTrans( 'noarticletext' ); |
| 1271 | + $text = wfMsgNoTrans( 'noarticletext', $isCurrent ); |
1263 | 1272 | else |
1264 | | - $text = wfMsgNoTrans( 'noarticletext-nopermission' ); |
| 1273 | + $text = wfMsgNoTrans( 'noarticletext-nopermission', $isCurrent ); |
1265 | 1274 | } |
1266 | 1275 | $text = "<div class='noarticletext'>\n$text\n</div>"; |
1267 | 1276 | if ( !$this->hasViewableContent() ) { |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -722,10 +722,19 @@ |
723 | 723 | } |
724 | 724 | # Try to add a custom edit intro, or use the standard one if this is not possible. |
725 | 725 | if ( !$this->showCustomIntro() && !$this->mTitle->exists() ) { |
| 726 | + # If it is a user (talk) page of the current user, add true as parameter, otherwise false. |
| 727 | + $isCurrent = false; |
| 728 | + if ( ( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) |
| 729 | + && $wgUser->getName() == $this->mTitle->getBaseText() ) |
| 730 | + { |
| 731 | + $isCurrent = true; |
| 732 | + } |
| 733 | + |
| 734 | + # Show standard message |
726 | 735 | if ( $wgUser->isLoggedIn() ) { |
727 | | - $wgOut->wrapWikiMsg( "<div class=\"mw-newarticletext\">\n$1</div>", 'newarticletext' ); |
| 736 | + $wgOut->wrapWikiMsg( "<div class=\"mw-newarticletext\">\n$1</div>", array( 'newarticletext', $isCurrent ) ); |
728 | 737 | } else { |
729 | | - $wgOut->wrapWikiMsg( "<div class=\"mw-newarticletextanon\">\n$1</div>", 'newarticletextanon' ); |
| 738 | + $wgOut->wrapWikiMsg( "<div class=\"mw-newarticletextanon\">\n$1</div>", array( 'newarticletext', $isCurrent ) ); |
730 | 739 | } |
731 | 740 | } |
732 | 741 | # Give a notice if the user is editing a deleted/moved page... |
Index: trunk/phase3/languages/messages/MessagesQqq.php |
— | — | @@ -795,11 +795,17 @@ |
796 | 796 | |
797 | 797 | {{doc-important|Do not translate \"<nowiki>[[User talk:\$1|\$1]]</nowiki>\" and ''Special:ChangePassword''.}}", |
798 | 798 | 'newarticle' => '{{Identical|New}}', |
799 | | -'newarticletext' => "Text displayed above the edit box in editor when trying to create a new page.<br />'''Very important:''' leave <tt><nowiki>{{MediaWiki:Helppage}}</nowiki></tt> exactly as it is!", |
| 799 | +'newarticletext' => "Text displayed above the edit box in editor when trying to create a new page.<br />'''Very important:''' leave <tt><nowiki>{{MediaWiki:Helppage}}</nowiki></tt> exactly as it is! |
| 800 | + |
| 801 | +$1 is true when the page is a user (talk) page of the current user, otherwise false.", |
800 | 802 | 'noarticletext' => 'This is the message that you get if you search for a term that has not yet got any entries on the wiki. |
801 | 803 | |
802 | | -See also {{msg-mw|Noarticletext-nopermission}}.', |
803 | | -'noarticletext-nopermission' => 'See also {{msg-mw|Noarticletext}}.', |
| 804 | +See also {{msg-mw|Noarticletext-nopermission}}. |
| 805 | + |
| 806 | +$1 is true when the page is a user (talk) page of the current user, otherwise false.', |
| 807 | +'noarticletext-nopermission' => 'See also {{msg-mw|Noarticletext}}. |
| 808 | + |
| 809 | +$1 is true when the page is a user (talk) page of the current user, otherwise false.', |
804 | 810 | 'userpage-userdoesnotexist' => 'Error message displayed when trying to edit or create a page or a subpage that belongs to a user who is not registered on the wiki', |
805 | 811 | 'userpage-userdoesnotexist-view' => 'Shown in user pages of non existing users. See for example [http://translatewiki.net/wiki/User:Foo User:Foo].', |
806 | 812 | 'clearyourcache' => 'Text at the top of .js/.css pages', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -26,7 +26,9 @@ |
27 | 27 | * (bug 10183) Users can now add personal styles and scripts to all skins via |
28 | 28 | User:<name>/common.css and /common.js (if user css/js is enabled) |
29 | 29 | * (bug 22748) Add anchors on Special:ListGroupRights |
30 | | - |
| 30 | +* (bug 22756) Adding a parameter to noarticletext/newarticletext which indicates |
| 31 | + if it's the current user's user (talk) page ($1 is true in that case) |
| 32 | + |
31 | 33 | === Bug fixes in 1.17 === |
32 | 34 | * (bug 17560) Half-broken deletion moved image files to deletion archive without |
33 | 35 | updating DB |