getParser(); $parser = $mainParser->getFreshParser(); $localizedData = $content->getLocalizedData( $options->getUserLangObj() ); if ( $localizedData ) { $extReg = ExtensionRegistry::getInstance(); // Test both because for some reason mTagHooks is not set during preview if ( isset( $mainParser->mTagHooks['mapframe'] ) || $extReg->isLoaded( 'Kartographer' ) ) { $zoom = $content->getField( 'zoom' ); $lat = $content->getField( 'latitude' ); $lon = $content->getField( 'longitude' ); if ( $zoom && $lat && $lon && !$zoom->error() && !$lat->error() && !$lon->error() ) { $zoom = $zoom->getValue(); $lat = $lat->getValue(); $lon = $lon->getValue(); } else { $zoom = 3; $lat = $lon = 0; } $jsonText = FormatJson::encode( $localizedData->data, false, FormatJson::UTF8_OK ); $text = << $jsonText EOT; } else { $jsonText = FormatJson::encode( $localizedData->data, true, FormatJson::UTF8_OK ); if ( isset( $mainParser->mTagHooks['syntaxhighlight'] ) || $extReg->isLoaded( 'SyntaxHighlight' ) ) { $text = "\n$jsonText\n"; } else { $text = "
\n$jsonText\n
"; } } $output = $parser->parse( $text, $title, $options, true, true, $revId ); } return $content->renderDescription( $options->getUserLangObj() ) . '
' . $output->getRawText() . '
' . $content->renderSources( $parser, $title, $revId, $options ) . $content->renderLicense(); } /** * Returns default content for this object. * The returned valued does not have to be valid JSON * @param string $modelId * @return string */ public function getDefault( $modelId ) { $licenseIntro = JCContentView::getLicenseIntro(); return <<