tag is * used. * * @license GNU GPL v2+ * @since 1.7 * * @author Fernando Correia * @author Markus Krötzsch */ class EmbeddedResultPrinter extends ResultPrinter { protected $m_showhead; protected $m_embedformat; /** * @see SMWResultPrinter::handleParameters * * @since 1.7 * * @param array $params * @param $outputmode */ protected function handleParameters( array $params, $outputmode ) { parent::handleParameters( $params, $outputmode ); $this->m_showhead = !$params['embedonly']; $this->m_embedformat = $params['embedformat']; } public function getName() { return wfMessage( 'smw_printername_embedded' )->text(); } /** * @see ResultPrinter::isDeferrable * * {@inheritDoc} */ public function isDeferrable() { return true; } protected function getResultText( SMWQueryResult $res, $outputMode ) { // Ensure that there is an annotation block in place before starting the // parse and transclution process. Unfortunately we are unable to block // the inclusion of categories which are attached to a MediaWiki // object we have no immediate access or control. $this->transcludeAnnotation = false; global $wgParser; // No page should embed itself, find out who we are: if ( $wgParser->getTitle() instanceof Title ) { $title = $wgParser->getTitle()->getPrefixedText(); } else { // this is likely to be in vain -- this case is typical if we run on special pages global $wgTitle; $title = $wgTitle->getPrefixedText(); } // print header $result = ''; $footer = ''; $embstart = ''; $embend = ''; $headstart = ''; $headend = ''; $this->hasTemplates = true; switch ( $this->m_embedformat ) { case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': $headstart = '<' . $this->m_embedformat . '>'; $headend = '' . $this->m_embedformat . ">\n"; break; case 'ul': case 'ol': $result .= '<' . $this->m_embedformat . '>'; $footer = '' . $this->m_embedformat . '>'; $embstart = '