Index: trunk/extensions/SemanticMediaWiki/SemanticMediaWiki.hooks.php |
— | — | @@ -31,70 +31,70 @@ |
32 | 32 | $updater->addPostDatabaseUpdateMaintenance( 'SMWSetupScript' ); |
33 | 33 | } |
34 | 34 | } |
35 | | - |
| 35 | + |
36 | 36 | return true; |
37 | 37 | } |
38 | | - |
| 38 | + |
39 | 39 | /** |
40 | 40 | * TODO |
41 | | - * |
| 41 | + * |
42 | 42 | * @since 1.7 |
43 | | - * |
| 43 | + * |
44 | 44 | * @return true |
45 | 45 | */ |
46 | 46 | public static function onPageSchemasRegistration() { |
47 | 47 | $GLOBALS['wgPageSchemasHandlerClasses'][] = 'SMWPageSchemas'; |
48 | 48 | return true; |
49 | 49 | } |
50 | | - |
| 50 | + |
51 | 51 | /** |
52 | 52 | * Adds links to Admin Links page. |
53 | | - * |
| 53 | + * |
54 | 54 | * @since 1.7 |
55 | | - * |
| 55 | + * |
56 | 56 | * @param ALTree $admin_links_tree |
57 | | - * |
| 57 | + * |
58 | 58 | * @return true |
59 | 59 | */ |
60 | 60 | public static function addToAdminLinks( ALTree &$admin_links_tree ) { |
61 | 61 | $data_structure_section = new ALSection( wfMsg( 'smw_adminlinks_datastructure' ) ); |
62 | | - |
| 62 | + |
63 | 63 | $smw_row = new ALRow( 'smw' ); |
64 | 64 | $smw_row->addItem( ALItem::newFromSpecialPage( 'Categories' ) ); |
65 | 65 | $smw_row->addItem( ALItem::newFromSpecialPage( 'Properties' ) ); |
66 | 66 | $smw_row->addItem( ALItem::newFromSpecialPage( 'UnusedProperties' ) ); |
67 | 67 | $smw_row->addItem( ALItem::newFromSpecialPage( 'SemanticStatistics' ) ); |
68 | | - |
| 68 | + |
69 | 69 | $data_structure_section->addRow( $smw_row ); |
70 | 70 | $smw_admin_row = new ALRow( 'smw_admin' ); |
71 | 71 | $smw_admin_row->addItem( ALItem::newFromSpecialPage( 'SMWAdmin' ) ); |
72 | | - |
| 72 | + |
73 | 73 | $data_structure_section->addRow( $smw_admin_row ); |
74 | 74 | $smw_docu_row = new ALRow( 'smw_docu' ); |
75 | 75 | $smw_name = wfMsg( 'specialpages-group-smw_group' ); |
76 | 76 | $smw_docu_label = wfMsg( 'adminlinks_documentation', $smw_name ); |
77 | 77 | $smw_docu_row->addItem( AlItem::newFromExternalLink( 'http://semantic-mediawiki.org/wiki/Help:User_manual', $smw_docu_label ) ); |
78 | | - |
| 78 | + |
79 | 79 | $data_structure_section->addRow( $smw_docu_row ); |
80 | 80 | $admin_links_tree->addSection( $data_structure_section, wfMsg( 'adminlinks_browsesearch' ) ); |
81 | 81 | $smw_row = new ALRow( 'smw' ); |
82 | 82 | $displaying_data_section = new ALSection( wfMsg( 'smw_adminlinks_displayingdata' ) ); |
83 | 83 | $smw_row->addItem( AlItem::newFromExternalLink( 'http://semantic-mediawiki.org/wiki/Help:Inline_queries', wfMsg( 'smw_adminlinks_inlinequerieshelp' ) ) ); |
84 | | - |
| 84 | + |
85 | 85 | $displaying_data_section->addRow( $smw_row ); |
86 | 86 | $admin_links_tree->addSection( $displaying_data_section, wfMsg( 'adminlinks_browsesearch' ) ); |
87 | 87 | $browse_search_section = $admin_links_tree->getSection( wfMsg( 'adminlinks_browsesearch' ) ); |
88 | | - |
| 88 | + |
89 | 89 | $smw_row = new ALRow( 'smw' ); |
90 | 90 | $smw_row->addItem( ALItem::newFromSpecialPage( 'Browse' ) ); |
91 | 91 | $smw_row->addItem( ALItem::newFromSpecialPage( 'Ask' ) ); |
92 | 92 | $smw_row->addItem( ALItem::newFromSpecialPage( 'SearchByProperty' ) ); |
93 | 93 | $browse_search_section->addRow( $smw_row ); |
94 | | - |
| 94 | + |
95 | 95 | return true; |
96 | 96 | } |
97 | | - |
98 | | - |
| 97 | + |
| 98 | + |
99 | 99 | /** |
100 | 100 | * Register special classes for displaying semantic content on Property and |
101 | 101 | * Concept pages. |
— | — | @@ -112,15 +112,15 @@ |
113 | 113 | } elseif ( $title->getNamespace() == SMW_NS_CONCEPT ) { |
114 | 114 | $article = new SMWConceptPage( $title ); |
115 | 115 | } |
116 | | - |
| 116 | + |
117 | 117 | return true; |
118 | 118 | } |
119 | | - |
| 119 | + |
120 | 120 | /** |
121 | 121 | * This hook registers parser functions and hooks to the given parser. It is |
122 | 122 | * called during SMW initialisation. Note that parser hooks are something different |
123 | 123 | * than MW hooks in general, which explains the two-level registration. |
124 | | - * |
| 124 | + * |
125 | 125 | * @since 1.7 |
126 | 126 | */ |
127 | 127 | public static function onParserFirstCallInit( Parser &$parser ) { |
— | — | @@ -131,10 +131,10 @@ |
132 | 132 | $parser->setFunctionHook( 'set', array( 'SMWSet', 'render' ) ); |
133 | 133 | $parser->setFunctionHook( 'set_recurring_event', array( 'SMWSetRecurringEvent', 'render' ) ); |
134 | 134 | $parser->setFunctionHook( 'declare', array( 'SMWDeclare', 'render' ), SFH_OBJECT_ARGS ); |
135 | | - |
| 135 | + |
136 | 136 | return true; // Always return true, in order not to stop MW's hook processing! |
137 | 137 | } |
138 | | - |
| 138 | + |
139 | 139 | /** |
140 | 140 | * Adds the 'Powered by Semantic MediaWiki' button right next to the default |
141 | 141 | * 'Powered by MediaWiki' button at the bottom of every page. This works |
— | — | @@ -149,9 +149,9 @@ |
150 | 150 | public static function addPoweredBySMW( &$text, $skin ) { |
151 | 151 | global $smwgScriptPath; |
152 | 152 | $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 | + |
155 | 155 | return true; // Always return true, in order not to stop MW's hook processing! |
156 | 156 | } |
157 | | - |
| 157 | + |
158 | 158 | } |
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php |
— | — | @@ -60,10 +60,10 @@ |
61 | 61 | // get the GET parameters |
62 | 62 | $this->propertystring = $wgRequest->getText( 'property' ); |
63 | 63 | $this->valuestring = $wgRequest->getText( 'value' ); |
64 | | - |
| 64 | + |
65 | 65 | $params = SMWInfolink::decodeParameters( $query, false ); |
66 | 66 | reset( $params ); |
67 | | - |
| 67 | + |
68 | 68 | // no GET parameters? Then try the URL |
69 | 69 | if ( $this->propertystring === '' ) $this->propertystring = current( $params ); |
70 | 70 | if ( $this->valuestring === '' ) $this->valuestring = next( $params ); |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | } else { |
79 | 79 | $this->propertystring = $this->property->getWikiValue(); |
80 | 80 | $this->value = SMWDataValueFactory::newPropertyObjectValue( $this->property->getDataItem(), $this->valuestring ); |
81 | | - |
| 81 | + |
82 | 82 | if ( $this->value->isValid() ) { |
83 | 83 | $this->valuestring = $this->value->getWikiValue(); |
84 | 84 | } else { |
— | — | @@ -89,7 +89,7 @@ |
90 | 90 | if ( is_numeric( $limitstring ) ) { |
91 | 91 | $this->limit = intval( $limitstring ); |
92 | 92 | } |
93 | | - |
| 93 | + |
94 | 94 | $offsetstring = $wgRequest->getVal( 'offset' ); |
95 | 95 | if ( is_numeric( $offsetstring ) ) { |
96 | 96 | $this->offset = intval( $offsetstring ); |
— | — | @@ -97,7 +97,7 @@ |
98 | 98 | |
99 | 99 | $wgOut->addHTML( $this->displaySearchByProperty() ); |
100 | 100 | $wgOut->addHTML( $this->queryForm() ); |
101 | | - |
| 101 | + |
102 | 102 | SMWOutputs::commitToOutputPage( $wgOut ); // make sure locally collected output data is pushed to the output! |
103 | 103 | } |
104 | 104 | |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | if ( $this->propertystring === '' ) { |
115 | 115 | return '<p>' . wfMsg( 'smw_sbv_docu' ) . "</p>\n"; |
116 | 116 | } |
117 | | - |
| 117 | + |
118 | 118 | if ( ( $this->value == null ) || !$this->value->isValid() ) { |
119 | 119 | return '<p>' . wfMsg( 'smw_sbv_novalue', $this->property->getShortHTMLText( $linker ) ) . "</p>\n"; |
120 | 120 | } |
— | — | @@ -123,19 +123,19 @@ |
124 | 124 | |
125 | 125 | $exact = $this->getExactResults(); |
126 | 126 | $count = count( $exact ); |
127 | | - |
| 127 | + |
128 | 128 | if ( ( $count < ( $this->limit / 3 ) ) && ( $this->value->isNumeric() ) && $smwgSearchByPropertyFuzzy ) { |
129 | 129 | $greater = $this->getNearbyResults( $count, true ); |
130 | 130 | $lesser = $this->getNearbyResults( $count, false ); |
131 | | - |
| 131 | + |
132 | 132 | // Calculate how many greater and lesser results should be displayed |
133 | 133 | $cG = count( $greater ); |
134 | 134 | $cL = count( $lesser ); |
135 | | - |
| 135 | + |
136 | 136 | if ( ( $cG + $cL + $count ) > $this->limit ) { |
137 | 137 | $l = $this->limit - $count; |
138 | 138 | $lhalf = round( $l / 2 ); |
139 | | - |
| 139 | + |
140 | 140 | if ( $lhalf < $cG ) { |
141 | 141 | if ( $lhalf < $cL ) { |
142 | 142 | $cL = $lhalf; $cG = $lhalf; |
— | — | @@ -146,24 +146,24 @@ |
147 | 147 | $cL = $this->limit - ( $count + $cG ); |
148 | 148 | } |
149 | 149 | } |
150 | | - |
| 150 | + |
151 | 151 | if ( ( $cG + $cL + $count ) == 0 ) |
152 | 152 | $html .= wfMsg( 'smw_result_noresults' ); |
153 | 153 | else { |
154 | 154 | $html .= wfMsg( 'smw_sbv_displayresultfuzzy', $this->property->getShortHTMLText( $linker ), $this->value->getShortHTMLText( $linker ) ) . "<br />\n"; |
155 | 155 | $html .= $this->displayResults( $lesser, $cL, false ); |
156 | | - |
| 156 | + |
157 | 157 | if ( $count == 0 ) { |
158 | 158 | $html .= "          <em><strong><small>(" . $this->value->getLongHTMLText() . ")</small></strong></em>\n"; |
159 | 159 | } else { |
160 | 160 | $html .= $this->displayResults( $exact, $count, true, true ); |
161 | 161 | } |
162 | | - |
| 162 | + |
163 | 163 | $html .= $this->displayResults( $greater, $cG ); |
164 | 164 | } |
165 | 165 | } else { |
166 | 166 | $html .= wfMsg( 'smw_sbv_displayresult', $this->property->getShortHTMLText( $linker ), $this->value->getShortHTMLText( $linker ) ) . "<br />\n"; |
167 | | - |
| 167 | + |
168 | 168 | if ( 0 == $count ) { |
169 | 169 | $html .= wfMsg( 'smw_result_noresults' ); |
170 | 170 | } else { |
— | — | @@ -175,7 +175,7 @@ |
176 | 176 | } |
177 | 177 | |
178 | 178 | $html .= '<p> </p>'; |
179 | | - |
| 179 | + |
180 | 180 | return $html; |
181 | 181 | } |
182 | 182 | |
— | — | @@ -186,7 +186,7 @@ |
187 | 187 | * @param[in] $number int How many results should be displayed? -1 for all |
188 | 188 | * @param[in] $first bool If less results should be displayed than given, should they show the first $number results, or the last $number results? |
189 | 189 | * @param[in] $highlight bool Should the results be highlighted? |
190 | | - * |
| 190 | + * |
191 | 191 | * @return string HTML with the bullet list and a header |
192 | 192 | */ |
193 | 193 | private function displayResults( $results, $number = - 1, $first = true, $highlight = false ) { |
— | — | @@ -197,30 +197,30 @@ |
198 | 198 | // I (jeroendedauw) replaced a loop using array_shift by this, which is equivalent. |
199 | 199 | $results = array_slice( array_reverse( $results ), 0, $number ); |
200 | 200 | } |
201 | | - |
| 201 | + |
202 | 202 | while ( $results && $number != 0 ) { |
203 | 203 | $result = array_shift( $results ); |
204 | | - |
| 204 | + |
205 | 205 | $html .= '<li>' . $result[0]->getLongHTMLText( smwfGetLinker() ); |
206 | | - |
| 206 | + |
207 | 207 | if ( $result[0]->getTypeID() == '_wpg' ) { |
208 | 208 | $html .= '  ' . SMWInfolink::newBrowsingLink( '+', $result[0]->getLongWikiText() )->getHTML( smwfGetLinker() ); |
209 | 209 | } |
210 | | - |
| 210 | + |
211 | 211 | if ( is_object( $result[1] ) && ( ( $this->value != $result[1] ) || $highlight ) ) { |
212 | 212 | $html .= " <em><small>(" . $result[1]->getLongHTMLText( smwfGetLinker() ) . ")</small></em>"; |
213 | 213 | } |
214 | | - |
| 214 | + |
215 | 215 | $html .= "</li>"; |
216 | | - |
| 216 | + |
217 | 217 | if ( $highlight ) { |
218 | 218 | $html = "<strong>" . $html . "</strong>"; |
219 | 219 | } |
220 | | - |
| 220 | + |
221 | 221 | $html .= "\n"; |
222 | 222 | $number--; |
223 | 223 | } |
224 | | - |
| 224 | + |
225 | 225 | $html .= "</ul>\n"; |
226 | 226 | |
227 | 227 | return $html; |
— | — | @@ -241,19 +241,19 @@ |
242 | 242 | 'a', |
243 | 243 | array( |
244 | 244 | 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array( |
245 | | - 'offset' => max( 0, $this->offset - $this->limit ), |
| 245 | + 'offset' => max( 0, $this->offset - $this->limit ), |
246 | 246 | 'limit' => $this->limit, |
247 | | - 'property' => $this->property->getWikiValue(), |
| 247 | + 'property' => $this->property->getWikiValue(), |
248 | 248 | 'value' => $this->value->getWikiValue() |
249 | 249 | ) ) |
250 | 250 | ), |
251 | 251 | wfMsg( 'smw_result_prev' ) |
252 | | - ); |
| 252 | + ); |
253 | 253 | } |
254 | 254 | else { |
255 | 255 | $navigation = wfMsg( 'smw_result_prev' ); |
256 | 256 | } |
257 | | - |
| 257 | + |
258 | 258 | $navigation .= |
259 | 259 | '     <b>' . |
260 | 260 | wfMsg( 'smw_result_results' ) . ' ' . |
— | — | @@ -266,44 +266,44 @@ |
267 | 267 | 'a', |
268 | 268 | array( |
269 | 269 | 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array( |
270 | | - 'offset' => $this->offset + $this->limit, |
| 270 | + 'offset' => $this->offset + $this->limit, |
271 | 271 | 'limit' => $this->limit, |
272 | | - 'property' => $this->property->getWikiValue(), |
| 272 | + 'property' => $this->property->getWikiValue(), |
273 | 273 | 'value' => $this->value->getWikiValue() |
274 | 274 | ) ) |
275 | 275 | ), |
276 | 276 | wfMsg( 'smw_result_next' ) |
277 | | - ); |
| 277 | + ); |
278 | 278 | } else { |
279 | 279 | $navigation .= wfMsg( 'smw_result_next' ); |
280 | 280 | } |
281 | 281 | |
282 | 282 | $max = false; |
283 | 283 | $first = true; |
284 | | - |
| 284 | + |
285 | 285 | foreach ( array( 20, 50, 100, 250, 500 ) as $l ) { |
286 | 286 | if ( $max ) continue; |
287 | | - |
| 287 | + |
288 | 288 | if ( $first ) { |
289 | 289 | $navigation .= '        ('; |
290 | 290 | $first = false; |
291 | 291 | } else { |
292 | 292 | $navigation .= ' ' . wfMsgExt( 'pipe-separator' , 'escapenoentities' ) . ' '; |
293 | 293 | } |
294 | | - |
| 294 | + |
295 | 295 | if ( $l > $smwgQMaxInlineLimit ) { |
296 | 296 | $l = $smwgQMaxInlineLimit; |
297 | 297 | $max = true; |
298 | 298 | } |
299 | | - |
| 299 | + |
300 | 300 | if ( $this->limit != $l ) { |
301 | 301 | $navigation .= Html::element( |
302 | 302 | 'a', |
303 | 303 | array( |
304 | 304 | 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array( |
305 | | - 'offset' => $this->offset, |
| 305 | + 'offset' => $this->offset, |
306 | 306 | 'limit' => $l, |
307 | | - 'property' => $this->property->getWikiValue(), |
| 307 | + 'property' => $this->property->getWikiValue(), |
308 | 308 | 'value' => $this->value->getWikiValue() |
309 | 309 | ) ) |
310 | 310 | ), |
— | — | @@ -313,9 +313,9 @@ |
314 | 314 | $navigation .= '<b>' . $l . '</b>'; |
315 | 315 | } |
316 | 316 | } |
317 | | - |
| 317 | + |
318 | 318 | $navigation .= ')'; |
319 | | - |
| 319 | + |
320 | 320 | return $navigation; |
321 | 321 | } |
322 | 322 | |
— | — | @@ -332,7 +332,7 @@ |
333 | 333 | |
334 | 334 | $res = smwfGetStore()->getPropertySubjects( $this->property->getDataItem(), $this->value->getDataItem(), $options ); |
335 | 335 | $results = array(); |
336 | | - |
| 336 | + |
337 | 337 | foreach ( $res as $result ) { |
338 | 338 | array_push( $results, array( |
339 | 339 | SMWDataValueFactory::newDataItemValue( $result, null ), |
— | — | @@ -349,7 +349,7 @@ |
350 | 350 | * |
351 | 351 | * @param[in] $count int How many entities have the exact same value on the property? |
352 | 352 | * @param[in] $greater bool Should the values be bigger? Set false for smaller values |
353 | | - * |
| 353 | + * |
354 | 354 | * @return array of array of SMWWikiPageValue, SMWDataValue with the first being the entity, and the second the value |
355 | 355 | */ |
356 | 356 | private function getNearbyResults( $count, $greater = true ) { |
— | — | @@ -368,7 +368,7 @@ |
369 | 369 | if ( $greater ) $params['order'] = 'ASC'; |
370 | 370 | $cmp = '<'; |
371 | 371 | if ( $greater ) $cmp = '>'; |
372 | | - |
| 372 | + |
373 | 373 | $querystring = '[[' . $this->propertystring . '::' . $cmp . $this->valuestring . ']]'; |
374 | 374 | $params = SMWQueryProcessor::getProcessedParams( $params, array( $printrequest ) ); |
375 | 375 | $queryobj = SMWQueryProcessor::createQuery( $querystring, $params, SMWQueryProcessor::SPECIAL_PAGE, 'ul', array( $printrequest ) ); |
— | — | @@ -380,16 +380,16 @@ |
381 | 381 | |
382 | 382 | $result = $results->getNext(); |
383 | 383 | $ret = array(); |
384 | | - |
| 384 | + |
385 | 385 | while ( $result ) { |
386 | 386 | $ret[] = array( $result[0]->getNextDataValue(), $result[1]->getNextDataValue() ); |
387 | 387 | $result = $results->getNext(); |
388 | 388 | } |
389 | | - |
| 389 | + |
390 | 390 | if ( !$greater ) { |
391 | 391 | $ret = array_reverse( $ret ); |
392 | 392 | } |
393 | | - |
| 393 | + |
394 | 394 | return $ret; |
395 | 395 | } |
396 | 396 | |
— | — | @@ -413,17 +413,17 @@ |
414 | 414 | /** |
415 | 415 | * Creates the JS needed for adding auto-completion to queryForm(). Uses the |
416 | 416 | * MW API to fetch suggestions. |
417 | | - * |
| 417 | + * |
418 | 418 | */ |
419 | 419 | protected static function addAutoComplete() { |
420 | 420 | SMWOutputs::requireResource( 'jquery.ui.autocomplete' ); |
421 | | - |
| 421 | + |
422 | 422 | $javascript_autocomplete_text = <<<END |
423 | 423 | <script type="text/javascript"> |
424 | 424 | jQuery(document).ready(function(){ |
425 | 425 | jQuery("#property_box").autocomplete({ |
426 | 426 | minLength: 2, |
427 | | - source: function(request, response) { |
| 427 | + source: function(request, response) { |
428 | 428 | jQuery.getJSON(wgScriptPath+'/api.php?action=opensearch&limit=10&namespace='+wgNamespaceIds['property']+'&format=jsonfm&search='+request.term, function(data){ |
429 | 429 | //remove the word 'Property:' from returned data |
430 | 430 | 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 @@ |
117 | 117 | * @param[in] $data SMWSemanticData The data to be displayed |
118 | 118 | * @param[in] $left bool Should properties be displayed on the left side? |
119 | 119 | * @param[in] $incoming bool Is this an incoming? Or an outgoing? |
120 | | - * |
| 120 | + * |
121 | 121 | * @return A string containing the HTML with the factbox |
122 | 122 | */ |
123 | 123 | private function displayData( SMWSemanticData $data, $left = true, $incoming = false ) { |
— | — | @@ -176,13 +176,13 @@ |
177 | 177 | 'a', |
178 | 178 | array( |
179 | 179 | 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array( |
180 | | - 'property' => $dvProperty->getWikiValue(), |
| 180 | + 'property' => $dvProperty->getWikiValue(), |
181 | 181 | 'value' => $this->subject->getWikiValue() |
182 | 182 | ) ) |
183 | 183 | ), |
184 | 184 | wfMsg( "smw_browse_more" ) |
185 | 185 | ); |
186 | | - |
| 186 | + |
187 | 187 | } |
188 | 188 | |
189 | 189 | $body .= "</td>\n"; |
— | — | @@ -207,14 +207,14 @@ |
208 | 208 | * @param[in] $property SMWPropertyValue The property this value is linked to the subject with |
209 | 209 | * @param[in] $value SMWDataValue The actual value |
210 | 210 | * @param[in] $incoming bool If this is an incoming or outgoing link |
211 | | - * |
| 211 | + * |
212 | 212 | * @return string HTML with the link to the article, browse, and search pages |
213 | 213 | */ |
214 | 214 | private function displayValue( SMWPropertyValue $property, SMWDataValue $dataValue, $incoming ) { |
215 | 215 | $linker = smwfGetLinker(); |
216 | | - |
| 216 | + |
217 | 217 | $html = $dataValue->getLongHTMLText( $linker ); |
218 | | - |
| 218 | + |
219 | 219 | if ( $dataValue->getTypeID() == '_wpg' ) { |
220 | 220 | $html .= " " . SMWInfolink::newBrowsingLink( '+', $dataValue->getLongWikiText() )->getHTML( $linker ); |
221 | 221 | } elseif ( $incoming && $property->isVisible() ) { |
— | — | @@ -222,7 +222,7 @@ |
223 | 223 | } else { |
224 | 224 | $html .= $dataValue->getInfolinkText( SMW_OUTPUT_HTML, $linker ); |
225 | 225 | } |
226 | | - |
| 226 | + |
227 | 227 | return $html; |
228 | 228 | } |
229 | 229 | |
— | — | @@ -290,13 +290,13 @@ |
291 | 291 | * @param[in] $out bool Should the linked to page include outgoing properties? |
292 | 292 | * @param[in] $in bool Should the linked to page include incoming properties? |
293 | 293 | * @param[in] $offset int What is the offset for the incoming properties? |
294 | | - * |
| 294 | + * |
295 | 295 | * @return string HTML with the link to this page |
296 | 296 | */ |
297 | 297 | private function linkHere( $text, $out, $in, $offset ) { |
298 | 298 | $dir = $out ? ( $in ? 'both' : 'out' ) : 'in'; |
299 | 299 | $frag = ( $text == wfMsg( 'smw_browse_show_incoming' ) ) ? '#smw_browse_incoming' : ''; |
300 | | - |
| 300 | + |
301 | 301 | return Html::element( |
302 | 302 | 'a', |
303 | 303 | array( |
— | — | @@ -334,7 +334,7 @@ |
335 | 335 | $valoptions = new SMWRequestOptions(); |
336 | 336 | $valoptions->sort = true; |
337 | 337 | $valoptions->limit = SMWSpecialBrowse::$incomingvaluescount; |
338 | | - |
| 338 | + |
339 | 339 | foreach ( $inproperties as $property ) { |
340 | 340 | $values = smwfGetStore()->getPropertySubjects( $property, $this->subject->getDataItem(), $valoptions ); |
341 | 341 | foreach ( $values as $value ) { |
— | — | @@ -352,12 +352,12 @@ |
353 | 353 | * |
354 | 354 | * @param[in] $property SMWPropertyValue The property of interest |
355 | 355 | * @param[in] $incoming bool If it is an incoming property |
356 | | - * |
| 356 | + * |
357 | 357 | * @return string The label of the property |
358 | 358 | */ |
359 | 359 | private function getPropertyLabel( SMWPropertyValue $property, $incoming = false ) { |
360 | 360 | global $smwgBrowseShowInverse; |
361 | | - |
| 361 | + |
362 | 362 | if ( $incoming && $smwgBrowseShowInverse ) { |
363 | 363 | $oppositeprop = SMWPropertyValue::makeUserProperty( wfMsg( 'smw_inverse_label_property' ) ); |
364 | 364 | $labelarray = &smwfGetStore()->getPropertyValues( $property->getDataItem()->getDiWikiPage(), $oppositeprop->getDataItem() ); |
— | — | @@ -366,7 +366,7 @@ |
367 | 367 | } else { |
368 | 368 | $rv = $property->getWikiValue(); |
369 | 369 | } |
370 | | - |
| 370 | + |
371 | 371 | return $this->unbreak( $rv ); |
372 | 372 | } |
373 | 373 | |
— | — | @@ -390,7 +390,7 @@ |
391 | 391 | * Creates the JS needed for adding auto-completion to queryForm(). Uses the |
392 | 392 | * MW API to fetch suggestions. |
393 | 393 | */ |
394 | | - private static function addAutoComplete(){ |
| 394 | + private static function addAutoComplete() { |
395 | 395 | SMWOutputs::requireResource( 'jquery.ui.autocomplete' ); |
396 | 396 | |
397 | 397 | $javascript_autocomplete_text = <<<END |
— | — | @@ -423,5 +423,5 @@ |
424 | 424 | $text = preg_replace( '/[\s]/u', $nonBreakingSpace, $text, - 1, $count ); |
425 | 425 | return $count > 2 ? preg_replace( '/($nonBreakingSpace)/u', ' ', $text, max( 0, $count - 2 ) ):$text; |
426 | 426 | } |
427 | | - |
| 427 | + |
428 | 428 | } |
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | * @ingroup SpecialPage |
22 | 22 | */ |
23 | 23 | class SMWPageProperty extends SpecialPage { |
24 | | - |
| 24 | + |
25 | 25 | /** |
26 | 26 | * Constructor |
27 | 27 | */ |
— | — | @@ -32,16 +32,16 @@ |
33 | 33 | global $wgRequest, $wgOut; |
34 | 34 | $linker = smwfGetLinker(); |
35 | 35 | $this->setHeaders(); |
36 | | - |
| 36 | + |
37 | 37 | // Get parameters |
38 | 38 | $pagename = $wgRequest->getVal( 'from' ); |
39 | 39 | $propname = $wgRequest->getVal( 'type' ); |
40 | 40 | $limit = $wgRequest->getVal( 'limit' ); |
41 | 41 | $offset = $wgRequest->getVal( 'offset' ); |
42 | | - |
| 42 | + |
43 | 43 | if ( $limit === '' ) $limit = 20; |
44 | 44 | if ( $offset === '' ) $offset = 0; |
45 | | - |
| 45 | + |
46 | 46 | if ( $propname === '' ) { // No GET parameters? Try the URL: |
47 | 47 | $queryparts = explode( '::', $query ); |
48 | 48 | $propname = $query; |
— | — | @@ -78,9 +78,9 @@ |
79 | 79 | 'a', |
80 | 80 | array( |
81 | 81 | 'href' => $this->getTitle()->getLocalURL( array( |
82 | | - 'offset' => max( 0, $offset - $limit ), |
| 82 | + 'offset' => max( 0, $offset - $limit ), |
83 | 83 | 'limit' => $limit, |
84 | | - 'type' => $propname, |
| 84 | + 'type' => $propname, |
85 | 85 | 'from' => $pagename |
86 | 86 | ) ) |
87 | 87 | ), |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | wfMsg( 'smw_result_results' ) . ' ' . |
97 | 97 | ( $offset + 1 ) . '– ' . ( $offset + min( count( $results ), $limit ) ) . |
98 | 98 | '</b>    '; |
99 | | - |
| 99 | + |
100 | 100 | if ( count( $results ) == ( $limit + 1 ) ) { |
101 | 101 | $navigation = Html::element( |
102 | 102 | 'a', |
— | — | @@ -123,25 +123,25 @@ |
124 | 124 | } else { |
125 | 125 | $html .= "<ul>\n"; |
126 | 126 | $count = $limit + 1; |
127 | | - |
| 127 | + |
128 | 128 | foreach ( $results as $di ) { |
129 | 129 | $count--; |
130 | 130 | if ( $count < 1 ) continue; |
131 | | - |
| 131 | + |
132 | 132 | $dv = SMWDataValueFactory::newDataItemValue( $di, $property->getDataItem() ); |
133 | 133 | $html .= '<li>' . $dv->getLongHTMLText( $linker ); // do not show infolinks, the magnifier "+" is ambiguous with the browsing '+' for '_wpg' (see below) |
134 | | - |
| 134 | + |
135 | 135 | if ( $property->getDataItem()->findPropertyTypeID() == '_wpg' ) { |
136 | 136 | $browselink = SMWInfolink::newBrowsingLink( '+', $dv->getLongWikiText() ); |
137 | 137 | $html .= '  ' . $browselink->getHTML( $linker ); |
138 | 138 | } |
139 | | - |
| 139 | + |
140 | 140 | $html .= "</li> \n"; |
141 | 141 | } |
142 | | - |
| 142 | + |
143 | 143 | $html .= "</ul>\n"; |
144 | 144 | } |
145 | | - |
| 145 | + |
146 | 146 | $html .= $navigation; |
147 | 147 | } |
148 | 148 | |
— | — | @@ -157,5 +157,5 @@ |
158 | 158 | $wgOut->addHTML( $html ); |
159 | 159 | SMWOutputs::commitToOutputPage( $wgOut ); // make sure locally collected output data is pushed to the output! |
160 | 160 | } |
161 | | - |
| 161 | + |
162 | 162 | } |
Index: trunk/extensions/SemanticMediaWiki/SMW_Settings.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | # web. Change it if required ($wgScriptPath is the path to the base directory |
25 | 25 | # of your wiki). No final slash. |
26 | 26 | ## |
27 | | -$smwgScriptPath = ( |
| 27 | +$smwgScriptPath = ( |
28 | 28 | ( version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath ) |
29 | 29 | ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' |
30 | 30 | ) . '/SemanticMediaWiki'; |
Index: trunk/extensions/SemanticMediaWiki/SemanticMediaWiki.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * For documenting extensions of SMW, please do not use groups starting with |
13 | 13 | * "SMW" but make your own groups instead. Browsing at |
14 | 14 | * http://semantic-mediawiki.org/doc/ is assumed to be easier this way. |
15 | | - * |
| 15 | + * |
16 | 16 | * @defgroup SMW Semantic MediaWiki |
17 | 17 | */ |
18 | 18 | |