Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Factbox.php |
— | — | @@ -61,6 +61,7 @@ |
62 | 62 | '<span class="smwfactboxhead">' . wfMsgForContent( 'smw_factbox_head', $browselink->getWikiText() ) . '</span>' . |
63 | 63 | '<span class="smwrdflink">' . $rdflink->getWikiText() . '</span>' . |
64 | 64 | '<table class="smwfacttable">' . "\n"; |
| 65 | + |
65 | 66 | foreach ( $semdata->getProperties() as $propertyDi ) { |
66 | 67 | $propertyDv = SMWDataValueFactory::newDataItemValue( $propertyDi, null ); |
67 | 68 | if ( !$propertyDi->isShown() ) { // showing this is not desired, hide |
— | — | @@ -76,22 +77,22 @@ |
77 | 78 | } |
78 | 79 | |
79 | 80 | $propvalues = $semdata->getPropertyValues( $propertyDi ); |
80 | | - $l = count( $propvalues ); |
81 | | - $i = 0; |
82 | | - foreach ( $propvalues as $di ) { |
83 | | - if ( $i != 0 ) { |
84 | | - if ( $i > $l - 2 ) { |
85 | | - $text .= wfMsgForContent( 'smw_finallistconjunct' ) . ' '; |
86 | | - } else { |
87 | | - $text .= ', '; |
88 | | - } |
| 81 | + |
| 82 | + $valuesHtml = array(); |
| 83 | + |
| 84 | + foreach ( $propvalues as $dataItem ) { |
| 85 | + $dataValue = SMWDataValueFactory::newDataItemValue( $dataItem, $propertyDi ); |
| 86 | + |
| 87 | + if ( $dataValue->isValid() ) { |
| 88 | + $valuesHtml[] = $dataValue->getLongWikiText( true ) . $dataValue->getInfolinkText( SMW_OUTPUT_WIKI ); |
89 | 89 | } |
90 | | - $i += 1; |
91 | | - $dv = SMWDataValueFactory::newDataItemValue( $di, $propertyDi ); |
92 | | - $text .= $dv->getLongWikiText( true ) . $dv->getInfolinkText( SMW_OUTPUT_WIKI ); |
93 | 90 | } |
| 91 | + |
| 92 | + $text .= $GLOBALS['wgLang']->listToText( $valuesHtml ); |
| 93 | + |
94 | 94 | $text .= '</td></tr>'; |
95 | 95 | } |
| 96 | + |
96 | 97 | $text .= '</table></div>'; |
97 | 98 | } |
98 | 99 | wfProfileOut( 'SMWFactbox::printFactbox (SMW)' ); |
— | — | @@ -125,6 +126,7 @@ |
126 | 127 | } else { |
127 | 128 | $semdata = $parseroutput->mSMWData; |
128 | 129 | } |
| 130 | + |
129 | 131 | return SMWFactbox::getFactboxText( $semdata, $showfactbox ); |
130 | 132 | } |
131 | 133 | |
— | — | @@ -136,6 +138,7 @@ |
137 | 139 | static public function onOutputPageParserOutput( $outputpage, $parseroutput ) { |
138 | 140 | global $wgTitle, $wgParser; |
139 | 141 | $factbox = SMWFactbox::getFactboxTextFromOutput( $parseroutput, $wgTitle ); |
| 142 | + |
140 | 143 | if ( $factbox != '' ) { |
141 | 144 | $popts = new ParserOptions(); |
142 | 145 | $po = $wgParser->parse( $factbox, $wgTitle, $popts ); |
— | — | @@ -144,6 +147,7 @@ |
145 | 148 | SMWOutputs::requireFromParserOutput( $po ); |
146 | 149 | SMWOutputs::commitToOutputPage( $outputpage ); |
147 | 150 | } // else: nothing shown, don't even set any text |
| 151 | + |
148 | 152 | return true; |
149 | 153 | } |
150 | 154 | |