mirror of
https://bitbucket.org/vertlach/voteny.git
synced 2024-06-16 17:50:43 +03:00
Remove use of deprecated LanguageGetMagic hook.
Update $wgExtensionCredits here and there, renamed descriptionmsg key for UKGeocodingForMaps. Remove a few globals that were used for magic words. Trim trailing whitespace and update indentation in a few places. Updated examples.
This commit is contained in:
parent
5127c15006
commit
a7aea465ae
|
@ -13,6 +13,7 @@ $messages = array();
|
|||
* @author David Pean <david.pean@gmail.com>
|
||||
*/
|
||||
$messages['en'] = array(
|
||||
'voteny-desc' => 'JavaScript-based voting with the <tt><vote></tt> tag',
|
||||
'vote-link' => 'Vote',
|
||||
'vote-unvote-link' => 'unvote',
|
||||
'vote-community-score' => 'community score: $1',
|
||||
|
|
8
Vote.php
8
Vote.php
|
@ -23,9 +23,9 @@ if ( !defined( 'MEDIAWIKI' ) ) {
|
|||
// Extension credits that show up on Special:Version
|
||||
$wgExtensionCredits['parserhook'][] = array(
|
||||
'name' => 'Vote',
|
||||
'version' => '2.4',
|
||||
'version' => '2.5',
|
||||
'author' => array( 'Aaron Wright', 'David Pean', 'Jack Phoenix' ),
|
||||
'description' => 'JavaScript-based voting with the <tt><vote></tt> tag',
|
||||
'descriptionmsg' => 'voteny-desc',
|
||||
'url' => 'https://www.mediawiki.org/wiki/Extension:VoteNY'
|
||||
);
|
||||
|
||||
|
@ -43,6 +43,7 @@ require_once( 'Vote_AjaxFunctions.php' );
|
|||
// Autoload classes and set up i18n
|
||||
$dir = dirname( __FILE__ ) . '/';
|
||||
$wgExtensionMessagesFiles['Vote'] = $dir . 'Vote.i18n.php';
|
||||
$wgExtensionMessagesFiles['VoteNYMagic'] = $dir . 'VoteNY.i18n.magic.php';
|
||||
$wgAutoloadClasses['Vote'] = $dir . 'VoteClass.php';
|
||||
$wgAutoloadClasses['VoteStars'] = $dir . 'VoteClass.php';
|
||||
|
||||
|
@ -56,9 +57,6 @@ $wgAutoloadClasses['VoteHooks'] = $dir . 'VoteHooks.php';
|
|||
|
||||
$wgHooks['ParserFirstCallInit'][] = 'VoteHooks::registerParserHook';
|
||||
$wgHooks['RenameUserSQL'][] = 'VoteHooks::onUserRename';
|
||||
// Translations for {{NUMBEROFVOTES}}
|
||||
//$wgExtensionMessagesFiles['NumberOfVotes'] = $dir . 'Vote.i18n.magic.php';
|
||||
$wgHooks['LanguageGetMagic'][] = 'VoteHooks::setUpMagicWord';
|
||||
$wgHooks['ParserGetVariableValueSwitch'][] = 'VoteHooks::assignValueToMagicWord';
|
||||
$wgHooks['MagicWordwgVariableIDs'][] = 'VoteHooks::registerVariableId';
|
||||
$wgHooks['LoadExtensionSchemaUpdates'][] = 'VoteHooks::addTable';
|
||||
|
|
|
@ -81,21 +81,6 @@ class VoteHooks {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up the {{NUMBEROFVOTES}} magic word.
|
||||
*
|
||||
* @param $magicWords Array: array of magic words
|
||||
* @param $langID
|
||||
* @return Boolean: true
|
||||
*/
|
||||
public static function setUpMagicWord( &$magicWords, $langID ) {
|
||||
// tell MediaWiki that {{NUMBEROFVOTES}} and all case variants found in
|
||||
// wiki text should be mapped to magic ID 'NUMBEROFVOTES'
|
||||
// (0 means case-insensitive)
|
||||
$magicWords['NUMBEROFVOTES'] = array( 0, 'NUMBEROFVOTES' );
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a value to {{NUMBEROFVOTES}}. First we try memcached and if that
|
||||
* fails, we fetch it directly from the database and cache it for 24 hours.
|
||||
|
|
10
VoteNY.i18n.magic.php
Normal file
10
VoteNY.i18n.magic.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* Internationalization file for magic words.
|
||||
*/
|
||||
|
||||
$magicWords = array();
|
||||
|
||||
$magicWords['en'] = array(
|
||||
'NUMBEROFVOTES' => array( 0, 'NUMBEROFVOTES' ),
|
||||
);
|
Loading…
Reference in a new issue