http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88338

Revision: 88338
Author:   jeroendedauw
Date:     2011-05-17 18:36:17 +0000 (Tue, 17 May 2011)
Log Message:
-----------
swicthed up contents of getLongText and getShortText methods, as it should have 
been

Modified Paths:
--------------
    trunk/extensions/SemanticMaps/includes/SM_GeoCoordsValue.php

Modified: trunk/extensions/SemanticMaps/includes/SM_GeoCoordsValue.php
===================================================================
--- trunk/extensions/SemanticMaps/includes/SM_GeoCoordsValue.php        
2011-05-17 18:19:05 UTC (rev 88337)
+++ trunk/extensions/SemanticMaps/includes/SM_GeoCoordsValue.php        
2011-05-17 18:36:17 UTC (rev 88338)
@@ -133,20 +133,12 @@
         * @since 0.6
         */
        public function getShortWikiText( $linked = null ) {
-               
-               if ( $this->isValid() && ( $linked !== null ) && ( $linked !== 
false ) ) {
-                       SMWOutputs::requireHeadItem( SMW_HEADER_TOOLTIP );
-
-                       // TODO: fix lang keys so they include the space and 
coordinates.
-                       $coordinateSet = $this->m_dataitem->getCoordinateSet();
-
-                       return '<span class="smwttinline">' . htmlspecialchars( 
$this->m_caption ) . '<span class="smwttcontent">' .
-                       htmlspecialchars ( wfMsgForContent( 'maps-latitude' ) . 
' ' . $coordinateSet['lat'] ) . '<br />' .
-                       htmlspecialchars ( wfMsgForContent( 'maps-longitude' ) 
. ' ' . $coordinateSet['lon'] ) .
-                       '</span></span>';
+               if ( !$this->isValid() ) {
+                       return $this->getErrorText();
                } else {
-                       return htmlspecialchars( $this->m_caption );
-               }
+                       global $smgQPCoodFormat, $smgQPCoodDirectional;
+                       return MapsCoordinateParser::formatCoordinates( 
$this->m_dataitem->getCoordinateSet(), $smgQPCoodFormat, $smgQPCoodDirectional 
);
+               }       
        }
        
        /**
@@ -164,12 +156,19 @@
         * @since 0.6
         */
        public function getLongWikiText( $linked = null ) {
-               if ( !$this->isValid() ) {
-                       return $this->getErrorText();
+               if ( $this->isValid() ) {
+                       SMWOutputs::requireHeadItem( SMW_HEADER_TOOLTIP );
+
+                       // TODO: fix lang keys so they include the space and 
coordinates.
+                       $coordinateSet = $this->m_dataitem->getCoordinateSet();
+
+                       return '<span class="smwttinline">' . htmlspecialchars( 
$this->m_caption ) . '<span class="smwttcontent">' .
+                       htmlspecialchars ( wfMsgForContent( 'maps-latitude' ) . 
' ' . $coordinateSet['lat'] ) . '<br />' .
+                       htmlspecialchars ( wfMsgForContent( 'maps-longitude' ) 
. ' ' . $coordinateSet['lon'] ) .
+                       '</span></span>';
                } else {
-                       global $smgQPCoodFormat, $smgQPCoodDirectional;
-                       return MapsCoordinateParser::formatCoordinates( 
$this->m_dataitem->getCoordinateSet(), $smgQPCoodFormat, $smgQPCoodDirectional 
);
-               }
+                       return htmlspecialchars( $this->m_caption );
+               }               
        }
 
        /**


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to