Index: trunk/extensions/StalePages/StalePages_body.php |
— | — | @@ -27,7 +27,9 @@ |
28 | 28 | } |
29 | 29 | |
30 | 30 | function execute( $parameters ) { |
31 | | - wfLoadExtensionMessages( 'Stalepages' ); |
| 31 | + if( version_compare( $wgVersion, '1.12alpha', '>=' ) ) { |
| 32 | + wfLoadExtensionMessages( 'Stalepages' ); |
| 33 | + } |
32 | 34 | |
33 | 35 | $this->setHeaders(); |
34 | 36 | list( $limit, $offset ) = wfCheckLimits(); |
Index: trunk/extensions/StalePages/StalePages.i18n.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | $messages = array(); |
10 | 10 | |
11 | 11 | $messages['en'] = array( |
12 | | - 'stalepages' => 'Stale Pages', |
| 12 | + 'stalepages' => 'Stale pages', |
13 | 13 | 'stalepages-summary' => 'This is a list of pages that have not been edited in the last $1 days.', |
14 | 14 | ); |
15 | 15 | |
Index: trunk/extensions/StalePages/StalePages.php |
— | — | @@ -5,20 +5,37 @@ |
6 | 6 | |
7 | 7 | # Not a valid entry point, skip unless MEDIAWIKI is defined |
8 | 8 | if (!defined('MEDIAWIKI')) { |
9 | | - echo "Stale Pages extension"; |
| 9 | + echo "Stale pages extension"; |
10 | 10 | exit(1); |
11 | 11 | } |
12 | 12 | |
13 | 13 | $wgExtensionCredits['specialpage'][] = array( |
14 | | - 'name'=>'Stale Pages', |
| 14 | + 'name'=>'Stale pages', |
15 | 15 | 'url'=>'http://www.mediawiki.org/wiki/Extension:Stale_Pages', |
16 | 16 | 'author'=>'Tim Laqua', |
17 | 17 | 'description'=>'Generates a list of pages that have not been edited recently', |
18 | 18 | 'version'=>'0.7' |
19 | 19 | ); |
20 | 20 | |
| 21 | +if( version_compare( $wgVersion, '1.12alpha', '>=' ) ) { |
| 22 | + $wgExtensionMessagesFiles['Stalepages'] = $dir . 'StalePages.i18n.php'; |
| 23 | +} else { |
| 24 | + $wgExtensionFunctions[] = 'efStalepages'; |
| 25 | +} |
| 26 | + |
21 | 27 | $dir = dirname(__FILE__) . '/'; |
22 | | -$wgExtensionMessagesFiles['Stalepages'] = $dir . 'StalePages.i18n.php'; |
23 | 28 | $wgAutoloadClasses['Stalepages'] = $dir . 'StalePages_body.php'; |
24 | 29 | |
25 | 30 | $wgSpecialPages['Stalepages'] = 'Stalepages'; |
| 31 | + |
| 32 | + |
| 33 | +///Message Cache population for versions that did not support $wgExtensionFunctions |
| 34 | +function efStalePages() { |
| 35 | + global $wgMessageCache; |
| 36 | + |
| 37 | + #Add Messages |
| 38 | + require( dirname( __FILE__ ) . '/StalePages.i18n.php' ); |
| 39 | + foreach( $messages as $key => $value ) { |
| 40 | + $wgMessageCache->addMessages( $messages[$key], $key ); |
| 41 | + } |
| 42 | +} |