# Viewing a redirect page (e.g. with parameter redirect=no)
$wgOut->addHTML( $this->viewRedirect( $rt ) );
# Parse just to get categories, displaytitle, etc.
- $this->mParserOutput = $content->getParserOutput( $this->getTitle(), $oldid, $parserOptions );
+ $this->mParserOutput = $content->getParserOutput( $this->getTitle(), $oldid, $parserOptions, false );
$wgOut->addParserOutputNoText( $this->mParserOutput );
$outputDone = true;
}
* @param null|Title $title
* @param null $revId
* @param null|ParserOptions $options
+ * @param Boolean $generateHtml whether to generate Html (default: true). If false,
+ * the result of calling getText() on the ParserOutput object returned by
+ * this method is undefined.
+ *
* @return ParserOutput
*/
- public abstract function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = NULL );
+ public abstract function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = NULL, $generateHtml = true );
/**
* Construct the redirect destination from this content and return an
*
* @return ParserOutput representing the HTML form of the text
*/
- public function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = null ) {
+ public function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = null, $generateHtml = true ) {
# generic implementation, relying on $this->getHtml()
- $html = $this->getHtml( $options );
+ if ( $generateHtml ) $html = $this->getHtml( $options );
+ else $html = '';
+
$po = new ParserOutput( $html );
return $po;
*
* @return ParserOutput representing the HTML form of the text
*/
- public function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = null ) {
+ public function getParserOutput( Title $title = null, $revId = null, ParserOptions $options = null, $generateHtml = true ) {
global $wgParser;
if ( !$options ) {
return;
}
// Not cached (save or load)
- $p_result = $wgParser->parse( $params['pst'] ? $this->pstText : $this->text, $titleObj, $popts );
+ $p_result = $wgParser->parse( $params['pst'] ? $this->pstText : $this->text, $titleObj, $popts ); #FIXME: use Content object¡
}
$result_array = array();