r96335 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96334‎ | r96335 | r96336 >
Date:14:24, 6 September 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
bacport fix
Modified paths:
  • /branches/SemanticMaps0.7.x/RELEASE-NOTES (modified) (history)
  • /branches/SemanticMaps0.7.x/includes/SM_GeoCoordsValue.php (modified) (history)

Diff [purge]

Index: branches/SemanticMaps0.7.x/RELEASE-NOTES
@@ -10,6 +10,7 @@
1111 === Semantic Maps 0.7.8 ===
1212
1313 * Fixed PostGres support for distance queries.
 14+* Switched around getShort and getLong Wiki/HTML text methods in the geocoords DV.
1415
1516 === Semantic Maps 0.7.7 ===
1617 (2011-06-15)
Index: branches/SemanticMaps0.7.x/includes/SM_GeoCoordsValue.php
@@ -277,18 +277,12 @@
278278 * @since 0.6
279279 */
280280 public function getShortWikiText( $linked = null ) {
281 - if ( $this->isValid() && ( $linked !== null ) && ( $linked !== false ) ) {
282 - SMWOutputs::requireHeadItem( SMW_HEADER_TOOLTIP );
283 -
284 - // TODO: fix lang keys so they include the space and coordinates.
285 -
286 - return '<span class="smwttinline">' . htmlspecialchars( $this->m_caption ) . '<span class="smwttcontent">' .
287 - htmlspecialchars ( wfMsgForContent( 'maps-latitude' ) . ' ' . $this->coordinateSet['lat'] ) . '<br />' .
288 - htmlspecialchars ( wfMsgForContent( 'maps-longitude' ) . ' ' . $this->coordinateSet['lon'] ) .
289 - '</span></span>';
 281+ if ( !$this->isValid() ) {
 282+ return $this->getErrorText();
290283 }
291284 else {
292 - return htmlspecialchars( $this->m_caption );
 285+ global $smgQPCoodFormat, $smgQPCoodDirectional;
 286+ return MapsCoordinateParser::formatCoordinates( $this->coordinateSet, $smgQPCoodFormat, $smgQPCoodDirectional );
293287 }
294288 }
295289
@@ -307,12 +301,18 @@
308302 * @since 0.6
309303 */
310304 public function getLongWikiText( $linked = null ) {
311 - if ( !$this->isValid() ) {
312 - return $this->getErrorText();
 305+ if ( $this->isValid() && ( $linked !== null ) && ( $linked !== false ) ) {
 306+ SMWOutputs::requireHeadItem( SMW_HEADER_TOOLTIP );
 307+
 308+ // TODO: fix lang keys so they include the space and coordinates.
 309+
 310+ return '<span class="smwttinline">' . htmlspecialchars( $this->m_caption ) . '<span class="smwttcontent">' .
 311+ htmlspecialchars ( wfMsgForContent( 'maps-latitude' ) . ' ' . $this->coordinateSet['lat'] ) . '<br />' .
 312+ htmlspecialchars ( wfMsgForContent( 'maps-longitude' ) . ' ' . $this->coordinateSet['lon'] ) .
 313+ '</span></span>';
313314 }
314315 else {
315 - global $smgQPCoodFormat, $smgQPCoodDirectional;
316 - return MapsCoordinateParser::formatCoordinates( $this->coordinateSet, $smgQPCoodFormat, $smgQPCoodDirectional );
 316+ return htmlspecialchars( $this->m_caption );
317317 }
318318 }
319319

Status & tagging log