Ejemplo n.º 1
0
	public function view() {
		global $wgOut, $wgShowEXIF, $wgRequest, $wgUser;
		
		$diff = $wgRequest->getVal( 'diff' );
		$diffOnly = $wgRequest->getBool( 'diffonly', $wgUser->getOption( 'diffonly' ) );

		if ( $this->mTitle->getNamespace() != NS_TIMEDTEXT || ( isset( $diff ) && $diffOnly ) ) {
			return parent::view();
		}
		$titleParts = explode( '.', $this->mTitle->getDBKey() );
		$srt = array_pop( $titleParts );
		$lanugaeKey = array_pop( $titleParts );
		$videoTitle = Title::newFromText( implode('.', $titleParts ), NS_FILE );
		
		// Look up the language name: 	
		$languages = Language::getTranslatedLanguageNames( 'en' );
		if( isset( $languages[ $lanugaeKey ] ) ) {
			$languageName = $languages[ $lanugaeKey ];
		} else {
			$languageName = $lanugaeKey;
		}
		
		// Set title 
		$wgOut->setPageTitle( wfMsg('mwe-timedtext-language-subtitles-for-clip', $languageName,  $videoTitle) );

		// Get the video with with a max of 600 pixel page
		$wgOut->addHTML( 
			xml::tags( 'table', array( 'style'=> 'border:none' ), 
				xml::tags( 'tr', null, 
					xml::tags( 'td', array( 'valign' => 'top',  'width' => self::$videoWidth ), $this->getVideoHTML( $videoTitle ) ) .
					xml::tags( 'td', array( 'valign' => 'top' ) , $this->getSrtHTML( $languageName ) )
				)
			)
		);	
	}