Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_JSONlink.php |
— | — | @@ -97,13 +97,16 @@ |
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | | - if ( $finalvalues != '' ) $valuestack[] = '"' . str_replace( ' ', '_', strtolower( $pr->getLabel() ) ) . '": ' . $finalvalues . ''; |
| 101 | + if ( $finalvalues != '' ) { |
| 102 | + $valuestack[] = '"' . str_replace( ' ', '_', strtolower( $pr->getLabel() ) ) . '": ' . $finalvalues . ''; |
| 103 | + } |
102 | 104 | } |
103 | 105 | } |
104 | 106 | |
105 | 107 | if ( $rowsubject !== false ) { // stuff in the page URI and some category data |
106 | 108 | $valuestack[] = '"uri" : "' . $wgServer . $wgScriptPath . '/index.php?title=' . $rowsubject->getPrefixedText() . '"'; |
107 | 109 | $page_cats = smwfGetStore()->getPropertyValues( $rowsubject, new SMWDIProperty( '_INST' ) ); // TODO: set limit to 1 here |
| 110 | + |
108 | 111 | if ( count( $page_cats ) > 0 ) { |
109 | 112 | $valuestack[] = '"type" : "' . reset($page_cats)->getShortHTMLText() . '"'; |
110 | 113 | } |
— | — | @@ -145,7 +148,9 @@ |
146 | 149 | |
147 | 150 | $link->setParameter( 'json', 'format' ); |
148 | 151 | $result = $link->getText( $outputmode, $this->mLinker ); |
149 | | - $this->isHTML = ( $outputmode == SMW_OUTPUT_HTML ); // yes, our code can be viewed as HTML if requested, no more parsing needed |
| 152 | + |
| 153 | + // yes, our code can be viewed as HTML if requested, no more parsing needed |
| 154 | + $this->isHTML = $outputmode == SMW_OUTPUT_HTML; |
150 | 155 | } |
151 | 156 | |
152 | 157 | return $result; |