r83906 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83905‎ | r83906 | r83907 >
Date:15:34, 14 March 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
follow up to r83905
Modified paths:
  • /trunk/extensions/SemanticMaps/SemanticMaps.i18n.php (modified) (history)
  • /trunk/extensions/SemanticMaps/SemanticMaps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/SemanticMaps.i18n.php
@@ -16,10 +16,7 @@
1717 */
1818 $messages['en'] = array(
1919 // 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]).",
2421 'semanticmaps-unrecognizeddistance' => 'The value $1 is not a valid distance.',
2522 'semanticmaps-kml-link' => 'View the KML file',
2623 'semanticmaps-kml' => 'KML',
Index: trunk/extensions/SemanticMaps/SemanticMaps.php
@@ -36,51 +36,59 @@
3737 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 />' );
3838 }
3939
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' );
4341
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+);
4852
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 );
5057
51 - // Include the settings file.
52 - require_once 'SM_Settings.php';
 58+$smgStyleVersion = $wgStyleVersion . '-' . SM_VERSION;
5359
54 - $wgExtensionFunctions[] = 'smfSetup';
 60+// Include the settings file.
 61+require_once 'SM_Settings.php';
5562
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';
8464
 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+
8593 /**
8694 * 'Initialization' function for the Semantic Maps extension.
8795 * The only work done here is creating the extension credits for
@@ -91,29 +99,12 @@
92100 * @return true
93101 */
94102 function smfSetup() {
95 - global $wgExtensionCredits, $wgLang, $wgVersion;
 103+ global $wgVersion;
96104
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 -
102105 // This function has been deprecated in 1.16, but needed for earlier versions.
103106 if ( version_compare( $wgVersion, '1.16', '<' ) ) {
104107 wfLoadExtensionMessages( 'SemanticMaps' );
105108 }
106109
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 -
119110 return true;
120111 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r83955Follow-up r83906 for Translatewikiraymond19:58, 14 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83905simply extension descriptionjeroendedauw15:33, 14 March 2011

Status & tagging log