r106434 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106433‎ | r106434 | r106435 >
Date:14:33, 16 December 2011
Author:nikerabbit
Status:deferred
Tags:
Comment:
Stylize
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/SMW_Settings.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/SemanticMediaWiki.hooks.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/SemanticMediaWiki.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/SemanticMediaWiki.hooks.php
@@ -31,70 +31,70 @@
3232 $updater->addPostDatabaseUpdateMaintenance( 'SMWSetupScript' );
3333 }
3434 }
35 -
 35+
3636 return true;
3737 }
38 -
 38+
3939 /**
4040 * TODO
41 - *
 41+ *
4242 * @since 1.7
43 - *
 43+ *
4444 * @return true
4545 */
4646 public static function onPageSchemasRegistration() {
4747 $GLOBALS['wgPageSchemasHandlerClasses'][] = 'SMWPageSchemas';
4848 return true;
4949 }
50 -
 50+
5151 /**
5252 * Adds links to Admin Links page.
53 - *
 53+ *
5454 * @since 1.7
55 - *
 55+ *
5656 * @param ALTree $admin_links_tree
57 - *
 57+ *
5858 * @return true
5959 */
6060 public static function addToAdminLinks( ALTree &$admin_links_tree ) {
6161 $data_structure_section = new ALSection( wfMsg( 'smw_adminlinks_datastructure' ) );
62 -
 62+
6363 $smw_row = new ALRow( 'smw' );
6464 $smw_row->addItem( ALItem::newFromSpecialPage( 'Categories' ) );
6565 $smw_row->addItem( ALItem::newFromSpecialPage( 'Properties' ) );
6666 $smw_row->addItem( ALItem::newFromSpecialPage( 'UnusedProperties' ) );
6767 $smw_row->addItem( ALItem::newFromSpecialPage( 'SemanticStatistics' ) );
68 -
 68+
6969 $data_structure_section->addRow( $smw_row );
7070 $smw_admin_row = new ALRow( 'smw_admin' );
7171 $smw_admin_row->addItem( ALItem::newFromSpecialPage( 'SMWAdmin' ) );
72 -
 72+
7373 $data_structure_section->addRow( $smw_admin_row );
7474 $smw_docu_row = new ALRow( 'smw_docu' );
7575 $smw_name = wfMsg( 'specialpages-group-smw_group' );
7676 $smw_docu_label = wfMsg( 'adminlinks_documentation', $smw_name );
7777 $smw_docu_row->addItem( AlItem::newFromExternalLink( 'http://semantic-mediawiki.org/wiki/Help:User_manual', $smw_docu_label ) );
78 -
 78+
7979 $data_structure_section->addRow( $smw_docu_row );
8080 $admin_links_tree->addSection( $data_structure_section, wfMsg( 'adminlinks_browsesearch' ) );
8181 $smw_row = new ALRow( 'smw' );
8282 $displaying_data_section = new ALSection( wfMsg( 'smw_adminlinks_displayingdata' ) );
8383 $smw_row->addItem( AlItem::newFromExternalLink( 'http://semantic-mediawiki.org/wiki/Help:Inline_queries', wfMsg( 'smw_adminlinks_inlinequerieshelp' ) ) );
84 -
 84+
8585 $displaying_data_section->addRow( $smw_row );
8686 $admin_links_tree->addSection( $displaying_data_section, wfMsg( 'adminlinks_browsesearch' ) );
8787 $browse_search_section = $admin_links_tree->getSection( wfMsg( 'adminlinks_browsesearch' ) );
88 -
 88+
8989 $smw_row = new ALRow( 'smw' );
9090 $smw_row->addItem( ALItem::newFromSpecialPage( 'Browse' ) );
9191 $smw_row->addItem( ALItem::newFromSpecialPage( 'Ask' ) );
9292 $smw_row->addItem( ALItem::newFromSpecialPage( 'SearchByProperty' ) );
9393 $browse_search_section->addRow( $smw_row );
94 -
 94+
9595 return true;
9696 }
97 -
98 -
 97+
 98+
9999 /**
100100 * Register special classes for displaying semantic content on Property and
101101 * Concept pages.
@@ -112,15 +112,15 @@
113113 } elseif ( $title->getNamespace() == SMW_NS_CONCEPT ) {
114114 $article = new SMWConceptPage( $title );
115115 }
116 -
 116+
117117 return true;
118118 }
119 -
 119+
120120 /**
121121 * This hook registers parser functions and hooks to the given parser. It is
122122 * called during SMW initialisation. Note that parser hooks are something different
123123 * than MW hooks in general, which explains the two-level registration.
124 - *
 124+ *
125125 * @since 1.7
126126 */
127127 public static function onParserFirstCallInit( Parser &$parser ) {
@@ -131,10 +131,10 @@
132132 $parser->setFunctionHook( 'set', array( 'SMWSet', 'render' ) );
133133 $parser->setFunctionHook( 'set_recurring_event', array( 'SMWSetRecurringEvent', 'render' ) );
134134 $parser->setFunctionHook( 'declare', array( 'SMWDeclare', 'render' ), SFH_OBJECT_ARGS );
135 -
 135+
136136 return true; // Always return true, in order not to stop MW's hook processing!
137137 }
138 -
 138+
139139 /**
140140 * Adds the 'Powered by Semantic MediaWiki' button right next to the default
141141 * 'Powered by MediaWiki' button at the bottom of every page. This works
@@ -149,9 +149,9 @@
150150 public static function addPoweredBySMW( &$text, $skin ) {
151151 global $smwgScriptPath;
152152 $url = htmlspecialchars( "$smwgScriptPath/skins/images/smw_button.png" );
153 - $text .= ' <a href="http://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki"><img src="'. $url . '" alt="Powered by Semantic MediaWiki" /></a>';
154 -
 153+ $text .= ' <a href="http://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki"><img src="' . $url . '" alt="Powered by Semantic MediaWiki" /></a>';
 154+
155155 return true; // Always return true, in order not to stop MW's hook processing!
156156 }
157 -
 157+
158158 }
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php
@@ -60,10 +60,10 @@
6161 // get the GET parameters
6262 $this->propertystring = $wgRequest->getText( 'property' );
6363 $this->valuestring = $wgRequest->getText( 'value' );
64 -
 64+
6565 $params = SMWInfolink::decodeParameters( $query, false );
6666 reset( $params );
67 -
 67+
6868 // no GET parameters? Then try the URL
6969 if ( $this->propertystring === '' ) $this->propertystring = current( $params );
7070 if ( $this->valuestring === '' ) $this->valuestring = next( $params );
@@ -77,7 +77,7 @@
7878 } else {
7979 $this->propertystring = $this->property->getWikiValue();
8080 $this->value = SMWDataValueFactory::newPropertyObjectValue( $this->property->getDataItem(), $this->valuestring );
81 -
 81+
8282 if ( $this->value->isValid() ) {
8383 $this->valuestring = $this->value->getWikiValue();
8484 } else {
@@ -89,7 +89,7 @@
9090 if ( is_numeric( $limitstring ) ) {
9191 $this->limit = intval( $limitstring );
9292 }
93 -
 93+
9494 $offsetstring = $wgRequest->getVal( 'offset' );
9595 if ( is_numeric( $offsetstring ) ) {
9696 $this->offset = intval( $offsetstring );
@@ -97,7 +97,7 @@
9898
9999 $wgOut->addHTML( $this->displaySearchByProperty() );
100100 $wgOut->addHTML( $this->queryForm() );
101 -
 101+
102102 SMWOutputs::commitToOutputPage( $wgOut ); // make sure locally collected output data is pushed to the output!
103103 }
104104
@@ -113,7 +113,7 @@
114114 if ( $this->propertystring === '' ) {
115115 return '<p>' . wfMsg( 'smw_sbv_docu' ) . "</p>\n";
116116 }
117 -
 117+
118118 if ( ( $this->value == null ) || !$this->value->isValid() ) {
119119 return '<p>' . wfMsg( 'smw_sbv_novalue', $this->property->getShortHTMLText( $linker ) ) . "</p>\n";
120120 }
@@ -123,19 +123,19 @@
124124
125125 $exact = $this->getExactResults();
126126 $count = count( $exact );
127 -
 127+
128128 if ( ( $count < ( $this->limit / 3 ) ) && ( $this->value->isNumeric() ) && $smwgSearchByPropertyFuzzy ) {
129129 $greater = $this->getNearbyResults( $count, true );
130130 $lesser = $this->getNearbyResults( $count, false );
131 -
 131+
132132 // Calculate how many greater and lesser results should be displayed
133133 $cG = count( $greater );
134134 $cL = count( $lesser );
135 -
 135+
136136 if ( ( $cG + $cL + $count ) > $this->limit ) {
137137 $l = $this->limit - $count;
138138 $lhalf = round( $l / 2 );
139 -
 139+
140140 if ( $lhalf < $cG ) {
141141 if ( $lhalf < $cL ) {
142142 $cL = $lhalf; $cG = $lhalf;
@@ -146,24 +146,24 @@
147147 $cL = $this->limit - ( $count + $cG );
148148 }
149149 }
150 -
 150+
151151 if ( ( $cG + $cL + $count ) == 0 )
152152 $html .= wfMsg( 'smw_result_noresults' );
153153 else {
154154 $html .= wfMsg( 'smw_sbv_displayresultfuzzy', $this->property->getShortHTMLText( $linker ), $this->value->getShortHTMLText( $linker ) ) . "<br />\n";
155155 $html .= $this->displayResults( $lesser, $cL, false );
156 -
 156+
157157 if ( $count == 0 ) {
158158 $html .= " &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<em><strong><small>(" . $this->value->getLongHTMLText() . ")</small></strong></em>\n";
159159 } else {
160160 $html .= $this->displayResults( $exact, $count, true, true );
161161 }
162 -
 162+
163163 $html .= $this->displayResults( $greater, $cG );
164164 }
165165 } else {
166166 $html .= wfMsg( 'smw_sbv_displayresult', $this->property->getShortHTMLText( $linker ), $this->value->getShortHTMLText( $linker ) ) . "<br />\n";
167 -
 167+
168168 if ( 0 == $count ) {
169169 $html .= wfMsg( 'smw_result_noresults' );
170170 } else {
@@ -175,7 +175,7 @@
176176 }
177177
178178 $html .= '<p>&#160;</p>';
179 -
 179+
180180 return $html;
181181 }
182182
@@ -186,7 +186,7 @@
187187 * @param[in] $number int How many results should be displayed? -1 for all
188188 * @param[in] $first bool If less results should be displayed than given, should they show the first $number results, or the last $number results?
189189 * @param[in] $highlight bool Should the results be highlighted?
190 - *
 190+ *
191191 * @return string HTML with the bullet list and a header
192192 */
193193 private function displayResults( $results, $number = - 1, $first = true, $highlight = false ) {
@@ -197,30 +197,30 @@
198198 // I (jeroendedauw) replaced a loop using array_shift by this, which is equivalent.
199199 $results = array_slice( array_reverse( $results ), 0, $number );
200200 }
201 -
 201+
202202 while ( $results && $number != 0 ) {
203203 $result = array_shift( $results );
204 -
 204+
205205 $html .= '<li>' . $result[0]->getLongHTMLText( smwfGetLinker() );
206 -
 206+
207207 if ( $result[0]->getTypeID() == '_wpg' ) {
208208 $html .= '&#160;&#160;' . SMWInfolink::newBrowsingLink( '+', $result[0]->getLongWikiText() )->getHTML( smwfGetLinker() );
209209 }
210 -
 210+
211211 if ( is_object( $result[1] ) && ( ( $this->value != $result[1] ) || $highlight ) ) {
212212 $html .= " <em><small>(" . $result[1]->getLongHTMLText( smwfGetLinker() ) . ")</small></em>";
213213 }
214 -
 214+
215215 $html .= "</li>";
216 -
 216+
217217 if ( $highlight ) {
218218 $html = "<strong>" . $html . "</strong>";
219219 }
220 -
 220+
221221 $html .= "\n";
222222 $number--;
223223 }
224 -
 224+
225225 $html .= "</ul>\n";
226226
227227 return $html;
@@ -241,19 +241,19 @@
242242 'a',
243243 array(
244244 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array(
245 - 'offset' => max( 0, $this->offset - $this->limit ),
 245+ 'offset' => max( 0, $this->offset - $this->limit ),
246246 'limit' => $this->limit,
247 - 'property' => $this->property->getWikiValue(),
 247+ 'property' => $this->property->getWikiValue(),
248248 'value' => $this->value->getWikiValue()
249249 ) )
250250 ),
251251 wfMsg( 'smw_result_prev' )
252 - );
 252+ );
253253 }
254254 else {
255255 $navigation = wfMsg( 'smw_result_prev' );
256256 }
257 -
 257+
258258 $navigation .=
259259 '&#160;&#160;&#160;&#160; <b>' .
260260 wfMsg( 'smw_result_results' ) . ' ' .
@@ -266,44 +266,44 @@
267267 'a',
268268 array(
269269 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array(
270 - 'offset' => $this->offset + $this->limit,
 270+ 'offset' => $this->offset + $this->limit,
271271 'limit' => $this->limit,
272 - 'property' => $this->property->getWikiValue(),
 272+ 'property' => $this->property->getWikiValue(),
273273 'value' => $this->value->getWikiValue()
274274 ) )
275275 ),
276276 wfMsg( 'smw_result_next' )
277 - );
 277+ );
278278 } else {
279279 $navigation .= wfMsg( 'smw_result_next' );
280280 }
281281
282282 $max = false;
283283 $first = true;
284 -
 284+
285285 foreach ( array( 20, 50, 100, 250, 500 ) as $l ) {
286286 if ( $max ) continue;
287 -
 287+
288288 if ( $first ) {
289289 $navigation .= '&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;(';
290290 $first = false;
291291 } else {
292292 $navigation .= ' ' . wfMsgExt( 'pipe-separator' , 'escapenoentities' ) . ' ';
293293 }
294 -
 294+
295295 if ( $l > $smwgQMaxInlineLimit ) {
296296 $l = $smwgQMaxInlineLimit;
297297 $max = true;
298298 }
299 -
 299+
300300 if ( $this->limit != $l ) {
301301 $navigation .= Html::element(
302302 'a',
303303 array(
304304 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array(
305 - 'offset' => $this->offset,
 305+ 'offset' => $this->offset,
306306 'limit' => $l,
307 - 'property' => $this->property->getWikiValue(),
 307+ 'property' => $this->property->getWikiValue(),
308308 'value' => $this->value->getWikiValue()
309309 ) )
310310 ),
@@ -313,9 +313,9 @@
314314 $navigation .= '<b>' . $l . '</b>';
315315 }
316316 }
317 -
 317+
318318 $navigation .= ')';
319 -
 319+
320320 return $navigation;
321321 }
322322
@@ -332,7 +332,7 @@
333333
334334 $res = smwfGetStore()->getPropertySubjects( $this->property->getDataItem(), $this->value->getDataItem(), $options );
335335 $results = array();
336 -
 336+
337337 foreach ( $res as $result ) {
338338 array_push( $results, array(
339339 SMWDataValueFactory::newDataItemValue( $result, null ),
@@ -349,7 +349,7 @@
350350 *
351351 * @param[in] $count int How many entities have the exact same value on the property?
352352 * @param[in] $greater bool Should the values be bigger? Set false for smaller values
353 - *
 353+ *
354354 * @return array of array of SMWWikiPageValue, SMWDataValue with the first being the entity, and the second the value
355355 */
356356 private function getNearbyResults( $count, $greater = true ) {
@@ -368,7 +368,7 @@
369369 if ( $greater ) $params['order'] = 'ASC';
370370 $cmp = '<';
371371 if ( $greater ) $cmp = '>';
372 -
 372+
373373 $querystring = '[[' . $this->propertystring . '::' . $cmp . $this->valuestring . ']]';
374374 $params = SMWQueryProcessor::getProcessedParams( $params, array( $printrequest ) );
375375 $queryobj = SMWQueryProcessor::createQuery( $querystring, $params, SMWQueryProcessor::SPECIAL_PAGE, 'ul', array( $printrequest ) );
@@ -380,16 +380,16 @@
381381
382382 $result = $results->getNext();
383383 $ret = array();
384 -
 384+
385385 while ( $result ) {
386386 $ret[] = array( $result[0]->getNextDataValue(), $result[1]->getNextDataValue() );
387387 $result = $results->getNext();
388388 }
389 -
 389+
390390 if ( !$greater ) {
391391 $ret = array_reverse( $ret );
392392 }
393 -
 393+
394394 return $ret;
395395 }
396396
@@ -413,17 +413,17 @@
414414 /**
415415 * Creates the JS needed for adding auto-completion to queryForm(). Uses the
416416 * MW API to fetch suggestions.
417 - *
 417+ *
418418 */
419419 protected static function addAutoComplete() {
420420 SMWOutputs::requireResource( 'jquery.ui.autocomplete' );
421 -
 421+
422422 $javascript_autocomplete_text = <<<END
423423 <script type="text/javascript">
424424 jQuery(document).ready(function(){
425425 jQuery("#property_box").autocomplete({
426426 minLength: 2,
427 - source: function(request, response) {
 427+ source: function(request, response) {
428428 jQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace='+wgNamespaceIds['property']+'&format=jsonfm&search='+request.term, function(data){
429429 //remove the word 'Property:' from returned data
430430 for(i=0;i<data[1].length;i++) data[1][i]=data[1][i].substr(data[1][i].indexOf(':')+1);
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php
@@ -116,7 +116,7 @@
117117 * @param[in] $data SMWSemanticData The data to be displayed
118118 * @param[in] $left bool Should properties be displayed on the left side?
119119 * @param[in] $incoming bool Is this an incoming? Or an outgoing?
120 - *
 120+ *
121121 * @return A string containing the HTML with the factbox
122122 */
123123 private function displayData( SMWSemanticData $data, $left = true, $incoming = false ) {
@@ -176,13 +176,13 @@
177177 'a',
178178 array(
179179 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array(
180 - 'property' => $dvProperty->getWikiValue(),
 180+ 'property' => $dvProperty->getWikiValue(),
181181 'value' => $this->subject->getWikiValue()
182182 ) )
183183 ),
184184 wfMsg( "smw_browse_more" )
185185 );
186 -
 186+
187187 }
188188
189189 $body .= "</td>\n";
@@ -207,14 +207,14 @@
208208 * @param[in] $property SMWPropertyValue The property this value is linked to the subject with
209209 * @param[in] $value SMWDataValue The actual value
210210 * @param[in] $incoming bool If this is an incoming or outgoing link
211 - *
 211+ *
212212 * @return string HTML with the link to the article, browse, and search pages
213213 */
214214 private function displayValue( SMWPropertyValue $property, SMWDataValue $dataValue, $incoming ) {
215215 $linker = smwfGetLinker();
216 -
 216+
217217 $html = $dataValue->getLongHTMLText( $linker );
218 -
 218+
219219 if ( $dataValue->getTypeID() == '_wpg' ) {
220220 $html .= "&#160;" . SMWInfolink::newBrowsingLink( '+', $dataValue->getLongWikiText() )->getHTML( $linker );
221221 } elseif ( $incoming && $property->isVisible() ) {
@@ -222,7 +222,7 @@
223223 } else {
224224 $html .= $dataValue->getInfolinkText( SMW_OUTPUT_HTML, $linker );
225225 }
226 -
 226+
227227 return $html;
228228 }
229229
@@ -290,13 +290,13 @@
291291 * @param[in] $out bool Should the linked to page include outgoing properties?
292292 * @param[in] $in bool Should the linked to page include incoming properties?
293293 * @param[in] $offset int What is the offset for the incoming properties?
294 - *
 294+ *
295295 * @return string HTML with the link to this page
296296 */
297297 private function linkHere( $text, $out, $in, $offset ) {
298298 $dir = $out ? ( $in ? 'both' : 'out' ) : 'in';
299299 $frag = ( $text == wfMsg( 'smw_browse_show_incoming' ) ) ? '#smw_browse_incoming' : '';
300 -
 300+
301301 return Html::element(
302302 'a',
303303 array(
@@ -334,7 +334,7 @@
335335 $valoptions = new SMWRequestOptions();
336336 $valoptions->sort = true;
337337 $valoptions->limit = SMWSpecialBrowse::$incomingvaluescount;
338 -
 338+
339339 foreach ( $inproperties as $property ) {
340340 $values = smwfGetStore()->getPropertySubjects( $property, $this->subject->getDataItem(), $valoptions );
341341 foreach ( $values as $value ) {
@@ -352,12 +352,12 @@
353353 *
354354 * @param[in] $property SMWPropertyValue The property of interest
355355 * @param[in] $incoming bool If it is an incoming property
356 - *
 356+ *
357357 * @return string The label of the property
358358 */
359359 private function getPropertyLabel( SMWPropertyValue $property, $incoming = false ) {
360360 global $smwgBrowseShowInverse;
361 -
 361+
362362 if ( $incoming && $smwgBrowseShowInverse ) {
363363 $oppositeprop = SMWPropertyValue::makeUserProperty( wfMsg( 'smw_inverse_label_property' ) );
364364 $labelarray = &smwfGetStore()->getPropertyValues( $property->getDataItem()->getDiWikiPage(), $oppositeprop->getDataItem() );
@@ -366,7 +366,7 @@
367367 } else {
368368 $rv = $property->getWikiValue();
369369 }
370 -
 370+
371371 return $this->unbreak( $rv );
372372 }
373373
@@ -390,7 +390,7 @@
391391 * Creates the JS needed for adding auto-completion to queryForm(). Uses the
392392 * MW API to fetch suggestions.
393393 */
394 - private static function addAutoComplete(){
 394+ private static function addAutoComplete() {
395395 SMWOutputs::requireResource( 'jquery.ui.autocomplete' );
396396
397397 $javascript_autocomplete_text = <<<END
@@ -423,5 +423,5 @@
424424 $text = preg_replace( '/[\s]/u', $nonBreakingSpace, $text, - 1, $count );
425425 return $count > 2 ? preg_replace( '/($nonBreakingSpace)/u', ' ', $text, max( 0, $count - 2 ) ):$text;
426426 }
427 -
 427+
428428 }
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php
@@ -20,7 +20,7 @@
2121 * @ingroup SpecialPage
2222 */
2323 class SMWPageProperty extends SpecialPage {
24 -
 24+
2525 /**
2626 * Constructor
2727 */
@@ -32,16 +32,16 @@
3333 global $wgRequest, $wgOut;
3434 $linker = smwfGetLinker();
3535 $this->setHeaders();
36 -
 36+
3737 // Get parameters
3838 $pagename = $wgRequest->getVal( 'from' );
3939 $propname = $wgRequest->getVal( 'type' );
4040 $limit = $wgRequest->getVal( 'limit' );
4141 $offset = $wgRequest->getVal( 'offset' );
42 -
 42+
4343 if ( $limit === '' ) $limit = 20;
4444 if ( $offset === '' ) $offset = 0;
45 -
 45+
4646 if ( $propname === '' ) { // No GET parameters? Try the URL:
4747 $queryparts = explode( '::', $query );
4848 $propname = $query;
@@ -78,9 +78,9 @@
7979 'a',
8080 array(
8181 'href' => $this->getTitle()->getLocalURL( array(
82 - 'offset' => max( 0, $offset - $limit ),
 82+ 'offset' => max( 0, $offset - $limit ),
8383 'limit' => $limit,
84 - 'type' => $propname,
 84+ 'type' => $propname,
8585 'from' => $pagename
8686 ) )
8787 ),
@@ -95,7 +95,7 @@
9696 wfMsg( 'smw_result_results' ) . ' ' .
9797 ( $offset + 1 ) . '– ' . ( $offset + min( count( $results ), $limit ) ) .
9898 '</b>&#160;&#160;&#160;&#160;';
99 -
 99+
100100 if ( count( $results ) == ( $limit + 1 ) ) {
101101 $navigation = Html::element(
102102 'a',
@@ -123,25 +123,25 @@
124124 } else {
125125 $html .= "<ul>\n";
126126 $count = $limit + 1;
127 -
 127+
128128 foreach ( $results as $di ) {
129129 $count--;
130130 if ( $count < 1 ) continue;
131 -
 131+
132132 $dv = SMWDataValueFactory::newDataItemValue( $di, $property->getDataItem() );
133133 $html .= '<li>' . $dv->getLongHTMLText( $linker ); // do not show infolinks, the magnifier "+" is ambiguous with the browsing '+' for '_wpg' (see below)
134 -
 134+
135135 if ( $property->getDataItem()->findPropertyTypeID() == '_wpg' ) {
136136 $browselink = SMWInfolink::newBrowsingLink( '+', $dv->getLongWikiText() );
137137 $html .= ' &#160;' . $browselink->getHTML( $linker );
138138 }
139 -
 139+
140140 $html .= "</li> \n";
141141 }
142 -
 142+
143143 $html .= "</ul>\n";
144144 }
145 -
 145+
146146 $html .= $navigation;
147147 }
148148
@@ -157,5 +157,5 @@
158158 $wgOut->addHTML( $html );
159159 SMWOutputs::commitToOutputPage( $wgOut ); // make sure locally collected output data is pushed to the output!
160160 }
161 -
 161+
162162 }
Index: trunk/extensions/SemanticMediaWiki/SMW_Settings.php
@@ -23,7 +23,7 @@
2424 # web. Change it if required ($wgScriptPath is the path to the base directory
2525 # of your wiki). No final slash.
2626 ##
27 -$smwgScriptPath = (
 27+$smwgScriptPath = (
2828 ( version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath )
2929 ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions'
3030 ) . '/SemanticMediaWiki';
Index: trunk/extensions/SemanticMediaWiki/SemanticMediaWiki.php
@@ -11,7 +11,7 @@
1212 * For documenting extensions of SMW, please do not use groups starting with
1313 * "SMW" but make your own groups instead. Browsing at
1414 * http://semantic-mediawiki.org/doc/ is assumed to be easier this way.
15 - *
 15+ *
1616 * @defgroup SMW Semantic MediaWiki
1717 */
1818