r81788 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81787‎ | r81788 | r81789 >
Date:22:35, 8 February 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added tag cloud alias
Modified paths:
  • /trunk/extensions/SemanticResultFormats/SemanticResultFormats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/SemanticResultFormats.php
@@ -75,7 +75,7 @@
7676 * @since 1.5.2
7777 */
7878 function srffInitFormats() {
79 - global $srfgFormats, $smwgResultFormats, $wgAutoloadClasses;
 79+ global $srfgFormats, $smwgResultFormats, $smwgResultAliases, $wgAutoloadClasses;
8080
8181 $formatDir = dirname( __FILE__ ) . '/';
8282
@@ -121,6 +121,10 @@
122122 'tagcloud' => 'SRFTagCloud',
123123 );
124124
 125+ $formatAliases = array(
 126+ 'tagcloud' => array( 'tag cloud' )
 127+ );
 128+
125129 foreach ( $srfgFormats as $format ) {
126130 if ( array_key_exists( $format, $formatClasses ) ) {
127131 $smwgResultFormats[$format] = $formatClasses[$format];
@@ -128,6 +132,10 @@
129133 if ( method_exists( $formatClasses[$format], 'registerResourceModules' ) ) {
130134 call_user_func( array( $formatClasses[$format], 'registerResourceModules' ) );
131135 }
 136+
 137+ if ( isset( $smwgResultAliases ) && array_key_exists( $format, $formatAliases ) ) {
 138+ $smwgResultAliases[$format] = $formatAliases[$format];
 139+ }
132140 }
133141 else {
134142 wfDebug( "There is not result format class associated with the format '$format'." );

Status & tagging log