function smfInitGoogleMaps() { global $wgAutoloadClasses; $wgAutoloadClasses['SMGoogleMapsQP'] = dirname(__FILE__) . '/SM_GoogleMapsQP.php'; MapsMappingServices::registerServiceFeature('googlemaps2', 'qp', 'SMMapPrinter'); return true; }
function smfInitGoogleMaps3() { global $wgAutoloadClasses; $wgAutoloadClasses['SMGoogleMaps3FormInput'] = __DIR__ . '/SM_GoogleMaps3FormInput.php'; MapsMappingServices::registerServiceFeature('googlemaps3', 'qp', 'SMMapPrinter'); MapsMappingServices::registerServiceFeature('googlemaps3', 'fi', 'SMGoogleMaps3FormInput'); return true; }
function smfInitGoogleMaps3() { global $wgAutoloadClasses; $wgAutoloadClasses['SMGoogleMaps3FormInput'] = __DIR__ . '/SM_GoogleMaps3FormInput.php'; //$wgAutoloadClasses['SMGoogleMaps3MultiInput'] = __DIR__ . '/SM_GoogleMaps3MultiInput.php'; MapsMappingServices::registerServiceFeature('googlemaps3', 'qp', 'SMMapPrinter'); MapsMappingServices::registerServiceFeature('googlemaps3', 'fi', 'SMGoogleMaps3FormInput'); //$sfgFormPrinter->setInputTypeHook( 'googlemapsmulti', array( 'SMGoogleMaps3MultiInput', 'onInputRequest' ), array() ); return true; }
function smfInitYahooMaps() { global $wgAutoloadClasses; $wgAutoloadClasses['SMYahooMapsQP'] = dirname(__FILE__) . '/SM_YahooMapsQP.php'; // TODO: the if should not be needed, but when omitted, a fatal error occurs cause the class that's extended by this one is not found. if (defined('SF_VERSION')) { $wgAutoloadClasses['SMYahooMapsFormInput'] = dirname(__FILE__) . '/SM_YahooMapsFormInput.php'; } MapsMappingServices::registerServiceFeature('yahoomaps', 'qp', 'SMMapPrinter'); MapsMappingServices::registerServiceFeature('yahoomaps', 'fi', 'SMYahooMapsFormInput'); return true; }
function smfInitLeaflet() { global $wgAutoloadClasses; /* forms input with leaflet not implemented yet $wgAutoloadClasses['SMLeafletFormInput'] = __DIR__ . '/SM_LeafletFormInput.php'; */ MapsMappingServices::registerServiceFeature('leaflet', 'qp', 'SMMapPrinter'); /* forms input with leaflet not implemented yet MapsMappingServices::registerServiceFeature( 'leaflet', 'fi', 'SMLeafletFormInput' ); */ return true; }
function smfInitOpenLayers() { global $wgAutoloadClasses; $wgAutoloadClasses['SMOpenLayersQP'] = __DIR__ . '/SM_OpenLayersQP.php'; // TODO: the if should not be needed, but when omitted, a fatal error occurs cause the class that's extended by this one is not found. if (defined('SF_VERSION')) { $wgAutoloadClasses['SMOpenLayersFormInput'] = __DIR__ . '/SM_OpenLayersFormInput.php'; } MapsMappingServices::registerServiceFeature('openlayers', 'qp', 'SMMapPrinter'); MapsMappingServices::registerServiceFeature('openlayers', 'fi', 'SMOpenLayersFormInput'); return true; }
function smfInitLeaflet() { MapsMappingServices::registerServiceFeature('leaflet', 'qp', 'SMMapPrinter'); return true; }
} define('SM_VERSION', '3.2'); if (version_compare($GLOBALS['wgVersion'], '1.19c', '<')) { throw new Exception('This version of Semantic Maps requires MediaWiki 1.18 or above;' . 'use Semantic Maps 1.0.x for MediaWiki 1.17 and Semantic Maps 0.7.x for older versions.'); } if (!defined('Maps_VERSION') && is_readable(__DIR__ . '/vendor/autoload.php')) { include_once __DIR__ . '/vendor/autoload.php'; } if (!defined('Maps_VERSION')) { throw new Exception('You need to have Maps installed in order to use Semantic Maps'); } $GLOBALS['wgExtensionCredits']['semantic'][] = array('path' => __FILE__, 'name' => 'Semantic Maps', 'version' => SM_VERSION, 'author' => array('[https://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]'), 'url' => 'https://github.com/SemanticMediaWiki/SemanticMaps/blob/master/README.md#semantic-maps', 'descriptionmsg' => 'semanticmaps-desc', 'license-name' => 'GPL-2.0+'); // Include the settings file. require_once 'SM_Settings.php'; include_once __DIR__ . '/src/queryprinters/SM_QueryPrinters.php'; $GLOBALS['wgResourceModules']['ext.sm.forminputs'] = array('dependencies' => array('ext.maps.coord'), 'localBasePath' => __DIR__ . '/src/forminputs', 'remoteExtPath' => 'SemanticMaps/src/forminputs', 'group' => 'ext.semanticmaps', 'scripts' => array('jquery.mapforminput.js'), 'messages' => array('semanticmaps_enteraddresshere', 'semanticmaps-updatemap', 'semanticmaps_lookupcoordinates', 'semanticmaps-forminput-remove', 'semanticmaps-forminput-add', 'semanticmaps-forminput-locations')); include_once __DIR__ . '/src/services/GoogleMaps3/SM_GoogleMaps3.php'; include_once __DIR__ . '/src/services/Leaflet/SM_Leaflet.php'; $GLOBALS['wgHooks']['MappingServiceLoad'][] = function () { MapsMappingServices::registerServiceFeature('openlayers', 'qp', 'SMMapPrinter'); return true; }; $GLOBALS['wgMessagesDirs']['SemanticMaps'] = __DIR__ . '/i18n'; $GLOBALS['wgExtensionMessagesFiles']['SemanticMaps'] = __DIR__ . '/SemanticMaps.i18n.php'; // Hook for initializing the Geographical Data types. $GLOBALS['wgHooks']['SMW::DataType::initTypes'][] = 'SemanticMapsHooks::initGeoDataTypes'; // Hook for defining the default query printer for queries that ask for geographical coordinates. $GLOBALS['wgHooks']['SMWResultFormat'][] = 'SemanticMapsHooks::addGeoCoordsDefaultFormat'; // Hook for adding a Semantic Maps links to the Admin Links extension. $GLOBALS['wgHooks']['AdminLinks'][] = 'SemanticMapsHooks::addToAdminLinks'; $GLOBALS['wgHooks']['sfFormPrinterSetup'][] = 'SemanticMaps\\FormInputsSetup::run';