r83369 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83368‎ | r83369 | r83370 >
Date:04:52, 6 March 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
matching changes in r83368
Modified paths:
  • /trunk/extensions/SemanticMaps/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/SemanticMaps/SemanticMaps.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/RELEASE-NOTES
@@ -7,6 +7,11 @@
88 http://www.mediawiki.org/wiki/Extension:Semantic_Maps/Version_history#Semantic_Maps_change_log
99
1010
 11+=== Semantic Maps 0.7.6 ===
 12+(2011-0x-xx)
 13+
 14+* Improved map query parameter support in the Special:Ask GUI
 15+
1116 === Semantic Maps 0.7.5 ===
1217 (2011-02-16)
1318
Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php
@@ -500,13 +500,53 @@
501501 public function getParameters() {
502502 global $egMapsMapWidth, $egMapsMapHeight;
503503
504 - $params = parent::exportFormatParameters();
 504+ $params = parent::getParameters();
505505
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 );
509508
 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+
510528 return $params;
511529 }
 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+ }
512552
513553 }
\ No newline at end of file
Index: trunk/extensions/SemanticMaps/SemanticMaps.php
@@ -38,7 +38,7 @@
3939
4040 // Only initialize the extension when all dependencies are present.
4141 if ( defined( 'Maps_VERSION' ) && defined( 'SMW_VERSION' ) ) {
42 - define( 'SM_VERSION', '0.7.5.1' );
 42+ define( 'SM_VERSION', '0.7.6 alpha' );
4343
4444 $useExtensionPath = version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath;
4545 $smgScriptPath = ( $useExtensionPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/SemanticMaps';

Follow-up revisions

RevisionCommit summaryAuthorDate
r83432follow up to r83369jeroendedauw02:36, 7 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83368param meta data convert from validator style to smw stylejeroendedauw04:50, 6 March 2011

Status & tagging log