r86611 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86610‎ | r86611 | r86612 >
Date:09:23, 21 April 2011
Author:mkroetzsch
Status:deferred
Tags:
Comment:
fixed to use new data items properly
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Embedded.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Embedded.php
@@ -67,22 +67,25 @@
6868 }
6969
7070 // Print all result rows:
71 - foreach ( $res->getResults() as $page ) {
72 - if ( $page->getTypeID() == '_wpg' ) { // ensure that we deal with title-likes
 71+ foreach ( $res->getResults() as $diWikiPage ) {
 72+ if ( $diWikiPage->getTypeID() == '_wpg' ) { // ensure that we deal with title-likes
 73+ $dvWikiPage = SMWDataValueFactory::newDataItemValue( $diWikiPage );
7374 $result .= $embstart;
74 -
 75+
7576 if ( $this->m_showhead ) {
76 - $result .= $headstart . $page->getLongWikiText( $this->mLinker ) . $headend;
 77+ $result .= $headstart . $dvWikiPage->getLongWikiText( $this->mLinker ) . $headend;
7778 }
78 -
79 - if ( $page->getLongWikiText() != $title ) {
80 - $result .= '{{' . ( ( $page->getNamespace() == NS_MAIN ) ?
81 - ':' . $page->getDBkey():$page->getLongWikiText() ) .
82 - '}}';
83 - } else {
84 - $result .= '<b>' . $page->getLongWikiText() . '</b>';
 79+
 80+ if ( $dvWikiPage->getLongWikiText() != $title ) {
 81+ if ( $diWikiPage->getNamespace() == NS_MAIN ) {
 82+ $result .= '{{:' . $diWikiPage->getDBkey() . '}}';
 83+ } else {
 84+ $result .= '{{' . $dvWikiPage->getLongWikiText() . '}}';
 85+ }
 86+ } else { // block recursion
 87+ $result .= '<b>' . $dvWikiPage->getLongWikiText() . '</b>';
8588 }
86 -
 89+
8790 $result .= $embend;
8891 }
8992 }

Status & tagging log