2008-04-29 14:43:25 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Replace Text - a MediaWiki extension that provides a special page to
|
|
|
|
* allow administrators to do a global string find-and-replace on all the
|
|
|
|
* content pages of a wiki.
|
|
|
|
*
|
2009-01-08 05:48:38 +00:00
|
|
|
* http://www.mediawiki.org/wiki/Extension:Replace_Text
|
2008-04-29 14:43:25 +00:00
|
|
|
*
|
|
|
|
* The special page created is 'Special:ReplaceText', and it provides
|
|
|
|
* a form to do a global search-and-replace, with the changes to every
|
|
|
|
* page showing up as a wiki edit, with the administrator who performed
|
|
|
|
* the replacement as the user, and an edit summary that looks like
|
|
|
|
* "Text replace: 'search string' * to 'replacement string'".
|
|
|
|
*
|
|
|
|
* If the replacement string is blank, or is already found in the wiki,
|
|
|
|
* the page provides a warning prompt to the user before doing the
|
|
|
|
* replacement, since it is not easily reversible.
|
|
|
|
*/
|
|
|
|
|
2009-04-27 09:02:48 +00:00
|
|
|
if ( !defined( 'MEDIAWIKI' ) ) die();
|
2008-04-29 14:43:25 +00:00
|
|
|
|
2008-08-06 16:13:25 +00:00
|
|
|
// credits
|
|
|
|
$wgExtensionCredits['specialpage'][] = array(
|
2009-04-27 03:15:19 +00:00
|
|
|
'path' => __FILE__,
|
2008-08-06 16:13:25 +00:00
|
|
|
'name' => 'Replace Text',
|
2009-05-08 20:02:34 +00:00
|
|
|
'version' => '0.5.3',
|
2009-04-27 08:52:10 +00:00
|
|
|
'author' => array( 'Yaron Koren', 'Niklas Laxström' ),
|
2008-08-06 16:13:25 +00:00
|
|
|
'url' => 'http://www.mediawiki.org/wiki/Extension:Replace_Text',
|
|
|
|
'description' => 'A special page that lets administrators run a global search-and-replace',
|
|
|
|
'descriptionmsg' => 'replacetext-desc',
|
|
|
|
);
|
|
|
|
|
2009-04-27 09:02:48 +00:00
|
|
|
$rtgIP = dirname( __FILE__ ) . '/';
|
2009-04-07 19:03:31 +00:00
|
|
|
$wgExtensionMessagesFiles['ReplaceText'] = $rtgIP . 'ReplaceText.i18n.php';
|
|
|
|
$wgExtensionAliasesFiles['ReplaceText'] = $rtgIP . 'ReplaceText.alias.php';
|
2008-05-12 20:34:19 +00:00
|
|
|
$wgJobClasses['replaceText'] = 'ReplaceTextJob';
|
2009-01-08 10:13:33 +00:00
|
|
|
$wgAvailableRights[] = 'replacetext';
|
2008-05-12 20:34:19 +00:00
|
|
|
|
2008-08-06 16:13:25 +00:00
|
|
|
// This extension uses its own permission type, 'replacetext'
|
2009-01-08 10:13:33 +00:00
|
|
|
$wgSpecialPages['ReplaceText'] = 'ReplaceText';
|
2008-12-29 18:29:23 +00:00
|
|
|
$wgSpecialPageGroups['ReplaceText'] = 'wiki';
|
2009-04-07 19:03:31 +00:00
|
|
|
$wgAutoloadClasses['ReplaceText'] = $rtgIP . 'SpecialReplaceText.php';
|
|
|
|
$wgAutoloadClasses['ReplaceTextJob'] = $rtgIP . 'ReplaceTextJob.php';
|