Index: trunk/extensions/SemanticResultFormats/SemanticResultFormats.php |
— | — | @@ -125,21 +125,24 @@ |
126 | 126 | 'tagcloud' => array( 'tag cloud' ) |
127 | 127 | ); |
128 | 128 | |
129 | | - foreach ( $srfgFormats as $format ) { |
130 | | - if ( array_key_exists( $format, $formatClasses ) ) { |
131 | | - $smwgResultFormats[$format] = $formatClasses[$format]; |
132 | | - |
133 | | - if ( method_exists( $formatClasses[$format], 'registerResourceModules' ) ) { |
134 | | - call_user_func( array( $formatClasses[$format], 'registerResourceModules' ) ); |
| 129 | + // Register the resource loader modules for when they are supported. |
| 130 | + if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) ) { |
| 131 | + foreach ( $srfgFormats as $format ) { |
| 132 | + if ( array_key_exists( $format, $formatClasses ) ) { |
| 133 | + $smwgResultFormats[$format] = $formatClasses[$format]; |
| 134 | + |
| 135 | + if ( method_exists( $formatClasses[$format], 'registerResourceModules' ) ) { |
| 136 | + call_user_func( array( $formatClasses[$format], 'registerResourceModules' ) ); |
| 137 | + } |
| 138 | + |
| 139 | + if ( isset( $smwgResultAliases ) && array_key_exists( $format, $formatAliases ) ) { |
| 140 | + $smwgResultAliases[$format] = $formatAliases[$format]; |
| 141 | + } |
135 | 142 | } |
136 | | - |
137 | | - if ( isset( $smwgResultAliases ) && array_key_exists( $format, $formatAliases ) ) { |
138 | | - $smwgResultAliases[$format] = $formatAliases[$format]; |
| 143 | + else { |
| 144 | + wfDebug( "There is not result format class associated with the format '$format'." ); |
139 | 145 | } |
140 | | - } |
141 | | - else { |
142 | | - wfDebug( "There is not result format class associated with the format '$format'." ); |
143 | | - } |
| 146 | + } |
144 | 147 | } |
145 | 148 | } |
146 | 149 | |
Index: trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php |
— | — | @@ -111,9 +111,9 @@ |
112 | 112 | */ |
113 | 113 | protected function includeJS() { |
114 | 114 | SMWOutputs::requireHeadItem( SMW_HEADER_STYLE ); |
115 | | - |
| 115 | + |
116 | 116 | // MediaWiki 1.17 introduces the Resource Loader. |
117 | | - if ( method_exists( 'OutputPage', 'addModules' ) && method_exists( 'SMWOutputs', 'requireResource' ) ) { |
| 117 | + if ( defined( 'MW_SUPPORTS_RESOURCE_MODULES' ) && method_exists( 'SMWOutputs', 'requireResource' ) ) { |
118 | 118 | SMWOutputs::requireResource( 'ext.srf.timeline' ); |
119 | 119 | } |
120 | 120 | else { |