Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php |
— | — | @@ -258,7 +258,7 @@ |
259 | 259 | foreach ( $this->m_printouts as $printout ) { |
260 | 260 | $printoutstring .= $printout->getSerialisation() . "\n"; |
261 | 261 | } |
262 | | - if ( '' != $printoutstring ) $urltail .= '&po=' . urlencode( $printoutstring ); |
| 262 | + if ( $printoutstring != '' ) $urltail .= '&po=' . urlencode( $printoutstring ); |
263 | 263 | if ( array_key_exists( 'sort', $this->m_params ) ) $urltail .= '&sort=' . $this->m_params['sort']; |
264 | 264 | if ( array_key_exists( 'order', $this->m_params ) ) $urltail .= '&order=' . $this->m_params['order']; |
265 | 265 | |
Index: trunk/extensions/SemanticMediaWiki/specials/Export/SMW_SpecialOWLExport.php |
— | — | @@ -50,7 +50,7 @@ |
51 | 51 | |
52 | 52 | if ( $page == '' ) { // try to get POST list; some settings are only available via POST |
53 | 53 | $pageblob = $wgRequest->getText( 'pages' ); |
54 | | - if ( '' != $pageblob ) { |
| 54 | + if ( $pageblob != '' ) { |
55 | 55 | $pages = explode( "\n", $pageblob ); |
56 | 56 | } |
57 | 57 | } else { |
— | — | @@ -309,17 +309,20 @@ |
310 | 310 | // for pages not processed recursively, print at least basic declarations |
311 | 311 | wfProfileIn( "RDF::PrintPages::Auxiliary" ); |
312 | 312 | $this->date = ''; // no date restriction for the rest! |
| 313 | + |
313 | 314 | if ( !empty( $this->element_queue ) ) { |
314 | | - if ( '' != $this->pre_ns_buffer ) { |
| 315 | + if ( $this->pre_ns_buffer != '' ) { |
315 | 316 | $this->post_ns_buffer .= "\t<!-- auxiliary definitions -->\n"; |
316 | 317 | } else { |
317 | 318 | print "\t<!-- auxiliary definitions -->\n"; // just print this comment, so that later outputs still find the empty pre_ns_buffer! |
318 | 319 | } |
| 320 | + |
319 | 321 | while ( !empty( $this->element_queue ) ) { |
320 | 322 | $st = array_pop( $this->element_queue ); |
321 | 323 | $this->printObject( $st, false, false ); |
322 | 324 | } |
323 | 325 | } |
| 326 | + |
324 | 327 | wfProfileOut( "RDF::PrintPages::Auxiliary" ); |
325 | 328 | $this->printFooter(); |
326 | 329 | $this->flushBuffers( true ); |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_List.php |
— | — | @@ -140,21 +140,26 @@ |
141 | 141 | } |
142 | 142 | if ( $first_value ) { // first value in any column, print header |
143 | 143 | $first_value = false; |
144 | | - if ( ( $this->mShowHeaders != SMW_HEADERS_HIDE ) && ( '' != $field->getPrintRequest()->getLabel() ) ) { |
| 144 | + |
| 145 | + if ( ( $this->mShowHeaders != SMW_HEADERS_HIDE ) && ( $field->getPrintRequest()->getLabel() != '' ) ) { |
145 | 146 | $result .= $field->getPrintRequest()->getText( SMW_OUTPUT_WIKI, ( $this->mShowHeaders == SMW_HEADERS_PLAIN ? null:$this->mLinker ) ) . ' '; |
146 | 147 | } |
147 | 148 | } |
| 149 | + |
148 | 150 | $result .= $text; // actual output value |
149 | 151 | } |
| 152 | + |
150 | 153 | $first_col = false; |
151 | 154 | } |
| 155 | + |
152 | 156 | if ( $found_values ) $result .= ')'; |
153 | 157 | } |
| 158 | + |
154 | 159 | $result .= $rowend; |
155 | 160 | } |
156 | 161 | |
157 | 162 | // Make label for finding further results |
158 | | - if ( $this->linkFurtherResults( $res ) && ( ( 'ol' != $this->mFormat ) || ( $this->getSearchLabel( SMW_OUTPUT_WIKI ) ) ) ) { |
| 163 | + if ( $this->linkFurtherResults( $res ) && ( ( $this->mFormat != 'ol' ) || ( $this->getSearchLabel( SMW_OUTPUT_WIKI ) ) ) ) { |
159 | 164 | $link = $res->getQueryLink(); |
160 | 165 | if ( $this->getSearchLabel( SMW_OUTPUT_WIKI ) ) { |
161 | 166 | $link->setCaption( $this->getSearchLabel( SMW_OUTPUT_WIKI ) ); |
— | — | @@ -184,15 +189,20 @@ |
185 | 190 | public function getParameters() { |
186 | 191 | $params = parent::getParameters(); |
187 | 192 | $params = array_merge( $params, parent::textDisplayParameters() ); |
188 | | - $plainlist = ( 'ul' != $this->mFormat && 'ol' != $this->mFormat ); |
| 193 | + |
| 194 | + $plainlist = ( $this->mFormat != 'ul' && $this->mFormat != 'ol' ); |
| 195 | + |
189 | 196 | if ( $plainlist ) { |
190 | 197 | $params[] = array( 'name' => 'sep', 'type' => 'string', 'description' => wfMsg( 'smw_paramdesc_sep' ) ); |
191 | 198 | } |
| 199 | + |
192 | 200 | $params[] = array( 'name' => 'template', 'type' => 'string', 'description' => wfMsg( 'smw_paramdesc_template' ) ); |
| 201 | + |
193 | 202 | if ( ! $plainlist ) { |
194 | 203 | $params[] = array( 'name' => 'columns', 'type' => 'int', 'description' => wfMsg( 'smw_paramdesc_columns', 1 ) ); |
195 | 204 | } |
| 205 | + |
196 | 206 | return $params; |
197 | 207 | } |
198 | 208 | |
199 | | -} |
| 209 | +} |
\ No newline at end of file |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_Category.php |
— | — | @@ -106,6 +106,7 @@ |
107 | 107 | $found_values = false; // has anything but the first column been printed? |
108 | 108 | foreach ( $row as $field ) { |
109 | 109 | $first_value = true; |
| 110 | + |
110 | 111 | while ( ( $text = $field->getNextText( SMW_OUTPUT_WIKI, $this->getLinker( $first_col ) ) ) !== false ) { |
111 | 112 | if ( !$first_col && !$found_values ) { // first values after first column |
112 | 113 | $result .= ' ('; |
— | — | @@ -114,25 +115,32 @@ |
115 | 116 | // any value after '(' or non-first values on first column |
116 | 117 | $result .= ', '; |
117 | 118 | } |
| 119 | + |
118 | 120 | if ( $first_value ) { // first value in any column, print header |
119 | 121 | $first_value = false; |
120 | | - if ( $this->mShowHeaders && ( '' != $field->getPrintRequest()->getLabel() ) ) { |
| 122 | + |
| 123 | + if ( $this->mShowHeaders && ( $field->getPrintRequest()->getLabel() != '' ) ) { |
121 | 124 | $result .= $field->getPrintRequest()->getText( SMW_OUTPUT_WIKI, $this->mLinker ) . ' '; |
122 | 125 | } |
123 | 126 | } |
| 127 | + |
124 | 128 | $result .= $text; // actual output value |
125 | 129 | } |
| 130 | + |
126 | 131 | $first_col = false; |
127 | 132 | } |
| 133 | + |
128 | 134 | if ( $found_values ) $result .= ')'; |
129 | 135 | } |
| 136 | + |
130 | 137 | $result .= '</li>'; |
131 | 138 | $row = $nextrow; |
132 | 139 | |
133 | 140 | // end list if we're at the end of the column |
134 | 141 | // or the page |
135 | | - if ( ( $rowindex + 1 ) % $rows_per_column == 0 && ( $rowindex + 1 ) < $num ) |
| 142 | + if ( ( $rowindex + 1 ) % $rows_per_column == 0 && ( $rowindex + 1 ) < $num ) { |
136 | 143 | $result .= " </ul>\n </div> <!-- end column -->"; |
| 144 | + } |
137 | 145 | |
138 | 146 | $rowindex++; |
139 | 147 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php |
— | — | @@ -1091,7 +1091,7 @@ |
1092 | 1092 | $qobj = $this->m_queries[$rootid]; |
1093 | 1093 | |
1094 | 1094 | foreach ( $this->m_sortkeys as $propkey => $order ) { |
1095 | | - if ( ( 'RANDOM' != $order ) && array_key_exists( $propkey, $qobj->sortfields ) ) { // Field was successfully added. |
| 1095 | + if ( ( $order != 'RANDOM' ) && array_key_exists( $propkey, $qobj->sortfields ) ) { // Field was successfully added. |
1096 | 1096 | $result['ORDER BY'] = ( array_key_exists( 'ORDER BY', $result ) ? $result['ORDER BY'] . ', ' : '' ) . $qobj->sortfields[$propkey] . " $order "; |
1097 | 1097 | } elseif ( ( $order == 'RANDOM' ) && $smwgQRandSortingSupport ) { |
1098 | 1098 | $result['ORDER BY'] = ( array_key_exists( 'ORDER BY', $result ) ? $result['ORDER BY'] . ', ' : '' ) . ' RAND() '; |