Index: trunk/phase3/includes/Article.php |
— | — | @@ -1160,7 +1160,7 @@ |
1161 | 1161 | /** |
1162 | 1162 | * @return string Complete article text, or null if error |
1163 | 1163 | */ |
1164 | | - function replaceSection($section, $text, $summary = '', $edittime = NULL) { |
| 1164 | + function replaceSection($section, $text, &$summary = '', $edittime = NULL) { |
1165 | 1165 | wfProfileIn( __METHOD__ ); |
1166 | 1166 | |
1167 | 1167 | if( $section == '' ) { |
— | — | @@ -1181,7 +1181,9 @@ |
1182 | 1182 | |
1183 | 1183 | if( $section == 'new' ) { |
1184 | 1184 | # Inserting a new section |
1185 | | - $subject = $summary ? wfMsgForContent('editsummaryheading',$summary) . "\n\n" : ''; |
| 1185 | + $subject = $summary ? wfMsgForContent('newsectionheaderdefaultlevel',$summary) . "\n\n" : ''; |
| 1186 | + # Heading has been added to text, now wrap comment for RC linking to heading |
| 1187 | + $summary = "/* {$summary} */"; |
1186 | 1188 | $text = strlen( trim( $oldtext ) ) > 0 |
1187 | 1189 | ? "{$oldtext}\n\n{$subject}{$text}" |
1188 | 1190 | : "{$subject}{$text}"; |
— | — | @@ -1200,14 +1202,16 @@ |
1201 | 1203 | /** |
1202 | 1204 | * @deprecated use Article::doEdit() |
1203 | 1205 | */ |
1204 | | - function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) { |
| 1206 | + function insertNewArticle( $text, &$summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) { |
1205 | 1207 | $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY | |
1206 | 1208 | ( $isminor ? EDIT_MINOR : 0 ) | |
1207 | 1209 | ( $suppressRC ? EDIT_SUPPRESS_RC : 0 ); |
1208 | 1210 | |
1209 | 1211 | # If this is a comment, add the summary as headline |
1210 | 1212 | if ( $comment && $summary != "" ) { |
1211 | | - $text = wfMsgForContent('editsummaryheading',$summary) . "\n\n" . $text; |
| 1213 | + $text = wfMsgForContent('newsectionheaderdefaultlevel',$summary) . "\n\n".$text; |
| 1214 | + # Heading has been added to text, now wrap comment for RC linking to heading |
| 1215 | + $summary = "/* {$summary} */"; |
1212 | 1216 | } |
1213 | 1217 | |
1214 | 1218 | $this->doEdit( $text, $summary, $flags ); |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -709,7 +709,7 @@ |
710 | 710 | 'feed-rss' => 'RSS', # only translate this message to other languages if you have to change it |
711 | 711 | 'sitenotice' => '-', # the equivalent to wgSiteNotice; don't translate or duplicate this message to other languages |
712 | 712 | 'anonnotice' => '-', # don't translate or duplicate this message to other languages |
713 | | -'editsummaryheading' => '== $1 ==', # don't translate or duplicate this message to other languages |
| 713 | +'newsectionheaderdefaultlevel' => '== $1 ==', # don't translate or duplicate this message to other languages |
714 | 714 | |
715 | 715 | # Short words for each namespace, by default used in the 'article' tab in monobook |
716 | 716 | 'nstab-main' => 'Article', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -194,8 +194,8 @@ |
195 | 195 | text for a non-existent page |
196 | 196 | * (bug 11022) Use a more accurate page title for Special:Whatlinkshere and |
197 | 197 | Special:Recentchangeslinked |
198 | | -* Add 'editsummaryheading' message to allow modification of the heading |
199 | | - formatting for new sections (when section=new argument is supplied) |
| 198 | +* Add 'newsectionheaderdefaultlevel' message to allow modification of the |
| 199 | + heading formatting for new sections when section=new argument is supplied |
200 | 200 | |
201 | 201 | == Bugfixes since 1.10 == |
202 | 202 | |
— | — | @@ -429,7 +429,7 @@ |
430 | 430 | * (bug 8393) <sup> and <sub> need to be preserved (without attributes) for |
431 | 431 | entries in the table of contents |
432 | 432 | * (bug 11114) Fix regression in read-only mode error display during editing |
433 | | -* (bug 9426) Some way to specify heading level for new sections |
| 433 | +* (bug 10836) Change the summary on creating of new section |
434 | 434 | |
435 | 435 | == API changes since 1.10 == |
436 | 436 | |