Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QP_Auto.php |
— | — | @@ -29,46 +29,17 @@ |
30 | 30 | * @return string |
31 | 31 | */ |
32 | 32 | public function getResult( /* SMWQueryResult */ $results, $params, $outputmode ) { |
33 | | - global $smwgUseResultDefaults, $smwgResultDefaults, $smwgAddedResultDefaults; |
34 | | - |
35 | | - if ( !$smwgAddedResultDefaults ) { |
36 | | - $smwgAddedResultDefaults = true; |
37 | | - |
38 | | - /** |
39 | | - * This hook allows extensions to specify default result formats for |
40 | | - * datavalues. For example, Semantic Maps can specify the result format |
41 | | - * for geographical coordinates is the map one. |
42 | | - * |
43 | | - * @since 1.5.2 |
44 | | - */ |
45 | | - wfRunHooks( 'SMWResultDefaults', array( &$smwgResultDefaults ) ); |
46 | | - } |
47 | | - |
48 | 33 | $format = false; |
49 | 34 | |
50 | 35 | /** |
51 | 36 | * This hook allows extensions to override SMWs implementation of default result |
52 | | - * format handling. Extensions might choose do so even when $smwgUseResultDefaults is false. |
| 37 | + * format handling. |
53 | 38 | * |
54 | 39 | * @since 1.5.2 |
55 | 40 | */ |
56 | 41 | wfRunHooks( 'SMWResultFormat', array( &$format, $results->getPrintRequests(), $params ) ); |
57 | 42 | |
58 | | - // If $smwgUseResultDefaults is true, and there are no multiple columns, see if there is a default format. |
59 | | - if ( $smwgUseResultDefaults && $format === false && $results->getColumnCount() <= 2 ) { |
60 | | - $printReqs = $results->getPrintRequests(); |
61 | | - $typeId = array_shift( $printReqs )->getTypeID(); |
62 | | - |
63 | | - if ( $typeId == '_wpg' ) { |
64 | | - $typeId = array_shift( $printReqs )->getTypeID(); |
65 | | - } |
66 | | - |
67 | | - if ( $typeId !== false && array_key_exists( $typeId, $smwgResultDefaults ) ) { |
68 | | - $format = $smwgResultDefaults[$typeId]; |
69 | | - } |
70 | | - } |
71 | | - |
72 | | - // If no default was found, use a table or list, depending on the column count. |
| 43 | + // If no default was set by an extension, use a table or list, depending on the column count. |
73 | 44 | if ( $format === false ) { |
74 | 45 | $format = $results->getColumnCount() > 1 ? 'table' : 'list'; |
75 | 46 | } |
Index: trunk/extensions/SemanticMediaWiki/SMW_Settings.php |
— | — | @@ -299,18 +299,6 @@ |
300 | 300 | $smwgResultAliases = array(); |
301 | 301 | ## |
302 | 302 | |
303 | | -### Predefined default result formats |
304 | | -# Array of default result formats, optionlly defined per datatype. Can be redefined in |
305 | | -# the settings to remove or add certain defaults. |
306 | | -## |
307 | | -$smwgResultDefaults = array(); |
308 | | -## |
309 | | - |
310 | | -### Indicates if result format defaulting should be applied by SMW core. |
311 | | -## |
312 | | -$smwgUseResultDefaults = false; |
313 | | -## |
314 | | - |
315 | 303 | ### Predefined sources for queries |
316 | 304 | # Array of available sources for answering queries. Can be redefined in |
317 | 305 | # the settings to register new sources (usually an extension will do so |