mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-23 22:45:20 +00:00
Merge "Add extension.json, empty PHP entry point"
This commit is contained in:
commit
3ef20f7d4b
83
Cite.php
83
Cite.php
|
@ -1,73 +1,14 @@
|
|||
<?php
|
||||
if ( ! defined( 'MEDIAWIKI' ) )
|
||||
die();
|
||||
/**#@+
|
||||
* A parser extension that adds two tags, <ref> and <references> for adding
|
||||
* citations to pages
|
||||
*
|
||||
* @file
|
||||
* @ingroup Extensions
|
||||
*
|
||||
* @link http://www.mediawiki.org/wiki/Extension:Cite Documentation
|
||||
*
|
||||
* @bug 4579
|
||||
*
|
||||
* @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
|
||||
* @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
|
||||
*/
|
||||
|
||||
$wgHooks['ParserFirstCallInit'][] = 'Cite::setHooks';
|
||||
|
||||
$wgExtensionCredits['parserhook'][] = array(
|
||||
'path' => __FILE__,
|
||||
'name' => 'Cite',
|
||||
'author' => array(
|
||||
'Ævar Arnfjörð Bjarmason',
|
||||
'Andrew Garrett',
|
||||
'Brion Vibber',
|
||||
'Marius Hoch',
|
||||
'Steve Sanbeg'
|
||||
),
|
||||
'descriptionmsg' => 'cite-desc',
|
||||
'license-name' => 'GPL-2.0+',
|
||||
'url' => 'https://www.mediawiki.org/wiki/Extension:Cite'
|
||||
);
|
||||
|
||||
$wgParserTestFiles[] = __DIR__ . "/citeParserTests.txt";
|
||||
$wgMessagesDirs['Cite'] = __DIR__ . '/i18n';
|
||||
$wgAutoloadClasses['Cite'] = __DIR__ . "/Cite_body.php";
|
||||
|
||||
/**
|
||||
* The emergency shut-off switch. Override in local settings to disable
|
||||
* groups; or remove all references from this file to enable unconditionally
|
||||
*/
|
||||
$wgAllowCiteGroups = true;
|
||||
|
||||
/**
|
||||
* An emergency optimisation measure for caching cite <references /> output.
|
||||
*/
|
||||
$wgCiteCacheReferences = false;
|
||||
|
||||
// Resources
|
||||
$citeResourceTemplate = array(
|
||||
'localBasePath' => __DIR__ . '/modules',
|
||||
'remoteExtPath' => 'Cite/modules'
|
||||
);
|
||||
|
||||
$wgResourceModules['ext.cite'] = $citeResourceTemplate + array(
|
||||
'scripts' => 'ext.cite.js',
|
||||
'styles' => 'ext.cite.css',
|
||||
'messages' => array(
|
||||
'cite_references_link_accessibility_label',
|
||||
'cite_references_link_many_accessibility_label',
|
||||
),
|
||||
);
|
||||
|
||||
/* Add RTL fix for the cite <sup> elements */
|
||||
$wgResourceModules['ext.rtlcite'] = $citeResourceTemplate + array(
|
||||
'styles' => 'ext.rtlcite.css',
|
||||
'position' => 'top',
|
||||
);
|
||||
|
||||
/**#@-*/
|
||||
if ( function_exists( 'wfLoadExtension' ) ) {
|
||||
wfLoadExtension( 'Cite' );
|
||||
// Keep i18n globals so mergeMessageFileList.php doesn't break
|
||||
$wgMessagesDirs['Cite'] = __DIR__ . '/i18n';
|
||||
/* wfWarn(
|
||||
'Deprecated PHP entry point used for Cite extension. Please use wfLoadExtension instead, ' .
|
||||
'see https://www.mediawiki.org/wiki/Extension_registration for more details.'
|
||||
); */
|
||||
return true;
|
||||
} else {
|
||||
die( 'This version of the Cite extension requires MediaWiki 1.25+' );
|
||||
}
|
||||
|
|
52
extension.json
Normal file
52
extension.json
Normal file
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
"name": "Cite",
|
||||
"author": [
|
||||
"Ævar Arnfjörð Bjarmason",
|
||||
"Andrew Garrett",
|
||||
"Brion Vibber",
|
||||
"Marius Hoch",
|
||||
"Steve Sanbeg"
|
||||
],
|
||||
"url": "https://www.mediawiki.org/wiki/Extension:Cite",
|
||||
"descriptionmsg": "cite-desc",
|
||||
"license-name": "GPL-2.0+",
|
||||
"type": "parserhook",
|
||||
"MessagesDirs": {
|
||||
"Cite": [
|
||||
"i18n"
|
||||
]
|
||||
},
|
||||
"Hooks": {
|
||||
"ParserFirstCallInit": [
|
||||
"Cite::setHooks"
|
||||
]
|
||||
},
|
||||
"ResourceModules": {
|
||||
"ext.cite": {
|
||||
"scripts": "ext.cite.js",
|
||||
"styles": "ext.cite.css",
|
||||
"messages": [
|
||||
"cite_references_link_accessibility_label",
|
||||
"cite_references_link_many_accessibility_label"
|
||||
]
|
||||
},
|
||||
"ext.rtlcite": {
|
||||
"styles": "ext.rtlcite.css",
|
||||
"position": "top"
|
||||
}
|
||||
},
|
||||
"ResourceFileModulePaths": {
|
||||
"localBasePath": "modules",
|
||||
"remoteExtPath": "Cite/modules"
|
||||
},
|
||||
"config": {
|
||||
"AllowCiteGroups": true,
|
||||
"CiteCacheReferences": false
|
||||
},
|
||||
"AutoloadClasses": {
|
||||
"Cite": "Cite_body.php"
|
||||
},
|
||||
"ParserTestFiles": [
|
||||
"citeParserTests.txt"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue