r50772 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50771‎ | r50772 | r50773 >
Date:15:23, 19 May 2009
Author:yaron
Status:deferred
Tags:
Comment:
Added Admin Links hook
Modified paths:
  • /trunk/extensions/ReplaceText/ReplaceText.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ReplaceText/ReplaceText.php
@@ -23,7 +23,7 @@
2424 $wgExtensionCredits['specialpage'][] = array(
2525 'path' => __FILE__,
2626 'name' => 'Replace Text',
27 - 'version' => '0.5.3',
 27+ 'version' => '0.6',
2828 'author' => array( 'Yaron Koren', 'Niklas Laxström' ),
2929 'url' => 'http://www.mediawiki.org/wiki/Extension:Replace_Text',
3030 'description' => 'A special page that lets administrators run a global search-and-replace',
@@ -35,9 +35,22 @@
3636 $wgExtensionAliasesFiles['ReplaceText'] = $rtgIP . 'ReplaceText.alias.php';
3737 $wgJobClasses['replaceText'] = 'ReplaceTextJob';
3838 $wgAvailableRights[] = 'replacetext';
 39+$wgHooks['AdminLinks'][] = 'rtAddToAdminLinks';
3940
4041 // This extension uses its own permission type, 'replacetext'
4142 $wgSpecialPages['ReplaceText'] = 'ReplaceText';
4243 $wgSpecialPageGroups['ReplaceText'] = 'wiki';
4344 $wgAutoloadClasses['ReplaceText'] = $rtgIP . 'SpecialReplaceText.php';
4445 $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+}

Status & tagging log