r86663 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86662‎ | r86663 | r86664 >
Date:20:31, 21 April 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
some fixes to GeoCoordValue class
Modified paths:
  • /trunk/extensions/SemanticMaps/includes/SM_GeoCoordsValue.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/includes/SM_GeoCoordsValue.php
@@ -29,6 +29,15 @@
3030 public function setDataItem( SMWDataItem $dataItem ) {
3131 if ( $dataItem->getDIType() == SMWDataItem::TYPE_GEO ) {
3232 $this->m_dataitem = $dataItem;
 33+
 34+ global $smgQPCoodFormat, $smgQPCoodDirectional;
 35+ $this->m_caption = MapsCoordinateParser::formatCoordinates(
 36+ $dataItem->getCoordinateSet(),
 37+ $smgQPCoodFormat,
 38+ $smgQPCoodDirectional
 39+ );
 40+
 41+ $this->wikiValue = $this->m_caption;
3342 return true;
3443 } else {
3544 return false;
@@ -127,9 +136,7 @@
128137 * @since 0.6
129138 */
130139 protected function parseDBkeys( $args ) {
131 - $this->setDataItem( new SMWDIGeoCoord( array( (float)$args[0], (float)$args[1] ), $this->m_typeid ) );
132 - $this->m_caption = $this->m_dataitem->getSerialization();
133 - $this->wikiValue = $this->m_caption;
 140+ $this->setDataItem( new SMWDIGeoCoord( array( 'lat' => (float)$args[0], 'lon' => (float)$args[1] ), $this->m_typeid ) );
134141 }
135142
136143 /**
@@ -162,6 +169,7 @@
163170 * @since 0.6
164171 */
165172 public function getShortWikiText( $linked = null ) {
 173+
166174 if ( $this->isValid() && ( $linked !== null ) && ( $linked !== false ) ) {
167175 SMWOutputs::requireHeadItem( SMW_HEADER_TOOLTIP );
168176

Status & tagging log