Skip to content

Commit

Permalink
switch to extension registration, proper i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontalvo3 committed Nov 4, 2016
1 parent fc5a159 commit 8ba71ea
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
34 changes: 13 additions & 21 deletions HeaderFooter.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
<?php
/**
* @author Jean-Lou Dupont
* @author Jamesmontalvo3
* @package HeaderFooter
* @version 2.1.1
*/

# Credits
$GLOBALS['wgExtensionCredits']['other'][] = array(
'name' => 'HeaderFooter',
'version' => '2.1.1',
'author' => 'Jean-Lou Dupont, James Montalvo, Douglas Mason',
'description' => 'Enables per-page/per-namespace headers and footers',
'url' => 'http://mediawiki.org/wiki/Extension:HeaderFooter',
);

# Hooks
$GLOBALS['wgHooks']['OutputPageParserOutput'][] = 'HeaderFooter::hOutputPageParserOutput';

# Autoload
$GLOBALS['wgAutoloadClasses']['HeaderFooter'] = __DIR__ . '/HeaderFooter.class.php';
if ( function_exists( 'wfLoadExtension' ) ) {
wfLoadExtension( 'HeaderFooter' );
// Keep i18n globals so mergeMessageFileList.php doesn't break
$wgMessagesDirs['HeaderFooter'] = __DIR__ . '/i18n';
wfWarn(
'Deprecated PHP entry point used for HeaderFooter extension. ' .
'Please use wfLoadExtension instead, ' .
'see https://www.mediawiki.org/wiki/Extension_registration for more details.'
);
return;
} else {
die( 'This version of the HeaderFooter extension requires MediaWiki 1.25+' );
}
17 changes: 17 additions & 0 deletions extension.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "HeaderFooter",
"version": "3.0.0",
"author": "Jean-Lou Dupont, James Montalvo, Douglas Mason",
"url": "http://mediawiki.org/wiki/Extension:HeaderFooter",
"descriptionmsg": "headerfooter-desc",
"type": "other",
"AutoloadClasses": {
"HeaderFooter": "HeaderFooter.class.php"
},
"Hooks": {
"OutputPageParserOutput": [
"HeaderFooter::hOutputPageParserOutput"
]
},
"manifest_version": 1
}
3 changes: 3 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"headerfooter-desc": "Enables per-page/per-namespace headers and footers"
}

0 comments on commit 8ba71ea

Please sign in to comment.