Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -1486,6 +1486,10 @@ |
1487 | 1487 | &$text : text of the new section |
1488 | 1488 | Return false and put the merged text into $text to override the default behavior. |
1489 | 1489 | |
| 1490 | +'PreferencesGetLegend': Override the text used for the <legend> of a preferences section |
| 1491 | +$key: the section name |
| 1492 | +&$legend: the legend text. Defaults to wfMsg( "prefs-$key" ) but may be overridden |
| 1493 | + |
1490 | 1494 | 'PrefixSearchBackend': Override the title prefix search used for OpenSearch and |
1491 | 1495 | AJAX search suggestions. Put results into &$results outparam and return false. |
1492 | 1496 | $ns : array of int namespace keys to search in |
Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -1565,4 +1565,14 @@ |
1566 | 1566 | function getBody() { |
1567 | 1567 | return $this->displaySection( $this->mFieldTree, '', 'mw-prefsection-' ); |
1568 | 1568 | } |
| 1569 | + |
| 1570 | + /** |
| 1571 | + * Get the <legend> for a given section key. Normally this is the |
| 1572 | + * prefs-$key message but we'll allow extensions to override it. |
| 1573 | + */ |
| 1574 | + function getLegend( $key ) { |
| 1575 | + $legend = parent::getLegend( $key ); |
| 1576 | + wfRunHooks( 'PreferencesGetLegend', array( $key, &$legend ) ); |
| 1577 | + return $legend; |
| 1578 | + } |
1569 | 1579 | } |