Index: trunk/extensions/SemanticMaps/RELEASE-NOTES |
— | — | @@ -7,6 +7,11 @@ |
8 | 8 | http://www.mediawiki.org/wiki/Extension:Semantic_Maps/Version_history#Semantic_Maps_change_log |
9 | 9 | |
10 | 10 | |
| 11 | +=== Semantic Maps 0.7.6 === |
| 12 | +(2011-0x-xx) |
| 13 | + |
| 14 | +* Improved map query parameter support in the Special:Ask GUI |
| 15 | + |
11 | 16 | === Semantic Maps 0.7.5 === |
12 | 17 | (2011-02-16) |
13 | 18 | |
Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php |
— | — | @@ -500,13 +500,53 @@ |
501 | 501 | public function getParameters() { |
502 | 502 | global $egMapsMapWidth, $egMapsMapHeight; |
503 | 503 | |
504 | | - $params = parent::exportFormatParameters(); |
| 504 | + $params = parent::getParameters(); |
505 | 505 | |
506 | | - $params[] = array( 'name' => 'zoom', 'type' => 'int', 'description' => wfMsg( 'semanticmaps_paramdesc_zoom' ) ); |
507 | | - $params[] = array( 'name' => 'width', 'type' => 'int', 'description' => wfMsgExt( 'semanticmaps_paramdesc_width', 'parsemag', $egMapsMapWidth ) ); |
508 | | - $params[] = array( 'name' => 'height', 'type' => 'int', 'description' => wfMsgExt( 'semanticmaps_paramdesc_height', 'parsemag', $egMapsMapHeight ) ); |
| 506 | + $paramDescs = SMQueryPrinters::getParameterInfo(); |
| 507 | + $this->service->addParameterInfo( $paramDescs ); |
509 | 508 | |
| 509 | + foreach ( $paramDescs as $paramDesc ) { |
| 510 | + $param = array( |
| 511 | + 'name' => $paramDesc->getName(), |
| 512 | + 'type' => $this->getMappedParamType( $paramDesc->getType() ), |
| 513 | + 'description' => $paramDesc->getDescription() ? $paramDesc->getDescription() : '', |
| 514 | + 'default' => $paramDesc->isRequired() ? '' : $paramDesc->getDefault() |
| 515 | + ); |
| 516 | + |
| 517 | + foreach ( $paramDesc->getCriteria() as $criterion ) { |
| 518 | + if ( $criterion instanceof CriterionInArray ) { |
| 519 | + $param['values'] = $criterion->getAllowedValues(); |
| 520 | + $param['type'] = $paramDesc->isList() ? 'enum-list' : 'enumeration'; |
| 521 | + break; |
| 522 | + } |
| 523 | + } |
| 524 | + |
| 525 | + $params[] = $param; |
| 526 | + } |
| 527 | + |
510 | 528 | return $params; |
511 | 529 | } |
| 530 | + |
| 531 | + /** |
| 532 | + * Takes in an element of the Parameter::TYPE_ enum and turns it into an SMW type (string) indicator. |
| 533 | + * |
| 534 | + * @since 0.7.6 |
| 535 | + * |
| 536 | + * @param Parameter::TYPE_ $type |
| 537 | + * |
| 538 | + * @return string |
| 539 | + */ |
| 540 | + protected function getMappedParamType( $type ) { |
| 541 | + static $typeMap = array( |
| 542 | + Parameter::TYPE_STRING => 'string', |
| 543 | + Parameter::TYPE_BOOLEAN => 'boolean', |
| 544 | + Parameter::TYPE_CHAR => 'int', |
| 545 | + Parameter::TYPE_FLOAT => 'int', |
| 546 | + Parameter::TYPE_INTEGER => 'int', |
| 547 | + Parameter::TYPE_NUMBER => 'int', |
| 548 | + ); |
| 549 | + |
| 550 | + return $typeMap[$type]; |
| 551 | + } |
512 | 552 | |
513 | 553 | } |
\ No newline at end of file |
Index: trunk/extensions/SemanticMaps/SemanticMaps.php |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | |
40 | 40 | // Only initialize the extension when all dependencies are present. |
41 | 41 | if ( defined( 'Maps_VERSION' ) && defined( 'SMW_VERSION' ) ) { |
42 | | - define( 'SM_VERSION', '0.7.5.1' ); |
| 42 | + define( 'SM_VERSION', '0.7.6 alpha' ); |
43 | 43 | |
44 | 44 | $useExtensionPath = version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath; |
45 | 45 | $smgScriptPath = ( $useExtensionPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/SemanticMaps'; |