コード例 #1
0
	public function execute( $par ) {
		global $wgOut;

		$title = '';
		$params = array();

		if( IncubatorTest::isContentProject() ) {
			global $wgRequest;
			$title = Title::newFromText( IncubatorTest::displayPrefix() );
			if( $wgRequest->getVal( 'goto' ) != 'infopage' ) {
				$params['goto'] = 'mainpage';
			}
			$url = IncubatorTest::getUrlParam();
			if( $url ) {
				$params['testwiki'] = $url['prefix'];
			}
		}

		# Go to the main page if given invalid title, or if it's not a content project
		if ( !$title ) {
			$title = Title::newMainPage();
		}

		$wgOut->redirect( $title->getLocalURL( $params ) );
	}
コード例 #2
0
	static function getValues() {
		global $wgUser, $wmincPref, $wgRequest;
		$url = IncubatorTest::getUrlParam();
		$projectvalue = $url ? $url['project'] : $wgUser->getOption( $wmincPref . '-project' );
		$codevalue = $url ? $url['lang'] : $wgUser->getOption( $wmincPref . '-code' );
		$projectvalue = strtolower( $wgRequest->getVal( 'rc-testwiki-project', $projectvalue ) );
		$codevalue = strtolower( $wgRequest->getVal( 'rc-testwiki-code', $codevalue ) );
		return array( $projectvalue, $codevalue );
	}
コード例 #3
0
	/**
	 * Query
	 */
	static function onSpecialListusersQueryInfo( $pager, &$query ) {
		$testwiki = IncubatorTest::getUrlParam();
		$project = self::getProjectInput();
		if( !$project && !$testwiki ) {
			return true; # no input or invalid input
		}
		global $wmincPref;
		$query['tables']['p1'] = 'user_properties';
		$query['join_conds']['p1'] = array( 'JOIN', array( 'user_id=p1.up_user',
			'p1.up_property' => "$wmincPref-project",
			'p1.up_value' => $project ? $project['short'] : $testwiki['project']
		) );
		if( $project ) {
			return true; # project site doesn't need language code = returning
		}
		$query['tables']['p2'] = 'user_properties';
		$query['join_conds']['p2'] = array( 'JOIN', array( 'user_id=p2.up_user',
			'p2.up_property' => "$wmincPref-code",
			'p2.up_value' => $testwiki['lang']
		) );
		return true;
	}