From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- extensions/Cite/Cite.php | 111 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 extensions/Cite/Cite.php (limited to 'extensions/Cite/Cite.php') diff --git a/extensions/Cite/Cite.php b/extensions/Cite/Cite.php new file mode 100644 index 00000000..0f957659 --- /dev/null +++ b/extensions/Cite/Cite.php @@ -0,0 +1,111 @@ + and for adding + * citations to pages + * + * @file + * @ingroup Extensions + * + * @link http://www.mediawiki.org/wiki/Extension:Cite/Cite.php Documentation + * + * @bug 4579 + * + * @author Ævar Arnfjörð Bjarmason + * @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'][] = 'wfCite'; +$wgHooks['BeforePageDisplay'][] = 'wfCiteBeforePageDisplay'; + + +$wgExtensionCredits['parserhook'][] = array( + 'path' => __FILE__, + 'name' => 'Cite', + 'author' => 'Ævar Arnfjörð Bjarmason', + 'descriptionmsg' => 'cite-desc', + 'url' => 'https://www.mediawiki.org/wiki/Extension:Cite/Cite.php' +); +$wgParserTestFiles[] = dirname( __FILE__ ) . "/citeParserTests.txt"; +$wgParserTestFiles[] = dirname( __FILE__ ) . "/citeCatTreeParserTests.txt"; +$wgExtensionMessagesFiles['Cite'] = dirname( __FILE__ ) . "/Cite.i18n.php"; +$wgAutoloadClasses['Cite'] = dirname( __FILE__ ) . "/Cite_body.php"; +$wgSpecialPageGroups['Cite'] = 'pagetools'; + +define( 'CITE_DEFAULT_GROUP', '' ); +/** + * 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 output. + */ +$wgCiteCacheReferences = false; + +/** + * Enables experimental popups + */ +$wgCiteEnablePopups = false; + +/** + * Performs the hook registration. + * Note that several extensions (and even core!) try to detect if Cite is + * installed by looking for wfCite(). + * + * @param $parser Parser + * + * @return bool + */ +function wfCite( $parser ) { + return Cite::setHooks( $parser ); +} + +// Resources +$citeResourceTemplate = array( + 'localBasePath' => dirname(__FILE__) . '/modules', + 'remoteExtPath' => 'Cite/modules' +); + +$wgResourceModules['ext.cite'] = $citeResourceTemplate + array( + 'styles' => array(), + 'scripts' => 'ext.cite/ext.cite.js', + 'position' => 'bottom', + 'dependencies' => array( + 'jquery.tooltip', + ), +); + +$wgResourceModules['jquery.tooltip'] = $citeResourceTemplate + array( + 'styles' => 'jquery.tooltip/jquery.tooltip.css', + 'scripts' => 'jquery.tooltip/jquery.tooltip.js', + 'position' => 'bottom', +); + +/* Add RTL fix for the cite elements */ +$wgResourceModules['ext.rtlcite'] = $citeResourceTemplate + array( + 'styles' => 'ext.rtlcite/ext.rtlcite.css', + 'position' => 'top', +); + +/** + * @param $out OutputPage + * @param $sk Skin + * @return bool + */ +function wfCiteBeforePageDisplay( $out, &$sk ) { + global $wgCiteEnablePopups; + + if ( $wgCiteEnablePopups ) { + $out->addModules( 'ext.cite' ); + } + + /* RTL support quick-fix module */ + $out->addModuleStyles( 'ext.rtlcite' ); + return true; +} + +/**#@-*/ -- cgit v1.2.2