Index: trunk/extensions/AJAXPoll/poll.sql |
— | — | @@ -1,15 +0,0 @@ |
2 | | -CREATE TABLE IF NOT EXISTS /*_*/poll_info ( |
3 | | - `poll_id` varchar(32) NOT NULL PRIMARY KEY default '', |
4 | | - `poll_txt` text, |
5 | | - `poll_date` datetime default NULL, |
6 | | - `poll_title` varchar(255) default NULL |
7 | | -) /*$wgDBTableOptions*/; |
8 | | - |
9 | | -CREATE TABLE IF NOT EXISTS /*_*/poll_vote ( |
10 | | - `poll_id` varchar(32) NOT NULL default '', |
11 | | - `poll_user` varchar(255) NOT NULL default '', |
12 | | - `poll_ip` varchar(255) default NULL, |
13 | | - `poll_answer` int(3) default NULL, |
14 | | - `poll_date` datetime default NULL, |
15 | | - PRIMARY KEY (`poll_id`,`poll_user`) |
16 | | -) /*$wgDBTableOptions*/; |
\ No newline at end of file |
Index: trunk/extensions/AJAXPoll/AJAXPoll.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | * @author Jack Phoenix <jack@countervandalism.net> |
21 | 21 | * @author Thomas Gries |
22 | 22 | * @maintainer Thomas Gries |
23 | | - * @version 1.71 |
| 23 | + * @version 1.72 |
24 | 24 | * @link http://www.mediawiki.org/wiki/Extension:AJAX_Poll Documentation |
25 | 25 | */ |
26 | 26 | |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | $wgExtensionCredits['parserhook'][] = array( |
33 | 33 | 'path' => __FILE__, |
34 | 34 | 'name' => 'AJAX Poll', |
35 | | - 'version' => '1.71 20120314', |
| 35 | + 'version' => '1.72 20120314', |
36 | 36 | 'author' => array( 'Dariusz Siedlecki', 'Jack Phoenix', 'Thomas Gries' ), |
37 | 37 | 'descriptionmsg' => 'ajaxpoll-desc', |
38 | 38 | 'url' => 'https://www.mediawiki.org/wiki/Extension:AJAX_Poll', |
— | — | @@ -42,7 +42,8 @@ |
43 | 43 | $wgExtensionMessagesFiles['AJAXPoll'] = $dir . '/AJAXPoll.i18n.php'; |
44 | 44 | $wgAutoloadClasses['AJAXPoll'] = $dir . '/AJAXPoll_body.php'; |
45 | 45 | $wgAjaxExportList[] = 'AJAXPoll::submitVote'; |
46 | | -$wgHooks['ParserFirstCallInit'][] = 'AJAXPoll::AJAXPollParserInit'; |
| 46 | +$wgHooks['ParserFirstCallInit'][] = 'AJAXPoll::onParserInit'; |
| 47 | +$wgHooks['LoadExtensionSchemaUpdates'][] = 'AJAXPoll::onLoadExtensionSchemaUpdates'; |
47 | 48 | |
48 | 49 | $myResourceTemplate = array( |
49 | 50 | 'localBasePath' => dirname( __FILE__ ) . "/resources", |
Index: trunk/extensions/AJAXPoll/patches/drop-field--poll_info-poll_title.sql |
— | — | @@ -0,0 +1,5 @@ |
| 2 | +-- |
| 3 | +-- SQL schema update for AJAXPoll extension to drop poll_info.poll_title field since version 1.72 |
| 4 | +-- |
| 5 | + |
| 6 | +ALTER TABLE /*_*/poll_info DROP poll_title; |
Property changes on: trunk/extensions/AJAXPoll/patches/drop-field--poll_info-poll_title.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 7 | + native |
Index: trunk/extensions/AJAXPoll/patches/create-table--ajaxpoll_info.sql |
— | — | @@ -0,0 +1,6 @@ |
| 2 | +RENAME TABLE /*_*/poll_info TO /*_*/ajaxpoll_info; |
| 3 | +CREATE TABLE IF NOT EXISTS /*_*/ajaxpoll_info ( |
| 4 | + `poll_id` varchar(32) NOT NULL PRIMARY KEY default '', |
| 5 | + `poll_txt` text, |
| 6 | + `poll_date` datetime default NULL |
| 7 | +) /*$wgDBTableOptions*/; |
\ No newline at end of file |
Property changes on: trunk/extensions/AJAXPoll/patches/create-table--ajaxpoll_info.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 8 | + native |
Index: trunk/extensions/AJAXPoll/patches/create-table--ajaxpoll_vote.sql |
— | — | @@ -0,0 +1,9 @@ |
| 2 | +RENAME TABLE /*_*/poll_vote TO /*_*/ajaxpoll_vote; |
| 3 | +CREATE TABLE IF NOT EXISTS /*_*/ajaxpoll_vote ( |
| 4 | + `poll_id` varchar(32) NOT NULL default '', |
| 5 | + `poll_user` varchar(255) NOT NULL default '', |
| 6 | + `poll_ip` varchar(255) default NULL, |
| 7 | + `poll_answer` int(3) default NULL, |
| 8 | + `poll_date` datetime default NULL, |
| 9 | + PRIMARY KEY (`poll_id`,`poll_user`) |
| 10 | +) /*$wgDBTableOptions*/; |
\ No newline at end of file |
Property changes on: trunk/extensions/AJAXPoll/patches/create-table--ajaxpoll_vote.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 11 | + native |
Index: trunk/extensions/AJAXPoll/AJAXPoll_body.php |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | * @param $parser Object: instance of Parser (not necessarily $wgParser) |
23 | 23 | * @return Boolean: true |
24 | 24 | */ |
25 | | - static function AJAXPollParserInit( $parser ) { |
| 25 | + static function onParserInit( $parser ) { |
26 | 26 | global $wgOut; |
27 | 27 | $parser->setHook( 'poll', array( __CLASS__, 'AJAXPollRender' ) ); |
28 | 28 | $wgOut->addModules( 'ext.ajaxpoll' ); |
— | — | @@ -76,7 +76,6 @@ |
77 | 77 | 'poll_id' => $id, |
78 | 78 | 'poll_txt' => $input, |
79 | 79 | 'poll_date' => wfTimestampNow(), |
80 | | - 'poll_title' => $parser->mTitle->getPrefixedText() |
81 | 80 | ), |
82 | 81 | __METHOD__ |
83 | 82 | ); |
— | — | @@ -394,4 +393,30 @@ |
395 | 394 | return $ret; |
396 | 395 | } |
397 | 396 | |
| 397 | + public static function onLoadExtensionSchemaUpdates( $updater = null ) { |
| 398 | + if ( $updater === null ) { |
| 399 | + // no < 1.17 support |
| 400 | + } else { |
| 401 | + // >= 1.17 support |
| 402 | + |
| 403 | + # poll_info.poll_title field was dropped in AJAXPoll version 1.72 |
| 404 | + $updater->dropExtensionField( |
| 405 | + 'poll_info', |
| 406 | + 'poll_title', |
| 407 | + dirname( __FILE__ ) . '/patches/drop-field--poll_info-poll_title.sql' |
| 408 | + ); |
| 409 | + |
| 410 | + $updater->addExtensionTable( |
| 411 | + 'ajaxpoll_info', |
| 412 | + dirname( __FILE__ ) . '/patches/create-table--ajaxpoll_info.sql' |
| 413 | + ); |
| 414 | + $updater->addExtensionTable( |
| 415 | + 'ajaxpoll_vote', |
| 416 | + dirname( __FILE__ ) . '/patches/create-table--ajaxpoll_vote.sql' |
| 417 | + ); |
| 418 | + |
| 419 | + } |
| 420 | + return true; |
| 421 | + } |
| 422 | + |
398 | 423 | } /* class AJAXPoll */ |