2007-11-21 16:26:54 +00:00
|
|
|
<?php
|
2009-08-27 13:02:57 +00:00
|
|
|
/**
|
2007-11-21 16:26:54 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2009-08-27 13:02:57 +00:00
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
2012-04-25 09:06:05 +00:00
|
|
|
* @version 3.0
|
2007-11-21 16:26:54 +00:00
|
|
|
* @author Stephanie Amanda Stevens <phroziac@gmail.com>
|
2011-07-19 12:45:38 +00:00
|
|
|
* @author Robin Pepermans (SPQRobin) <robinp.1273@gmail.com>
|
2009-08-27 13:02:57 +00:00
|
|
|
* @copyright Copyright © 2005-2007 Stephanie Amanda Stevens
|
2011-07-19 12:45:38 +00:00
|
|
|
* @copyright Copyright © 2007-2011 Robin Pepermans (SPQRobin)
|
2007-11-21 16:26:54 +00:00
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
|
2009-08-27 13:02:57 +00:00
|
|
|
* @link http://www.mediawiki.org/wiki/Extension:SpecialInterwiki Documentation
|
2007-11-21 16:26:54 +00:00
|
|
|
* Formatting improvements Stephen Kennedy, 2006.
|
|
|
|
*/
|
|
|
|
|
2012-04-25 08:53:49 +00:00
|
|
|
if ( !defined( 'MEDIAWIKI' ) ) {
|
2009-08-27 13:02:57 +00:00
|
|
|
die( "This is not a valid entry point.\n" );
|
|
|
|
}
|
2007-11-21 16:26:54 +00:00
|
|
|
|
2012-04-25 10:45:17 +00:00
|
|
|
// Set this value to true in LocalSettings.php if you will not use this
|
|
|
|
// extension to actually change any interwiki table entries. It will suppress
|
|
|
|
// the addition of a log for interwiki link changes.
|
2012-04-25 10:42:12 +00:00
|
|
|
$wgInterwikiViewOnly = false;
|
|
|
|
|
2009-08-27 13:02:57 +00:00
|
|
|
// Extension credits for Special:Version
|
2007-11-21 16:26:54 +00:00
|
|
|
$wgExtensionCredits['specialpage'][] = array(
|
2009-08-27 13:02:57 +00:00
|
|
|
'path' => __FILE__,
|
2012-01-13 09:35:24 +00:00
|
|
|
'name' => 'Interwiki',
|
2012-05-21 10:58:07 +00:00
|
|
|
'author' => array( 'Stephanie Amanda Stevens', 'Alexandre Emsenhuber', 'Robin Pepermans', 'Siebrand Mazeland', 'Platonides', 'Raimond Spekking', 'Sam Reed', '...' ),
|
2012-04-25 10:42:12 +00:00
|
|
|
'version' => '2.2 20120425',
|
2012-01-13 09:35:24 +00:00
|
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:Interwiki',
|
2008-02-11 13:29:16 +00:00
|
|
|
'descriptionmsg' => 'interwiki-desc',
|
2007-11-21 16:26:54 +00:00
|
|
|
);
|
|
|
|
|
2012-04-25 10:42:12 +00:00
|
|
|
$wgExtensionFunctions[] = 'setupInterwikiExtension';
|
|
|
|
|
2012-05-21 13:29:32 +00:00
|
|
|
$wgResourceModules['ext.interwiki.specialpage'] = array(
|
2012-04-25 08:53:49 +00:00
|
|
|
'styles' => 'Interwiki.css',
|
|
|
|
'localBasePath' => dirname( __FILE__ ),
|
|
|
|
'remoteExtPath' => 'Interwiki',
|
2012-05-21 13:29:32 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'jquery.makeCollapsible',
|
|
|
|
),
|
2011-07-19 12:45:38 +00:00
|
|
|
);
|
|
|
|
|
2009-08-27 13:02:57 +00:00
|
|
|
// Set up the new special page
|
|
|
|
$dir = dirname( __FILE__ ) . '/';
|
2010-04-17 22:52:42 +00:00
|
|
|
$wgExtensionMessagesFiles['Interwiki'] = $dir . 'Interwiki.i18n.php';
|
2011-12-25 23:09:26 +00:00
|
|
|
$wgExtensionMessagesFiles['InterwikiAlias'] = $dir . 'Interwiki.alias.php';
|
2010-04-17 22:52:42 +00:00
|
|
|
$wgAutoloadClasses['SpecialInterwiki'] = $dir . 'Interwiki_body.php';
|
2012-04-25 11:23:01 +00:00
|
|
|
$wgAutoloadClasses['InterwikiLogFormatter'] = $dir . 'Interwiki_body.php';
|
2008-04-03 21:00:22 +00:00
|
|
|
$wgSpecialPages['Interwiki'] = 'SpecialInterwiki';
|
2009-02-10 00:40:30 +00:00
|
|
|
$wgSpecialPageGroups['Interwiki'] = 'wiki';
|
2008-04-03 21:00:22 +00:00
|
|
|
|
2012-04-25 10:42:12 +00:00
|
|
|
function setupInterwikiExtension() {
|
2012-04-25 11:27:49 +00:00
|
|
|
global $wgInterwikiViewOnly;
|
2012-04-25 10:42:12 +00:00
|
|
|
|
2012-04-25 11:20:18 +00:00
|
|
|
if ( $wgInterwikiViewOnly === false ) {
|
2012-04-25 11:27:49 +00:00
|
|
|
global $wgAvailableRights, $wgLogTypes, $wgLogActionsHandlers;
|
|
|
|
|
2012-04-25 10:42:12 +00:00
|
|
|
// New user right, required to modify the interwiki table through Special:Interwiki
|
|
|
|
$wgAvailableRights[] = 'interwiki';
|
2008-05-29 18:38:56 +00:00
|
|
|
|
2012-04-25 10:42:12 +00:00
|
|
|
// Set up the new log type - interwiki actions are logged to this new log
|
|
|
|
$wgLogTypes[] = 'interwiki';
|
|
|
|
# interwiki, iw_add, iw_delete, iw_edit
|
|
|
|
$wgLogActionsHandlers['interwiki/*'] = 'InterwikiLogFormatter';
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|