Index: trunk/extensions/WikimediaIncubator/WikimediaIncubator.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | 'path' => __FILE__, |
15 | 15 | 'name' => 'Wikimedia Incubator', |
16 | 16 | 'author' => 'SPQRobin', |
17 | | - 'version' => '3.1.1', |
| 17 | + 'version' => '3.2', |
18 | 18 | 'url' => 'http://www.mediawiki.org/wiki/Extension:WikimediaIncubator', |
19 | 19 | 'descriptionmsg' => 'wminc-desc', |
20 | 20 | ); |
— | — | @@ -74,6 +74,10 @@ |
75 | 75 | $wgHooks['LanguageGetMagic'][] = 'IncubatorTest::magicWord'; |
76 | 76 | $wgHooks['ParserGetVariableValueSwitch'][] = 'IncubatorTest::magicWordValue'; |
77 | 77 | |
| 78 | +/* Special:MyMainPage (depending on your test wiki preference) */ |
| 79 | +$wgAutoloadClasses['SpecialMyMainPage'] = $dir . 'SpecialMyMainPage.php'; |
| 80 | +$wgSpecialPages['MyMainPage'] = 'SpecialMyMainPage'; |
| 81 | + |
78 | 82 | /* Create/move page permissions */ |
79 | 83 | $wgHooks['getUserPermissionsErrors'][] = 'IncubatorTest::checkPrefixCreatePermissions'; |
80 | 84 | $wgHooks['AbortMove'][] = 'IncubatorTest::checkPrefixMovePermissions'; |
Index: trunk/extensions/WikimediaIncubator/SpecialMyMainPage.php |
— | — | @@ -0,0 +1,39 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Special page to go to the Main Page, depending on your test wiki. |
| 5 | + * Goes to the default Main Page if the test wiki preference |
| 6 | + * is set to None/All or Incubator. |
| 7 | + * |
| 8 | + * @file |
| 9 | + * @ingroup SpecialPage |
| 10 | + */ |
| 11 | + |
| 12 | +class SpecialMyMainPage extends UnlistedSpecialPage { |
| 13 | + |
| 14 | + public function __construct() { |
| 15 | + parent::__construct( 'MyMainPage' ); |
| 16 | + } |
| 17 | + |
| 18 | + public function execute() { |
| 19 | + global $wgOut; |
| 20 | + |
| 21 | + $title = ''; |
| 22 | + $params = array(); |
| 23 | + |
| 24 | + if( IncubatorTest::isContentProject() ) { |
| 25 | + global $wgRequest; |
| 26 | + $title = Title::newFromText( IncubatorTest::displayPrefix() ); |
| 27 | + if( $wgRequest->getVal( 'goto' ) != 'infopage' ) { |
| 28 | + # Used in development version |
| 29 | + $params = array( 'goto' => 'mainpage' ); |
| 30 | + } |
| 31 | + } |
| 32 | + |
| 33 | + # Go to the main page if given invalid title, or if it's not a content project |
| 34 | + if ( !$title ) { |
| 35 | + $title = Title::newMainPage(); |
| 36 | + } |
| 37 | + |
| 38 | + $wgOut->redirect( $title->getLocalURL( $params ) ); |
| 39 | + } |
| 40 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/WikimediaIncubator/SpecialMyMainPage.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 41 | + native |