Index: trunk/extensions/ReplaceText/ReplaceText.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | $wgExtensionCredits['specialpage'][] = array( |
25 | 25 | 'path' => __FILE__, |
26 | 26 | 'name' => 'Replace Text', |
27 | | - 'version' => '0.5.3', |
| 27 | + 'version' => '0.6', |
28 | 28 | 'author' => array( 'Yaron Koren', 'Niklas Laxström' ), |
29 | 29 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Replace_Text', |
30 | 30 | 'description' => 'A special page that lets administrators run a global search-and-replace', |
— | — | @@ -35,9 +35,22 @@ |
36 | 36 | $wgExtensionAliasesFiles['ReplaceText'] = $rtgIP . 'ReplaceText.alias.php'; |
37 | 37 | $wgJobClasses['replaceText'] = 'ReplaceTextJob'; |
38 | 38 | $wgAvailableRights[] = 'replacetext'; |
| 39 | +$wgHooks['AdminLinks'][] = 'rtAddToAdminLinks'; |
39 | 40 | |
40 | 41 | // This extension uses its own permission type, 'replacetext' |
41 | 42 | $wgSpecialPages['ReplaceText'] = 'ReplaceText'; |
42 | 43 | $wgSpecialPageGroups['ReplaceText'] = 'wiki'; |
43 | 44 | $wgAutoloadClasses['ReplaceText'] = $rtgIP . 'SpecialReplaceText.php'; |
44 | 45 | $wgAutoloadClasses['ReplaceTextJob'] = $rtgIP . 'ReplaceTextJob.php'; |
| 46 | + |
| 47 | +// This function should really go into a "ReplaceText_body.php" file... |
| 48 | +function rtAddToAdminLinks(&$admin_links_tree) { |
| 49 | + $general_section = $admin_links_tree->getSection(wfMsg('adminlinks_general')); |
| 50 | + $extensions_row = $general_section->getRow('extensions'); |
| 51 | + if (is_null($extensions_row)) { |
| 52 | + $extensions_row = new ALRow('extensions'); |
| 53 | + $general_section->addRow($extensions_row); |
| 54 | + } |
| 55 | + $extensions_row->addItem(ALItem::newFromSpecialPage('ReplaceText')); |
| 56 | + return true; |
| 57 | +} |