コード例 #1
0
	static function onRcQuery( &$conds, &$tables, &$join_conds, $opts ) {
		global $wmincProjectSite, $wmincTestWikiNamespaces;
		list( $projectvalue, $codevalue ) = self::getValues();
		$prefix = IncubatorTest::displayPrefix( $projectvalue, $codevalue );
		$opts->add( 'rc-testwiki-project', false );
		$opts->setValue( 'rc-testwiki-project', $projectvalue );
		$opts->add( 'rc-testwiki-code', false );
		$opts->setValue( 'rc-testwiki-code', $codevalue );
		if ( $projectvalue == 'none' || $projectvalue == '' ) {
			// If "none" is selected, display normal recent changes
			return true;
		} elseif ( $projectvalue == $wmincProjectSite['short'] ) {
			// If project site is selected, display all changes except test wiki changes
			$dbr = wfGetDB( DB_SLAVE );
			$conds[] = 'rc_title NOT ' . $dbr->buildLike( 'W', $dbr->anyChar(), '/', $dbr->anyString() );
		} elseif( IncubatorTest::validatePrefix( $prefix, true ) ) {
			// Else, display changes to the selected test wiki in the appropriate namespaces
			$dbr = wfGetDB( DB_SLAVE );
			$conds['rc_namespace'] = $wmincTestWikiNamespaces;
			$conds[] = 'rc_title ' . $dbr->buildLike( $prefix . '/', $dbr->anyString() ) .
			' OR rc_title = ' . $dbr->addQuotes( $prefix );
		} else {
			return true;
		}
		return true;
	}