r82562 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82561‎ | r82562 | r82563 >
Date:17:59, 21 February 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
RL support check tweak
Modified paths:
  • /trunk/extensions/SemanticResultFormats/SemanticResultFormats.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/SemanticResultFormats.php
@@ -125,21 +125,24 @@
126126 'tagcloud' => array( 'tag cloud' )
127127 );
128128
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+ }
135142 }
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'." );
139145 }
140 - }
141 - else {
142 - wfDebug( "There is not result format class associated with the format '$format'." );
143 - }
 146+ }
144147 }
145148 }
146149
Index: trunk/extensions/SemanticResultFormats/Timeline/SRF_Timeline.php
@@ -111,9 +111,9 @@
112112 */
113113 protected function includeJS() {
114114 SMWOutputs::requireHeadItem( SMW_HEADER_STYLE );
115 -
 115+
116116 // 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' ) ) {
118118 SMWOutputs::requireResource( 'ext.srf.timeline' );
119119 }
120120 else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r83027follow up to r82562jeroendedauw18:31, 1 March 2011

Status & tagging log