Index: trunk/extensions/SemanticMaps/SemanticMaps.i18n.php |
— | — | @@ -16,10 +16,7 @@ |
17 | 17 | */ |
18 | 18 | $messages['en'] = array( |
19 | 19 | // General |
20 | | - 'semanticmaps_name' => 'Semantic Maps', |
21 | | - // TODO: update demo link to the new wiki, once it has 0.6.x running. |
22 | | - 'semanticmaps_desc' => "Provides the ability to view and edit coordinate data stored through the Semantic MediaWiki extension ([http://mapping.referata.com/wiki/Semantic_Maps_examples demo's]). |
23 | | -Available mapping services: $1", |
| 20 | + 'semanticmaps-desc' => "Provides the ability to view and edit coordinate data stored with the Semantic MediaWiki extension ([http://mapping.referata.com/wiki/Examples demo's]).", |
24 | 21 | 'semanticmaps-unrecognizeddistance' => 'The value $1 is not a valid distance.', |
25 | 22 | 'semanticmaps-kml-link' => 'View the KML file', |
26 | 23 | 'semanticmaps-kml' => 'KML', |
Index: trunk/extensions/SemanticMaps/SemanticMaps.php |
— | — | @@ -36,51 +36,59 @@ |
37 | 37 | die( '<b>Error:</b> You need to have <a href="http://semantic-mediawiki.org/wiki/Semantic_MediaWiki">Semantic MediaWiki</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Semantic Maps">Semantic Maps</a>.<br />' ); |
38 | 38 | } |
39 | 39 | |
40 | | -// Only initialize the extension when all dependencies are present. |
41 | | -if ( defined( 'Maps_VERSION' ) && defined( 'SMW_VERSION' ) ) { |
42 | | - define( 'SM_VERSION', '0.7.6 alpha' ); |
| 40 | +define( 'SM_VERSION', '0.7.6 alpha' ); |
43 | 41 | |
44 | | - $useExtensionPath = version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath; |
45 | | - $smgScriptPath = ( $useExtensionPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/SemanticMaps'; |
46 | | - $smgDir = dirname( __FILE__ ) . '/'; |
47 | | - unset( $useExtensionPath ); |
| 42 | +$wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'other'][] = array( |
| 43 | + 'path' => __FILE__, |
| 44 | + 'name' => 'Semantic Maps', |
| 45 | + 'version' => SM_VERSION, |
| 46 | + 'author' => array( |
| 47 | + '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]' |
| 48 | + ), |
| 49 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Maps', |
| 50 | + 'descriptionmsg' => 'semanticmaps-desc' |
| 51 | +); |
48 | 52 | |
49 | | - $smgStyleVersion = $wgStyleVersion . '-' . SM_VERSION; |
| 53 | +$useExtensionPath = version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath; |
| 54 | +$smgScriptPath = ( $useExtensionPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/SemanticMaps'; |
| 55 | +$smgDir = dirname( __FILE__ ) . '/'; |
| 56 | +unset( $useExtensionPath ); |
50 | 57 | |
51 | | - // Include the settings file. |
52 | | - require_once 'SM_Settings.php'; |
| 58 | +$smgStyleVersion = $wgStyleVersion . '-' . SM_VERSION; |
53 | 59 | |
54 | | - $wgExtensionFunctions[] = 'smfSetup'; |
| 60 | +// Include the settings file. |
| 61 | +require_once 'SM_Settings.php'; |
55 | 62 | |
56 | | - $wgExtensionMessagesFiles['SemanticMaps'] = $smgDir . 'SemanticMaps.i18n.php'; |
57 | | - |
58 | | - $incDir = dirname( __FILE__ ) . '/includes/'; |
59 | | - |
60 | | - // Data values |
61 | | - $wgAutoloadClasses['SMGeoCoordsValue'] = $incDir . 'SM_GeoCoordsValue.php'; |
62 | | - |
63 | | - // Value descriptions |
64 | | - $wgAutoloadClasses['SMGeoCoordsValueDescription'] = $incDir . 'SM_GeoCoordsValueDescription.php'; |
65 | | - $wgAutoloadClasses['SMAreaValueDescription'] = $incDir . 'SM_AreaValueDescription.php'; |
66 | | - |
67 | | - $wgAutoloadClasses['SemanticMapsHooks'] = dirname( __FILE__ ) . '/SemanticMaps.hooks.php'; |
68 | | - |
69 | | - // Hook for initializing the Geographical Coordinate type. |
70 | | - $wgHooks['smwInitDatatypes'][] = 'SMGeoCoordsValue::initGeoCoordsType'; |
71 | | - |
72 | | - // Hook for initializing the field types needed by Geographical Coordinates. |
73 | | - $wgHooks['SMWCustomSQLStoreFieldType'][] = 'SMGeoCoordsValue::initGeoCoordsFieldTypes'; |
74 | | - |
75 | | - // Hook for defining a table to store geographical coordinates in. |
76 | | - $wgHooks['SMWPropertyTables'][] = 'SMGeoCoordsValue::initGeoCoordsTable'; |
77 | | - |
78 | | - // Hook for defining the default query printer for queries that ask for geographical coordinates. |
79 | | - $wgHooks['SMWResultFormat'][] = 'SMGeoCoordsValue::addGeoCoordsDefaultFormat'; |
80 | | - |
81 | | - // Hook for adding a Semantic Maps links to the Admin Links extension. |
82 | | - $wgHooks['AdminLinks'][] = 'SemanticMapsHooks::addToAdminLinks'; |
83 | | -} |
| 63 | +$wgExtensionFunctions[] = 'smfSetup'; |
84 | 64 | |
| 65 | +$wgExtensionMessagesFiles['SemanticMaps'] = $smgDir . 'SemanticMaps.i18n.php'; |
| 66 | + |
| 67 | +$incDir = dirname( __FILE__ ) . '/includes/'; |
| 68 | + |
| 69 | +// Data values |
| 70 | +$wgAutoloadClasses['SMGeoCoordsValue'] = $incDir . 'SM_GeoCoordsValue.php'; |
| 71 | + |
| 72 | +// Value descriptions |
| 73 | +$wgAutoloadClasses['SMGeoCoordsValueDescription'] = $incDir . 'SM_GeoCoordsValueDescription.php'; |
| 74 | +$wgAutoloadClasses['SMAreaValueDescription'] = $incDir . 'SM_AreaValueDescription.php'; |
| 75 | + |
| 76 | +$wgAutoloadClasses['SemanticMapsHooks'] = dirname( __FILE__ ) . '/SemanticMaps.hooks.php'; |
| 77 | + |
| 78 | +// Hook for initializing the Geographical Coordinate type. |
| 79 | +$wgHooks['smwInitDatatypes'][] = 'SMGeoCoordsValue::initGeoCoordsType'; |
| 80 | + |
| 81 | +// Hook for initializing the field types needed by Geographical Coordinates. |
| 82 | +$wgHooks['SMWCustomSQLStoreFieldType'][] = 'SMGeoCoordsValue::initGeoCoordsFieldTypes'; |
| 83 | + |
| 84 | +// Hook for defining a table to store geographical coordinates in. |
| 85 | +$wgHooks['SMWPropertyTables'][] = 'SMGeoCoordsValue::initGeoCoordsTable'; |
| 86 | + |
| 87 | +// Hook for defining the default query printer for queries that ask for geographical coordinates. |
| 88 | +$wgHooks['SMWResultFormat'][] = 'SMGeoCoordsValue::addGeoCoordsDefaultFormat'; |
| 89 | + |
| 90 | +// Hook for adding a Semantic Maps links to the Admin Links extension. |
| 91 | +$wgHooks['AdminLinks'][] = 'SemanticMapsHooks::addToAdminLinks'; |
| 92 | + |
85 | 93 | /** |
86 | 94 | * 'Initialization' function for the Semantic Maps extension. |
87 | 95 | * The only work done here is creating the extension credits for |
— | — | @@ -91,29 +99,12 @@ |
92 | 100 | * @return true |
93 | 101 | */ |
94 | 102 | function smfSetup() { |
95 | | - global $wgExtensionCredits, $wgLang, $wgVersion; |
| 103 | + global $wgVersion; |
96 | 104 | |
97 | | - // Creation of a list of internationalized service names. |
98 | | - $services = array(); |
99 | | - foreach ( MapsMappingServices::getServiceIdentifiers() as $identifier ) $services[] = wfMsg( 'maps_' . $identifier ); |
100 | | - $servicesList = $wgLang->listToText( $services ); |
101 | | - |
102 | 105 | // This function has been deprecated in 1.16, but needed for earlier versions. |
103 | 106 | if ( version_compare( $wgVersion, '1.16', '<' ) ) { |
104 | 107 | wfLoadExtensionMessages( 'SemanticMaps' ); |
105 | 108 | } |
106 | 109 | |
107 | | - $wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'other'][] = array( |
108 | | - 'path' => __FILE__, |
109 | | - 'name' => wfMsg( 'semanticmaps_name' ), |
110 | | - 'version' => SM_VERSION, |
111 | | - 'author' => array( |
112 | | - '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw]', |
113 | | - '[http://www.mediawiki.org/wiki/Extension:Semantic_Maps/Credits ' . wfMsg( 'maps-others' ) . ']' |
114 | | - ), |
115 | | - 'url' => 'http://www.mediawiki.org/wiki/Extension:Semantic_Maps', |
116 | | - 'description' => wfMsgExt( 'semanticmaps_desc', 'parsemag', $servicesList ), |
117 | | - ); |
118 | | - |
119 | 110 | return true; |
120 | 111 | } |