http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83576
Revision: 83576 Author: jeroendedauw Date: 2011-03-09 09:32:46 +0000 (Wed, 09 Mar 2011) Log Message: ----------- follow up to r83575 Modified Paths: -------------- branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php branches/SemanticMaps0.8/includes/services/YahooMaps/SM_YahooMaps.php Modified: branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php =================================================================== --- branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php 2011-03-09 09:13:23 UTC (rev 83575) +++ branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php 2011-03-09 09:32:46 UTC (rev 83576) @@ -311,8 +311,6 @@ * @return array */ public function getParameters() { - global $egMapsMapWidth, $egMapsMapHeight; - $params = parent::getParameters(); // Now go through the descriptions, and convert them from Validator- to SMW-style. Modified: branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php =================================================================== --- branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php 2011-03-09 09:13:23 UTC (rev 83575) +++ branches/SemanticMaps0.8/includes/queryprinters/SM_Mapper.php 2011-03-09 09:32:46 UTC (rev 83576) @@ -44,37 +44,29 @@ $QPClass = $service->getFeature( 'qp' ); $this->queryPrinter = new $QPClass( $format, $inline, $service ); } - - public static function getAliases() { - return $this->queryPrinter->getAliases(); - } - public static function setAliases() { - return $this->queryPrinter->setAliases(); - } - + /** + * Intercept calls to getName, so special behaviour for the map format can be implemented. + * + * @since 0.8 + * + * @return string + */ public function getName() { return $this->isMapFormat ? wfMsg( 'maps_map' ) : $this->queryPrinter->getName(); } - public function getQueryMode( $context ) { - return $this->queryPrinter->getQueryMode( $context ); + /** + * SMW thinks this class is a SMWResultPrinter, and calls methods that should + * be forewarded to $this->queryPrinter on it. + * + * @since 0.8 + * + * @param string $name + * @param array $arguments + */ + public function __call( $name, array $arguments ) { + return call_user_func_array( array( $this->queryPrinter, $name ), $arguments ); } - public function getResult( $results, $params, $outputmode ) { - return $this->queryPrinter->getResult( $results, $params, $outputmode ); - } - - protected function getResultText( $res, $outputmode ) { - return $this->queryPrinter->getResultText( $res, $outputmode ); - } - - public function getParameters() { - return $this->queryPrinter->getParameters(); - } - - public function getMimeType( $res ) { - return $this->queryPrinter->getMimeType( $res ); - } - -} \ No newline at end of file +} Modified: branches/SemanticMaps0.8/includes/services/YahooMaps/SM_YahooMaps.php =================================================================== --- branches/SemanticMaps0.8/includes/services/YahooMaps/SM_YahooMaps.php 2011-03-09 09:13:23 UTC (rev 83575) +++ branches/SemanticMaps0.8/includes/services/YahooMaps/SM_YahooMaps.php 2011-03-09 09:32:46 UTC (rev 83576) @@ -30,7 +30,7 @@ // TODO: the if should not be needed, but when omitted, a fatal error occurs cause the class that's extended by this one is not found. if ( defined( 'SF_VERSION' ) ) $wgAutoloadClasses['SMYahooMapsFormInput'] = dirname( __FILE__ ) . '/SM_YahooMapsFormInput.php'; - MapsMappingServices::registerServiceFeature( 'yahoomaps', 'qp', 'SMYahooMapsQP' ); + MapsMappingServices::registerServiceFeature( 'yahoomaps', 'qp', 'SMMapPrinter' ); MapsMappingServices::registerServiceFeature( 'yahoomaps', 'fi', 'SMYahooMapsFormInput' ); return true; _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs