Yaron Koren has submitted this change and it was merged. Change subject: Provide license information and tiny tweaks ......................................................................
Provide license information and tiny tweaks * Add license label to show on "Special:Version" * Amended COPYING * Switch to use __DIR__ * Add code documentation Change-Id: Ida3190109ba4fac80db67e68fd173646898c38ba --- M COPYING M HeaderTabs.php M extension.json 3 files changed, 25 insertions(+), 14 deletions(-) Approvals: Yaron Koren: Looks good to me, approved jenkins-bot: Verified diff --git a/COPYING b/COPYING index 4b17431..2733812 100644 --- a/COPYING +++ b/COPYING @@ -3,7 +3,8 @@ "COPYING", or a subdirectory thereof. For those files, the license text contained in said file overrides any license information contained in directories of smaller depth. Alternative licenses are typically used for software that is provided by external -parties, and merely packaged with the Semantic Forms release for convenience. +parties, and merely packaged with this software for convenience. + ---- GNU GENERAL PUBLIC LICENSE diff --git a/HeaderTabs.php b/HeaderTabs.php index c9c666f..642aa56 100644 --- a/HeaderTabs.php +++ b/HeaderTabs.php @@ -10,17 +10,17 @@ * @author Olivier Finlay Beaton */ +// Protect against entries if ( !defined( 'MEDIAWIKI' ) ) { die(); } -$dir = dirname( __FILE__ ); - +// Allow exension registration mechanism if ( function_exists( 'wfLoadExtension' ) ) { wfLoadExtension( 'HeaderTabs' ); // Keep i18n globals so mergeMessageFileList.php doesn't break - $wgMessagesDirs['HeaderTabs'] = $dir . '/i18n'; - $wgExtensionMessagesFiles['HeaderTabsMagic'] = $dir . '/HeaderTabs.i18n.magic.php'; + $wgMessagesDirs['HeaderTabs'] = __DIR__ . '/i18n'; + $wgExtensionMessagesFiles['HeaderTabsMagic'] = __DIR__ . '/HeaderTabs.i18n.magic.php'; /* wfWarn( 'Deprecated PHP entry point used for Semanti Forms extension. Please use wfLoadExtension instead, ' . 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' @@ -28,26 +28,32 @@ return; } - +// Show extension credits $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'Header Tabs', 'descriptionmsg' => 'headertabs-desc', 'version' => '1.1', - 'author' => array( '[http://www.sergeychernyshev.com Sergey Chernyshev]', 'Yaron Koren', '[http://olivierbeaton.com Olivier Finlay Beaton]' ), - 'url' => 'https://www.mediawiki.org/wiki/Extension:Header_Tabs' + 'author' => array( + '[http://www.sergeychernyshev.com Sergey Chernyshev]', + 'Yaron Koren', + '[http://olivierbeaton.com Olivier Finlay Beaton]', + '...' + ), + 'url' => 'https://www.mediawiki.org/wiki/Extension:Header_Tabs', + 'license-name' => 'GPL-2.0+' ); // Translations -$wgMessagesDirs['HeaderTabs'] = $dir . '/i18n'; -$wgExtensionMessagesFiles['HeaderTabs'] = $dir . '/HeaderTabs.i18n.php'; +$wgMessagesDirs['HeaderTabs'] = __DIR__ . '/i18n'; +$wgExtensionMessagesFiles['HeaderTabs'] = __DIR__ . '/HeaderTabs.i18n.php'; //! @todo implement in tab parsing code instead... but problems like nowiki (2011-12-12, ofb) // if you make them here, it will be article wide instead of tab-wide // __NOTABTOC__, __TABTOC__, __NOEDITTAB__ // and one day with a special page: __NEWTABLINK__, __NONEWTABLINK__ // and one day if we can force toc generation: __FORCETABTOC__ -$wgExtensionMessagesFiles['HeaderTabsMagic'] = $dir . '/HeaderTabs.i18n.magic.php'; +$wgExtensionMessagesFiles['HeaderTabsMagic'] = __DIR__ . '/HeaderTabs.i18n.magic.php'; // Config $wgHeaderTabsUseHistory = true; @@ -90,20 +96,23 @@ } // $wgConfigureAdditionalExtensions exists +// Register hooks $wgHooks['ParserFirstCallInit'][] = 'HeaderTabsHooks::registerParserFunctions'; $wgHooks['BeforePageDisplay'][] = 'HeaderTabsHooks::addHTMLHeader'; $wgHooks['ParserAfterTidy'][] = 'HeaderTabsHooks::replaceFirstLevelHeaders'; $wgHooks['ResourceLoaderGetConfigVars'][] = 'HeaderTabsHooks::addConfigVarsToJS'; $wgHooks['MakeGlobalVariablesScript'][] = 'HeaderTabsHooks::setGlobalJSVariables'; -$wgAutoloadClasses['HeaderTabsHooks'] = "$dir/HeaderTabs.hooks.php"; -$wgAutoloadClasses['HeaderTabs'] = "$dir/HeaderTabs_body.php"; +// Load classes +$wgAutoloadClasses['HeaderTabsHooks'] = __DIR__ . '/HeaderTabs.hooks.php'; +$wgAutoloadClasses['HeaderTabs'] = __DIR__ . '/HeaderTabs_body.php'; +// Use modules $wgResourceModules['ext.headertabs'] = array( 'scripts' => 'skins/ext.headertabs.core.js', // 'styles' => // the style is added in HeaderTabsHooks::addHTMLHeader() 'dependencies' => array( 'jquery.ui.tabs' ), - 'localBasePath' => dirname( __FILE__ ), + 'localBasePath' => __DIR__, 'remoteExtPath' => 'HeaderTabs', ); diff --git a/extension.json b/extension.json index 9d487e9..4ec39be 100644 --- a/extension.json +++ b/extension.json @@ -8,6 +8,7 @@ ], "url": "https://www.mediawiki.org/wiki/Extension:Header_Tabs", "descriptionmsg": "headertabs-desc", + "license-name": "GPL-2.0+", "type": "parserhook", "MessagesDirs": { "HeaderTabs": [ -- To view, visit https://gerrit.wikimedia.org/r/276952 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ida3190109ba4fac80db67e68fd173646898c38ba Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/HeaderTabs Gerrit-Branch: master Gerrit-Owner: Kghbln <kars...@hoffmeyer.info> Gerrit-Reviewer: Yaron Koren <yaro...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits