r62026 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62025‎ | r62026 | r62027 >
Date:15:00, 5 February 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.5.4.
* Added settings for forceshow, showtitle and template QP parameters.
Modified paths:
  • /trunk/extensions/SemanticMaps/QueryPrinters/SM_QueryPrinters.php (modified) (history)
  • /trunk/extensions/SemanticMaps/SM_Settings.php (modified) (history)
  • /trunk/extensions/SemanticMaps/SemanticMaps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/SM_Settings.php
@@ -50,12 +50,26 @@
5151 include_once $smgIP . '/YahooMaps/SM_YahooMaps.php'; // Yahoo! Maps
5252 include_once $smgIP . '/OpenStreetMap/SM_OSM.php'; // OpenLayers optimized for OSM
5353
54 -
55 -
56 -
57 -
5854 # Array of String. The default mapping service for each feature, which will be used when no valid service is provided by the user.
5955 # Each service needs to be enabled, if not, the first one from the available services will be taken.
6056 # Note: The default service needs to be available for the feature you set it for, since it's used as a fallback mechanism.
6157 $egMapsDefaultServices['qp'] = 'googlemaps2';
6258 $egMapsDefaultServices['fi'] = 'googlemaps2';
 59+
 60+
 61+
 62+
 63+
 64+# Query Printers
 65+
 66+# Boolean. The default value for the forceshow parameter. Will force a map to be shown even when there are no query results
 67+# when set to true. This value will only be used when the user does not provide one.
 68+$smgQPForceShow = false;
 69+
 70+# Boolean. The default value for the showtitle parameter. Will hide the title in the marker pop-ups when set to true.
 71+# This value will only be used when the user does not provide one.
 72+$smgQPShowTitle = true;
 73+
 74+# String or false. Allows you to define the content and it's layout of marker pop-ups via a template.
 75+# This value will only be used when the user does not provide one.
 76+$smgQPTemplate = false;
Index: trunk/extensions/SemanticMaps/SemanticMaps.php
@@ -35,27 +35,27 @@
3636
3737 // Only initialize the extension when all dependencies are present.
3838 if (defined( 'Maps_VERSION' ) && defined( 'SMW_VERSION' )) {
39 - define('SM_VERSION', '0.5.3');
40 -
 39+ define('SM_VERSION', '0.5.4 a2');
 40+
4141 $smgScriptPath = $wgScriptPath . '/extensions/SemanticMaps';
4242 $smgIP = $IP . '/extensions/SemanticMaps';
43 -
 43+
4444 $smgStyleVersion = $wgStyleVersion . '-' . SM_VERSION;
45 -
 45+
4646 // Include the settings file.
4747 require_once($smgIP . '/SM_Settings.php');
48 -
 48+
4949 $wgExtensionFunctions[] = 'smfSetup';
50 -
 50+
5151 $wgHooks['AdminLinks'][] = 'smfAddToAdminLinks';
52 -
 52+
5353 $wgExtensionMessagesFiles['SemanticMaps'] = $smgIP . '/SemanticMaps.i18n.php';
54 -
 54+
5555 // Registration of the Geographical Coordinate type.
5656 $wgAutoloadClasses['SMGeoCoordsValue'] = $smgIP . '/SM_GeoCoordsValue.php';
5757 $wgHooks['smwInitDatatypes'][] = 'smfInitGeoCoordsType';
5858 }
59 -
 59+
6060 /**
6161 * 'Initialization' function for the Semantic Maps extension.
6262 * The only work done here is creating the extension credits for
@@ -63,7 +63,7 @@
6464 */
6565 function smfSetup() {
6666 global $wgExtensionCredits, $wgLang, $wgOut, $egMapsServices, $smgScriptPath;
67 -
 67+
6868 // Creation of a list of internationalized service names.
6969 $services = array();
7070 foreach (array_keys($egMapsServices) as $name) $services[] = wfMsg('maps_'.$name);
Index: trunk/extensions/SemanticMaps/QueryPrinters/SM_QueryPrinters.php
@@ -48,6 +48,7 @@
4949
5050 private static function initializeParams() {
5151 global $egMapsDefaultServices, $egMapsDefaultCentre, $egMapsAvailableGeoServices, $egMapsDefaultGeoService;
 52+ global $smgQPForceShow, $smgQPShowTitle, $smgQPTemplate;
5253
5354 self::$parameters = array(
5455 'geoservice' => array(
@@ -67,19 +68,19 @@
6869 'forceshow' => array(
6970 'type' => 'boolean',
7071 'aliases' => array('force show'),
71 - 'default' => false,
 72+ 'default' => $smgQPForceShow,
7273 'output-type' => 'boolean'
7374 ),
7475 'template' => array(
7576 'criteria' => array(
7677 'not_empty' => array()
7778 ),
78 - 'default' => false,
 79+ 'default' => $smgQPTemplate,
7980 ),
8081 'showtitle' => array(
8182 'type' => 'boolean',
8283 'aliases' => array('show title'),
83 - 'default' => true,
 84+ 'default' => $smgQPShowTitle,
8485 'output-type' => 'boolean'
8586 ),
8687 'icon' => array(

Status & tagging log