Index: trunk/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -79,13 +79,19 @@ |
80 | 80 | */ |
81 | 81 | $wgMobileRedirectFormAction = false; |
82 | 82 | |
83 | | -$wgExtMobileFrontend = new ExtMobileFrontend(); |
| 83 | +$wgExtMobileFrontend = null; |
84 | 84 | |
85 | | -$wgHooks['BeforePageDisplay'][] = array( &$wgExtMobileFrontend, 'beforePageDisplayHTML' ); |
86 | | -$wgHooks['BeforePageRedirect'][] = array( &$wgExtMobileFrontend, 'beforePageRedirect' ); |
87 | | -$wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' ); |
88 | | -$wgHooks['TestCanonicalRedirect'][] = array( &$wgExtMobileFrontend, 'testCanonicalRedirect' ); |
| 85 | +$wgExtensionFunctions[] = 'efMobileFrontend_Setup'; |
89 | 86 | |
| 87 | +function efMobileFrontend_Setup() { |
| 88 | + global $wgExtMobileFrontend, $wgHooks; |
| 89 | + $wgExtMobileFrontend = new ExtMobileFrontend(); |
| 90 | + $wgHooks['BeforePageDisplay'][] = array( &$wgExtMobileFrontend, 'beforePageDisplayHTML' ); |
| 91 | + $wgHooks['BeforePageRedirect'][] = array( &$wgExtMobileFrontend, 'beforePageRedirect' ); |
| 92 | + $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' ); |
| 93 | + $wgHooks['TestCanonicalRedirect'][] = array( &$wgExtMobileFrontend, 'testCanonicalRedirect' ); |
| 94 | +} |
| 95 | + |
90 | 96 | /** |
91 | 97 | * Make the classes, tags and ids stripped from page content configurable. |
92 | 98 | * Each item will be stripped from the page. |