r101226 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101225‎ | r101226 | r101227 >
Date:22:41, 28 October 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added param docs
Modified paths:
  • /trunk/extensions/SemanticMaps/SemanticMaps.i18n.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_KMLPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_KMLPrinter.php
@@ -66,14 +66,17 @@
6767 $params = array_merge( parent::getParameters(), $this->exportFormatParameters() );
6868
6969 $params['text'] = new Parameter( 'text', Parameter::TYPE_STRING, $egMapsDefaultLabel );
70 - //$params['text']->setDescription();
 70+ $params['text']->setMessage( 'semanticmaps-kml-text' );
7171
7272 $params['title'] = new Parameter( 'title', Parameter::TYPE_STRING, $egMapsDefaultTitle );
 73+ $params['title']->setMessage( 'semanticmaps-kml-title' );
7374
74 - $params[] = new Parameter( 'linkabsolute', Parameter::TYPE_BOOLEAN, true );
 75+ $params['linkabsolute'] = new Parameter( 'linkabsolute', Parameter::TYPE_BOOLEAN, true );
 76+ $params['linkabsolute']->setMessage( 'semanticmaps-kml-linkabsolute' );
7577
7678 $params['pagelinktext'] = new Parameter( 'pagelinktext', Parameter::TYPE_STRING, wfMsg( 'semanticmaps-default-kml-pagelink' ) );
77 -
 79+ $params['pagelinktext']->setMessage( 'semanticmaps-kml-pagelinktext' );
 80+
7881 return $params;
7982 }
8083
@@ -115,6 +118,14 @@
116119 $link->setParameter( 'kml', 'format' );
117120 $link->setParameter( $this->m_params['linkabsolute'] ? 'yes' : 'no', 'linkabsolute' );
118121 $link->setParameter( $this->m_params['pagelinktext'], 'pagelinktext' );
 122+
 123+ if ( $this->m_params['title'] !== '' ) {
 124+ $link->setParameter( $this->m_params['title'], 'title' );
 125+ }
 126+
 127+ if ( $this->m_params['text'] !== '' ) {
 128+ $link->setParameter( $this->m_params['text'], 'text' );
 129+ }
119130
120131 if ( array_key_exists( 'limit', $this->m_params ) ) {
121132 $link->setParameter( $this->m_params['limit'], 'limit' );
Index: trunk/extensions/SemanticMaps/SemanticMaps.i18n.php
@@ -40,6 +40,11 @@
4141 'semanticmaps-par-template' => 'A template to use to format the info window contents.',
4242
4343 'semanticmaps-par-geocodecontrol' => 'Show the geocoding control.',
 44+
 45+ 'semanticmaps-kml-text' => 'The text associates with each page. Overriden by the aditional queried properties if any.',
 46+ 'semanticmaps-kml-title' => 'The default title for results',
 47+ 'semanticmaps-kml-linkabsolute' => 'Should links be absolute or not (ie relative)',
 48+ 'semanticmaps-kml-pagelinktext' => 'The text to use for the links to the page, in which $1 will be replaced by the page title',
4449 );
4550
4651 /** Message documentation (Message documentation)