Esempio n. 1
0
	/**
	 * Do a bit of delayed setup, based on this year's config
	 * @param $year int Year to host Wikimania for
	 */
	public static function hostWikimania( $year ) {
		if( !self::$i ) {
			global $wgWikimaniaConf, $wgExtensionMessagesFiles;
			if( !isset( $wgWikimaniaConf['year'] ) || $wgWikimaniaConf['year'] !== $year ) {
				throw new MWException( "Trying to host Wikimania for invalid $year\n" );
			}
			self::$i = new self( $wgWikimaniaConf );
			$wgExtensionmessagesFiles["wikimania-$year"] = dirname( __FILE__ ) .
				"/lang/Wikimania{$year}.i18n.php";
		} elseif( self::$i && self::$i->getYear() !== $year ) {
			throw new MWException( "Can only host one year at a time!\n" );
		}
	}
	public function execute( $par = '' ) {
		$this->setHeaders();
		$this->getOutput()->addModules( 'ext.wikimania' );
		$form = new WikimaniaRegistration( Wikimania::getWikimania(), $this->getContext() );
		$form->show();
	}