Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -1475,6 +1475,13 @@ |
1476 | 1476 | Change $result and return false to give a definitive answer, otherwise |
1477 | 1477 | the built-in rate limiting checks are used, if enabled. |
1478 | 1478 | |
| 1479 | +'PlaceNewSection': Override placement of new sections. |
| 1480 | +$wikipage : WikiPage object |
| 1481 | +$oldtext : the text of the article before editing |
| 1482 | +$subject : subject of the new section |
| 1483 | +&$text : text of the new section |
| 1484 | +Return false and put the merged text into $text to override the default behavior. |
| 1485 | + |
1479 | 1486 | 'PrefixSearchBackend': Override the title prefix search used for OpenSearch and |
1480 | 1487 | AJAX search suggestions. Put results into &$results outparam and return false. |
1481 | 1488 | $ns : array of int namespace keys to search in |
Index: trunk/phase3/CREDITS |
— | — | @@ -139,6 +139,7 @@ |
140 | 140 | * Nathan Larson |
141 | 141 | * nephele |
142 | 142 | * Nik |
| 143 | +* Nx.devnull |
143 | 144 | * Nikolaos S. Karastathis |
144 | 145 | * Olaf Lenz |
145 | 146 | * Paul Copperman |
Index: trunk/phase3/includes/WikiPage.php |
— | — | @@ -977,9 +977,11 @@ |
978 | 978 | if ( $section == 'new' ) { |
979 | 979 | # Inserting a new section |
980 | 980 | $subject = $summary ? wfMsgForContent( 'newsectionheaderdefaultlevel', $summary ) . "\n\n" : ''; |
981 | | - $text = strlen( trim( $oldtext ) ) > 0 |
| 981 | + if ( wfRunHooks( 'PlaceNewSection', array( $this, $oldtext, $subject, &$text ) ) ) { |
| 982 | + $text = strlen( trim( $oldtext ) ) > 0 |
982 | 983 | ? "{$oldtext}\n\n{$subject}{$text}" |
983 | 984 | : "{$subject}{$text}"; |
| 985 | + } |
984 | 986 | } else { |
985 | 987 | # Replacing an existing section; roll out the big guns |
986 | 988 | global $wgParser; |