Index: trunk/extensions/WikimediaIncubator/WikimediaIncubator.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | 'path' => __FILE__, |
12 | 12 | 'name' => 'Wikimedia Incubator', |
13 | 13 | 'author' => 'SPQRobin', |
14 | | - 'version' => '2.2.0', |
| 14 | + 'version' => '2.3.0', |
15 | 15 | 'url' => 'http://www.mediawiki.org/wiki/Extension:WikimediaIncubator', |
16 | 16 | 'description' => 'Test wiki features for Wikimedia Incubator', |
17 | 17 | 'descriptionmsg' => 'wminc-desc', |
— | — | @@ -52,3 +52,6 @@ |
53 | 53 | $wgHooks['UserCreateForm'][] = 'AutoTestWiki::onUserCreateForm'; |
54 | 54 | $wgHooks['AddNewAccount'][] = 'AutoTestWiki::onAddNewAccount'; |
55 | 55 | |
| 56 | +/* Random page by test */ |
| 57 | +$wgAutoloadClasses['SpecialRandomByTest'] = $dir . 'SpecialRandomByTest.php'; |
| 58 | +$wgSpecialPages['RandomByTest'] = 'SpecialRandomByTest'; |
Index: trunk/extensions/WikimediaIncubator/SpecialRandomByTest.php |
— | — | @@ -0,0 +1,19 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | +* Special page to go to a random page in your test wiki |
| 5 | + * @file |
| 6 | + */ |
| 7 | + |
| 8 | +class SpecialRandomByTest extends RandomPage |
| 9 | +{ |
| 10 | + public function __construct() { |
| 11 | + global $wgExtraRandompageSQL, $wgUser, $wmincPref; |
| 12 | + if(IncubatorTest::isNormalPrefix()) { |
| 13 | + $wgExtraRandompageSQL = 'page_title like "W'.$wgUser->getOption($wmincPref . '-project').'/'.$wgUser->getOption($wmincPref . '-code').'/%%"'; |
| 14 | + } elseif($wgUser->getOption($wmincPref . '-project') == 'inc') { |
| 15 | + $wgExtraRandompageSQL = 'page_title not like "W_/%%" OR "W_/%%/%%"'; |
| 16 | + } |
| 17 | + |
| 18 | + parent::__construct( 'RandomByTest' ); |
| 19 | + } |
| 20 | +} |
Property changes on: trunk/extensions/WikimediaIncubator/SpecialRandomByTest.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 21 | + native |