Index: trunk/extensions/ArticleEmblems/ArticleEmblems.hooks.php |
— | — | @@ -15,29 +15,6 @@ |
16 | 16 | /* Static Methods */ |
17 | 17 | |
18 | 18 | /** |
19 | | - * LoadExtensionSchemaUpdates hook |
20 | | - * |
21 | | - * @param $updater DatabaseUpdater |
22 | | - */ |
23 | | - public static function loadExtensionSchemaUpdates( $updater = null ) { |
24 | | - if ( $updater === null ) { |
25 | | - global $wgExtNewTables; |
26 | | - $wgExtNewTables[] = array( 'articleemblems', dirname( __FILE__ ) . '/patches/ArticleEmblems.sql' ); |
27 | | - } else { |
28 | | - $updater->addExtensionUpdate( array( 'addTable', 'articleemblems', dirname( __FILE__ ) . '/patches/ArticleEmblems.sql', true ) ); |
29 | | - } |
30 | | - return true; |
31 | | - } |
32 | | - |
33 | | - /** |
34 | | - * ParserTestTables hook |
35 | | - */ |
36 | | - public static function parserTestTables( &$tables ) { |
37 | | - $tables[] = 'articleemblems'; |
38 | | - return true; |
39 | | - } |
40 | | - |
41 | | - /** |
42 | 19 | * ParserInit hook |
43 | 20 | * |
44 | 21 | * @param $parser Parser |
— | — | @@ -61,23 +38,6 @@ |
62 | 39 | } |
63 | 40 | |
64 | 41 | /** |
65 | | - * ArticleSaveComplete hook |
66 | | - * |
67 | | - * @param $article Article |
68 | | - */ |
69 | | - public static function articleSaveComplete( &$article ) { |
70 | | - $articleId = $article->getId(); |
71 | | - $dbw = wfGetDB( DB_MASTER ); |
72 | | - $dbw->delete( 'articleemblems', array( 'ae_article' => $articleId ), __METHOD__ ); |
73 | | - $emblems = array(); |
74 | | - foreach ( self::$emblems as $emblem ) { |
75 | | - $emblems[] = array( 'ae_article' => $articleId, 'ae_value' => $emblem ); |
76 | | - } |
77 | | - $dbw->insert( 'articleemblems', array_reverse( $emblems ), __METHOD__ ); |
78 | | - return true; |
79 | | - } |
80 | | - |
81 | | - /** |
82 | 42 | * ArticleViewHeader hook |
83 | 43 | * |
84 | 44 | * @param $article Article |
Index: trunk/extensions/ArticleEmblems/ArticleEmblems.php |
— | — | @@ -22,11 +22,10 @@ |
23 | 23 | ); |
24 | 24 | $wgAutoloadClasses['ArticleEmblemsHooks'] = dirname( __FILE__ ) . '/ArticleEmblems.hooks.php'; |
25 | 25 | $wgExtensionMessagesFiles['ArticleEmblems'] = dirname( __FILE__ ) . '/ArticleEmblems.i18n.php'; |
26 | | -$wgHooks['LoadExtensionSchemaUpdates'][] = 'ArticleEmblemsHooks::loadExtensionSchemaUpdates'; |
| 26 | + |
27 | 27 | $wgHooks['ParserFirstCallInit'][] = 'ArticleEmblemsHooks::parserInit'; |
28 | | -$wgHooks['ParserTestTables'][] = 'ArticleEmblemsHooks::parserTestTables'; |
29 | 28 | $wgHooks['ArticleViewHeader'][] = 'ArticleEmblemsHooks::articleViewHeader'; |
30 | | -$wgHooks['ArticleSaveComplete'][] = 'ArticleEmblemsHooks::articleSaveComplete'; |
| 29 | + |
31 | 30 | $wgResourceModules['ext.articleEmblems'] = array( |
32 | 31 | 'styles' => 'ext.articleEmblems.css', |
33 | 32 | 'localBasePath' => dirname( __FILE__ ) . '/modules', |