Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_Embedded.php |
— | — | @@ -67,22 +67,25 @@ |
68 | 68 | } |
69 | 69 | |
70 | 70 | // 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 ); |
73 | 74 | $result .= $embstart; |
74 | | - |
| 75 | + |
75 | 76 | if ( $this->m_showhead ) { |
76 | | - $result .= $headstart . $page->getLongWikiText( $this->mLinker ) . $headend; |
| 77 | + $result .= $headstart . $dvWikiPage->getLongWikiText( $this->mLinker ) . $headend; |
77 | 78 | } |
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>'; |
85 | 88 | } |
86 | | - |
| 89 | + |
87 | 90 | $result .= $embend; |
88 | 91 | } |
89 | 92 | } |