r67947 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67946‎ | r67947 | r67948 >
Date:14:09, 13 June 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.6.3 - Follow up to r67904
Modified paths:
  • /trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_MapPrinter.php (modified) (history)
  • /trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsFormInput.php (modified) (history)
  • /trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsQP.php (modified) (history)
  • /trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFormInput.php (modified) (history)
  • /trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersQP.php (modified) (history)
  • /trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsFormInput.php (modified) (history)
  • /trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsQP.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsQP.php
@@ -14,6 +14,10 @@
1515
1616 final class SMYahooMapsQP extends SMMapPrinter {
1717
 18+ protected function getServiceName() {
 19+ return 'yahoomaps';
 20+ }
 21+
1822 /**
1923 * @see SMMapPrinter::setQueryPrinterSettings()
2024 */
@@ -31,7 +35,7 @@
3236 protected function doMapServiceLoad() {
3337 global $egYahooMapsOnThisPage, $wgParser;
3438
35 - MapsYahooMaps::addYMapDependencies( $wgParser );
 39+ MapsYahooMaps::addDependencies( $wgParser );
3640 $egYahooMapsOnThisPage++;
3741
3842 $this->elementNr = $egYahooMapsOnThisPage;
Index: trunk/extensions/SemanticMaps/Services/YahooMaps/SM_YahooMapsFormInput.php
@@ -38,7 +38,7 @@
3939 global $wgOut;
4040 global $smgScriptPath, $smgYahooFormsOnThisPage, $smgStyleVersion, $egMapsJsExt;
4141
42 - MapsYahooMaps::addYMapDependencies( $wgOut );
 42+ MapsYahooMaps::addDependencies( $wgOut );
4343
4444 if ( empty( $smgYahooFormsOnThisPage ) ) {
4545 $smgYahooFormsOnThisPage = 0;
Index: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersQP.php
@@ -15,6 +15,10 @@
1616
1717 final class SMOpenLayersQP extends SMMapPrinter {
1818
 19+ protected function getServiceName() {
 20+ return 'openlayers';
 21+ }
 22+
1923 /**
2024 * @see SMMapPrinter::setQueryPrinterSettings()
2125 *
@@ -33,7 +37,7 @@
3438 protected function doMapServiceLoad() {
3539 global $wgParser, $egOpenLayersOnThisPage;
3640
37 - MapsOpenLayers::addOLDependencies( $wgParser);
 41+ MapsOpenLayers::addDependencies( $wgParser);
3842 $egOpenLayersOnThisPage++;
3943
4044 $this->elementNr = $egOpenLayersOnThisPage;
Index: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFormInput.php
@@ -37,7 +37,7 @@
3838 global $wgOut;
3939 global $smgScriptPath, $smgOLFormsOnThisPage, $smgStyleVersion, $egMapsJsExt;
4040
41 - MapsOpenLayers::addOLDependencies( $wgOut );
 41+ MapsOpenLayers::addDependencies( $wgOut );
4242
4343 if ( empty( $smgOLFormsOnThisPage ) ) {
4444 $smgOLFormsOnThisPage = 0;
Index: trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsQP.php
@@ -16,7 +16,9 @@
1717
1818 final class SMGoogleMapsQP extends SMMapPrinter {
1919
20 - protected $specificParameters;
 20+ protected function getServiceName() {
 21+ return 'googlemaps';
 22+ }
2123
2224 /**
2325 * @see SMMapPrinter::setQueryPrinterSettings()
@@ -47,7 +49,7 @@
4850
4951 if ( empty( $egGoogleMapsOnThisPage ) ) {
5052 $egGoogleMapsOnThisPage = 0;
51 - MapsGoogleMaps::addGMapDependencies( $wgParser );
 53+ MapsGoogleMaps::addDependencies( $wgParser );
5254 }
5355
5456 $egGoogleMapsOnThisPage++;
Index: trunk/extensions/SemanticMaps/Services/GoogleMaps/SM_GoogleMapsFormInput.php
@@ -41,7 +41,7 @@
4242 global $wgOut;
4343 global $smgScriptPath, $smgGoogleFormsOnThisPage, $smgStyleVersion, $egMapsJsExt;
4444
45 - MapsGoogleMaps::addGMapDependencies( $wgOut );
 45+ MapsGoogleMaps::addDependencies( $wgOut );
4646
4747 if ( empty( $smgGoogleFormsOnThisPage ) ) {
4848 $smgGoogleFormsOnThisPage = 0;
Index: trunk/extensions/SemanticMaps/Features/QueryPrinters/SM_MapPrinter.php
@@ -38,6 +38,8 @@
3939 */
4040 protected abstract function doMapServiceLoad();
4141
 42+ protected abstract function getServiceName();
 43+
4244 /**
4345 * Gets the query result
4446 */
@@ -61,6 +63,12 @@
6264 protected $specificParameters = array();
6365
6466 public function __construct( $format, $inline, /* MapsMappingService */ $service = null ) {
 67+ // TODO: this is a hack since I can't find a way to pass along the service object here when the QP is created in SMW.
 68+ if ( $service == null ) {
 69+ global $egMapsServices;
 70+ $service = $egMapsServices[$this->getServiceName()];
 71+ }
 72+
6573 $this->mService = $service;
6674 }
6775

Follow-up revisions

RevisionCommit summaryAuthorDate
r67948Fixed error from r67947jeroendedauw14:11, 13 June 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r67904Changes for 0.6.3 - rewrote service handling (incompatible with SM for now)jeroendedauw16:15, 12 June 2010

Status & tagging log