Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DV_Record.php |
— | — | @@ -25,8 +25,8 @@ |
26 | 26 | } |
27 | 27 | |
28 | 28 | protected function parseUserValueOrQuery( $value, $querymode ) { |
29 | | - if ( $value == '' ) { // / TODO internalionalize |
30 | | - $this->addError( 'No values specified.' ); |
| 29 | + if ( $value == '' ) { |
| 30 | + $this->addError( wfMsg( 'smw_novalues' ) ); |
31 | 31 | return $querymode ? new SMWThingDescription():$this->m_data; |
32 | 32 | } |
33 | 33 | |
— | — | @@ -64,8 +64,8 @@ |
65 | 65 | } |
66 | 66 | } |
67 | 67 | } |
68 | | - if ( $empty ) { // / TODO internalionalize |
69 | | - $this->addError( 'No values specified.' ); |
| 68 | + if ( $empty ) { |
| 69 | + $this->addError( wfMsg( 'smw_novalues' ) ); |
70 | 70 | } |
71 | 71 | if ( $querymode ) { |
72 | 72 | return $empty ? new SMWThingDescription():new SMWRecordDescription( $subdescriptions ); |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_TestStore.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | return array( SMWDataValueFactory::newTypeIDValue( '__typ', 'Float' ) ); |
42 | 42 | } elseif ( mb_substr_count( $name, 'DATE' ) > 0 ) { |
43 | 43 | return array( SMWDataValueFactory::newTypeIDValue( '__typ', 'Date' ) ); |
44 | | - } elseif ( mb_substr_count( $name, 'COORD' ) > 0 ) { |
| 44 | + } elseif ( mb_substr_count( $name, 'COORD' ) > 0 ) { // TODO: Move this to Semantic Maps? |
45 | 45 | return array( SMWDataValueFactory::newTypeIDValue( '__typ', 'Geographic coordinate' ) ); |
46 | 46 | } elseif ( mb_substr_count( $name, 'ENUM' ) > 0 ) { |
47 | 47 | return array( SMWDataValueFactory::newTypeIDValue( '__typ', 'Enumeration' ) ); |
Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php |
— | — | @@ -106,8 +106,6 @@ |
107 | 107 | |
108 | 108 | $wgHooks['ParserTestTables'][] = 'smwfOnParserTestTables'; |
109 | 109 | $wgHooks['AdminLinks'][] = 'smwfAddToAdminLinks'; |
110 | | - // this will move to Semantic Maps in future releases: |
111 | | - $wgHooks['smwGetSQLConditionForValue'][] = 'smwfGetGeoProximitySQLCondition'; |
112 | 110 | |
113 | 111 | // Register special pages aliases file |
114 | 112 | $wgExtensionAliasesFiles['SemanticMediaWiki'] = $smwgIP . '/languages/SMW_Aliases.php'; |
— | — | @@ -331,28 +329,6 @@ |
332 | 330 | return true; |
333 | 331 | } |
334 | 332 | |
335 | | -/** |
336 | | - * Custom SQL query extension for matching geographic coordinates. |
337 | | - * This hook will be moved to Semantic Maps in the next release. |
338 | | - * @todo Parsing latitude and longitude from the DB key of the coordinates |
339 | | - * value is cleary not a good approach. Instead, the geographic coordinate |
340 | | - * value object should provide functions to access this data directly. |
341 | | - */ |
342 | | -function smwfGetGeoProximitySQLCondition( &$where, $description, $tablename, $fieldname, $dbs ) { |
343 | | - $where = ''; |
344 | | - $dv = $description->getDatavalue(); |
345 | | - if ( ( $dv->getTypeID() != '_geo' ) || ( !$dv->isValid() ) || ( $description->getComparator() != SMW_CMP_LIKE ) ) return true; // only act on certain query conditions |
346 | | - $keys = $dv->getDBkeys(); |
347 | | - $geoarray = explode( ",", $keys[0] ); |
348 | | - if ( ( count( $geoarray ) != 2 ) || ( $geoarray[0] == '' ) || ( $geoarray[1] == '' ) ) return true; // something went wrong |
349 | | - $latitude = $dbs->addQuotes( $geoarray[0] ); |
350 | | - $longitude = $dbs->addQuotes( $geoarray[1] ); |
351 | | - // compute distances in miles: |
352 | | - $distance = "ROUND(((ACOS( SIN({$latitude} * PI()/180 ) * SIN(SUBSTRING_INDEX({$tablename}.{$fieldname}, ',',1) * PI()/180 ) + COS({$latitude} * PI()/180 ) * COS(SUBSTRING_INDEX({$tablename}.{$fieldname}, ',',1) * PI()/180 ) * COS(({$longitude} - SUBSTRING_INDEX({$tablename}.{$fieldname}, ',',-1)) * PI()/180))*180/PI())*60*1.1515),6)"; |
353 | | - $where = "{$distance} <= " . $dbs->addQuotes( "5" ); |
354 | | - return true; |
355 | | -} |
356 | | - |
357 | 333 | /**********************************************/ |
358 | 334 | /***** namespace settings *****/ |
359 | 335 | /**********************************************/ |
Index: trunk/extensions/SemanticMediaWiki/languages/SMW_Messages.php |
— | — | @@ -105,6 +105,7 @@ |
106 | 106 | 'smw_nofloat' => '"$1" is not a number.', |
107 | 107 | 'smw_infinite' => 'Numbers as large as "$1" are not supported.', |
108 | 108 | 'smw_infinite_unit' => 'Conversion into unit "$1" resulted in a number that is too large.', |
| 109 | + 'smw_novalues' => 'No values specified.', |
109 | 110 | |
110 | 111 | // Currently unused, floats silently store units. 'smw_unexpectedunit' => 'this property supports no unit conversion', |
111 | 112 | 'smw_unsupportedprefix' => 'Prefixes for numbers ("$1") are not supported.', |