mirror of
https://bitbucket.org/vertlach/voteny.git
synced 2024-06-16 17:50:43 +03:00
Create VoteNY entry file
The content of the old entry file has been moved to VoteNY.php A stub Vote.php has been create including this file Change-Id: I6d332486bdc97c7527218e0de18452a30be56e85
This commit is contained in:
parent
4c1935d888
commit
77c7a4e777
73
Vote.php
73
Vote.php
|
@ -1,73 +1,4 @@
|
|||
<?php
|
||||
/**
|
||||
* Vote extension - JavaScript-based voting with the <vote> tag
|
||||
*
|
||||
* @file
|
||||
* @ingroup Extensions
|
||||
* @author Aaron Wright <aaron.wright@gmail.com>
|
||||
* @author David Pean <david.pean@gmail.com>
|
||||
* @author Jack Phoenix <jack@countervandalism.net>
|
||||
* @link https://www.mediawiki.org/wiki/Extension:VoteNY Documentation
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Protect against register_globals vulnerabilities.
|
||||
* This line must be present before any global variable is referenced.
|
||||
*/
|
||||
if ( !defined( 'MEDIAWIKI' ) ) {
|
||||
die( "This is not a valid entry point.\n" );
|
||||
}
|
||||
|
||||
// Extension credits that show up on Special:Version
|
||||
$wgExtensionCredits['parserhook'][] = array(
|
||||
'name' => 'Vote',
|
||||
'version' => '2.6.0',
|
||||
'author' => array( 'Aaron Wright', 'David Pean', 'Jack Phoenix' ),
|
||||
'descriptionmsg' => 'voteny-desc',
|
||||
'url' => 'https://www.mediawiki.org/wiki/Extension:VoteNY'
|
||||
);
|
||||
|
||||
// Path to Vote extension files
|
||||
$wgVoteDirectory = "$IP/extensions/VoteNY";
|
||||
|
||||
// New user right
|
||||
$wgAvailableRights[] = 'vote';
|
||||
$wgGroupPermissions['*']['vote'] = false; // Anonymous users cannot vote
|
||||
$wgGroupPermissions['user']['vote'] = true; // Registered users can vote
|
||||
|
||||
// AJAX functions needed by this extension
|
||||
require_once( 'Vote_AjaxFunctions.php' );
|
||||
|
||||
// Autoload classes and set up i18n
|
||||
$dir = dirname( __FILE__ ) . '/';
|
||||
$wgMessagesDirs['VoteNY'] = __DIR__ . '/i18n';
|
||||
$wgExtensionMessagesFiles['VoteNY'] = $dir . 'Vote.i18n.php';
|
||||
$wgExtensionMessagesFiles['VoteNYMagic'] = $dir . 'VoteNY.i18n.magic.php';
|
||||
$wgAutoloadClasses['Vote'] = $dir . 'VoteClass.php';
|
||||
$wgAutoloadClasses['VoteStars'] = $dir . 'VoteClass.php';
|
||||
|
||||
// Set up the new special page, Special:TopRatings, which shows top rated pages
|
||||
// based on given criteria
|
||||
$wgAutoloadClasses['SpecialTopRatings'] = $dir . 'SpecialTopRatings.php';
|
||||
$wgSpecialPages['TopRatings'] = 'SpecialTopRatings';
|
||||
|
||||
// Hooked functions
|
||||
$wgAutoloadClasses['VoteHooks'] = $dir . 'VoteHooks.php';
|
||||
|
||||
$wgHooks['ParserFirstCallInit'][] = 'VoteHooks::registerParserHook';
|
||||
$wgHooks['RenameUserSQL'][] = 'VoteHooks::onUserRename';
|
||||
$wgHooks['ParserGetVariableValueSwitch'][] = 'VoteHooks::assignValueToMagicWord';
|
||||
$wgHooks['MagicWordwgVariableIDs'][] = 'VoteHooks::registerVariableId';
|
||||
$wgHooks['ParserFirstCallInit'][] = 'VoteHooks::setupNumberOfVotesPageParser';
|
||||
$wgHooks['LoadExtensionSchemaUpdates'][] = 'VoteHooks::addTable';
|
||||
|
||||
// ResourceLoader support for MediaWiki 1.17+
|
||||
$wgResourceModules['ext.voteNY'] = array(
|
||||
'styles' => 'Vote.css',
|
||||
'scripts' => 'Vote.js',
|
||||
'messages' => array( 'voteny-link', 'voteny-unvote-link' ),
|
||||
'localBasePath' => dirname( __FILE__ ),
|
||||
'remoteExtPath' => 'VoteNY',
|
||||
'position' => 'top' // available since r85616
|
||||
);
|
||||
// The entry point has been moved to VoteNY.php
|
||||
require_once( './VoteNY.php' );
|
73
VoteNY.php
Normal file
73
VoteNY.php
Normal file
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
/**
|
||||
* Vote extension - JavaScript-based voting with the <vote> tag
|
||||
*
|
||||
* @file
|
||||
* @ingroup Extensions
|
||||
* @author Aaron Wright <aaron.wright@gmail.com>
|
||||
* @author David Pean <david.pean@gmail.com>
|
||||
* @author Jack Phoenix <jack@countervandalism.net>
|
||||
* @link https://www.mediawiki.org/wiki/Extension:VoteNY Documentation
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Protect against register_globals vulnerabilities.
|
||||
* This line must be present before any global variable is referenced.
|
||||
*/
|
||||
if ( !defined( 'MEDIAWIKI' ) ) {
|
||||
die( "This is not a valid entry point.\n" );
|
||||
}
|
||||
|
||||
// Extension credits that show up on Special:Version
|
||||
$wgExtensionCredits['parserhook'][] = array(
|
||||
'name' => 'Vote',
|
||||
'version' => '2.6.0',
|
||||
'author' => array( 'Aaron Wright', 'David Pean', 'Jack Phoenix' ),
|
||||
'descriptionmsg' => 'voteny-desc',
|
||||
'url' => 'https://www.mediawiki.org/wiki/Extension:VoteNY'
|
||||
);
|
||||
|
||||
// Path to Vote extension files
|
||||
$wgVoteDirectory = "$IP/extensions/VoteNY";
|
||||
|
||||
// New user right
|
||||
$wgAvailableRights[] = 'vote';
|
||||
$wgGroupPermissions['*']['vote'] = false; // Anonymous users cannot vote
|
||||
$wgGroupPermissions['user']['vote'] = true; // Registered users can vote
|
||||
|
||||
// AJAX functions needed by this extension
|
||||
require_once( 'Vote_AjaxFunctions.php' );
|
||||
|
||||
// Autoload classes and set up i18n
|
||||
$dir = dirname( __FILE__ ) . '/';
|
||||
$wgMessagesDirs['VoteNY'] = __DIR__ . '/i18n';
|
||||
$wgExtensionMessagesFiles['VoteNY'] = $dir . 'Vote.i18n.php';
|
||||
$wgExtensionMessagesFiles['VoteNYMagic'] = $dir . 'VoteNY.i18n.magic.php';
|
||||
$wgAutoloadClasses['Vote'] = $dir . 'VoteClass.php';
|
||||
$wgAutoloadClasses['VoteStars'] = $dir . 'VoteClass.php';
|
||||
|
||||
// Set up the new special page, Special:TopRatings, which shows top rated pages
|
||||
// based on given criteria
|
||||
$wgAutoloadClasses['SpecialTopRatings'] = $dir . 'SpecialTopRatings.php';
|
||||
$wgSpecialPages['TopRatings'] = 'SpecialTopRatings';
|
||||
|
||||
// Hooked functions
|
||||
$wgAutoloadClasses['VoteHooks'] = $dir . 'VoteHooks.php';
|
||||
|
||||
$wgHooks['ParserFirstCallInit'][] = 'VoteHooks::registerParserHook';
|
||||
$wgHooks['RenameUserSQL'][] = 'VoteHooks::onUserRename';
|
||||
$wgHooks['ParserGetVariableValueSwitch'][] = 'VoteHooks::assignValueToMagicWord';
|
||||
$wgHooks['MagicWordwgVariableIDs'][] = 'VoteHooks::registerVariableId';
|
||||
$wgHooks['ParserFirstCallInit'][] = 'VoteHooks::setupNumberOfVotesPageParser';
|
||||
$wgHooks['LoadExtensionSchemaUpdates'][] = 'VoteHooks::addTable';
|
||||
|
||||
// ResourceLoader support for MediaWiki 1.17+
|
||||
$wgResourceModules['ext.voteNY'] = array(
|
||||
'styles' => 'Vote.css',
|
||||
'scripts' => 'Vote.js',
|
||||
'messages' => array( 'voteny-link', 'voteny-unvote-link' ),
|
||||
'localBasePath' => dirname( __FILE__ ),
|
||||
'remoteExtPath' => 'VoteNY',
|
||||
'position' => 'top' // available since r85616
|
||||
);
|
Loading…
Reference in a new issue