parent = $parent; } public function addHTML( $html ) { $this->contents .= $html; $this->flush(); } public function addWikiText( $text ) { $this->addHTML( $this->parent->parse( $text ) ); } public function addHTMLNoFlush( $html ) { $this->contents .= $html; } public function addWarning( $msg ) { $this->warnings .= "

$msg

\n"; } public function addWarningMsg( $msg /*, ... */ ) { $params = func_get_args(); array_shift( $params ); $this->addWarning( wfMsg( $msg, $params ) ); } public function redirect( $url ) { if ( $this->headerDone ) { throw new MWException( __METHOD__ . ' called after sending headers' ); } $this->redirectTarget = $url; } public function output() { $this->flush(); $this->outputFooter(); } public function useShortHeader( $use = true ) { $this->useShortHeader = $use; } public function flush() { if ( !$this->headerDone ) { $this->outputHeader(); } if ( !$this->redirectTarget && strlen( $this->contents ) ) { echo $this->contents; ob_flush(); flush(); $this->contents = ''; } } public function getDir() { global $wgLang; if( !is_object( $wgLang ) || !$wgLang->isRtl() ) return 'ltr'; else return 'rtl'; } public function getLanguageCode() { global $wgLang; if( !is_object( $wgLang ) ) return 'en'; else return $wgLang->getCode(); } public function getHeadAttribs() { return array( 'dir' => $this->getDir(), 'lang' => $this->getLanguageCode(), ); } public function headerDone() { return $this->headerDone; } public function outputHeader() { $this->headerDone = true; $dbTypes = $this->parent->getDBTypes(); $this->parent->request->response()->header("Content-Type: text/html; charset=utf-8"); if ( $this->redirectTarget ) { $this->parent->request->response()->header( 'Location: '.$this->redirectTarget ); return; } if ( $this->useShortHeader ) { $this->outputShortHeader(); return; } ?> getHeadAttribs() ); ?> <?php $this->outputTitle(); ?> outputJQuery() . "\n"; ?> $this->getDir() ) ) . "\n"; ?>

outputTitle(); ?>

outputWarnings(); if ( $this->useShortHeader ) { ?>
parent->parse( wfMsgNoTrans( 'config-sidebar' ), true ); ?>
getHeadAttribs() ); ?> <?php $this->outputTitle(); ?> outputJQuery(); ?> addHTML( $this->warnings ); $this->warnings = ''; } }