Index: trunk/extensions/SemanticMaps/YahooMaps/SM_YahooMapsFormInput.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | |
47 | 47 | if (empty($smgYahooFormsOnThisPage)) { |
48 | 48 | $smgYahooFormsOnThisPage = 0; |
49 | | - $this->output .= "<script type='$wgJsMimeType' src='$smgIncludePath/YahooMaps/SM_YahooMapsFunctions.js'></script>"; |
| 49 | + $this->output .= "<script type='$wgJsMimeType' src='$smgScriptPath/YahooMaps/SM_YahooMapsFunctions.js'></script>"; |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
Index: trunk/extensions/SemanticMaps/OpenLayers/SM_OpenLayersFormInput.php |
— | — | @@ -39,13 +39,13 @@ |
40 | 40 | */ |
41 | 41 | protected function addFormDependencies() { |
42 | 42 | global $wgJsMimeType; |
43 | | - global $smgIncludePath, $smgOLFormsOnThisPage; |
| 43 | + global $smgScriptPath, $smgOLFormsOnThisPage; |
44 | 44 | |
45 | 45 | MapsOpenLayersUtils::addOLDependencies($this->output); |
46 | 46 | |
47 | 47 | if (empty($smgOLFormsOnThisPage)) { |
48 | 48 | $smgOLFormsOnThisPage = 0; |
49 | | - $this->output .= "<script type='$wgJsMimeType' src='$smgIncludePath/OpenLayers/SM_OpenLayersFunctions.js'></script>"; |
| 49 | + $this->output .= "<script type='$wgJsMimeType' src='$smgScriptPath/OpenLayers/SM_OpenLayersFunctions.js'></script>"; |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
Index: trunk/extensions/SemanticMaps/SemanticMaps.php |
— | — | @@ -23,21 +23,15 @@ |
24 | 24 | die( 'Not an entry point.' ); |
25 | 25 | } |
26 | 26 | |
27 | | -define('SM_VERSION', '0.3.5'); |
| 27 | +define('SM_VERSION', '0.3.5 a2'); |
28 | 28 | |
29 | 29 | $smgScriptPath = $wgScriptPath . '/extensions/SemanticMaps'; |
30 | 30 | $smgIP = $IP . '/extensions/SemanticMaps'; |
31 | | -$smgIncludePath = $wgServer . $smgScriptPath; |
32 | 31 | |
33 | 32 | // Include the settings file |
34 | 33 | require_once($smgIP . '/SM_Settings.php'); |
35 | 34 | |
36 | | -// Add the extensions initializing function |
37 | | -if ( defined( 'MW_SUPPORTS_PARSERFIRSTCALLINIT' ) ) { |
38 | | - $wgHooks['ParserFirstCallInit'][] = 'smfSetup'; |
39 | | -} else { |
40 | | - $wgExtensionFunctions[] = 'smfSetup'; // Legacy support |
41 | | -} |
| 35 | +$wgExtensionFunctions[] = 'smfSetup'; |
42 | 36 | |
43 | 37 | $wgHooks['AdminLinks'][] = 'smfAddToAdminLinks'; |
44 | 38 | |
Index: trunk/extensions/SemanticMaps/QueryPrinters/SM_QueryPrinters.php |
— | — | @@ -1,9 +1,9 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * Initialization file for query printer functionality in the Maps extension |
| 5 | + * Initialization file for query printer functionality in the Semantic Maps extension |
6 | 6 | * |
7 | | - * @file SM_FormInputs.php |
| 7 | + * @file SM_QueryPrinters.php |
8 | 8 | * @ingroup SemanticMaps |
9 | 9 | * |
10 | 10 | * @author Jeroen De Dauw |
— | — | @@ -34,15 +34,12 @@ |
35 | 35 | // At least one query printer will be enabled when this point is reached. |
36 | 36 | $hasQueryPrinters = true; |
37 | 37 | |
38 | | - // Add the result format for the service name. |
39 | | - self::initFormat($serviceName, $serviceData['qp']); |
40 | | - |
41 | | - // Loop through the service alliases, and add them as result formats to the query printer. |
42 | | - foreach ($serviceData['aliases'] as $alias) self::initFormat($alias, $serviceData['qp']); |
| 38 | + // Initiate the format. |
| 39 | + self::initFormat($serviceName, $serviceData['qp'], $serviceData['aliases']); |
43 | 40 | } |
44 | 41 | |
45 | 42 | // Add the 'map' result format if there are mapping services that have QP's loaded. |
46 | | - if ($hasQueryPrinters) self::initFormat('map', array('class' => 'SMMapper', 'file' => 'QueryPrinters/SM_Mapper.php', 'local' => true)); |
| 43 | + if ($hasQueryPrinters) self::initFormat('map', array('class' => 'SMMapper', 'file' => 'QueryPrinters/SM_Mapper.php', 'local' => true), array()); |
47 | 44 | } |
48 | 45 | |
49 | 46 | /** |
— | — | @@ -50,8 +47,9 @@ |
51 | 48 | * |
52 | 49 | * @param string $format |
53 | 50 | * @param array $qp |
| 51 | + * @param array $aliases |
54 | 52 | */ |
55 | | - private static function initFormat($format, array $qp) { |
| 53 | + private static function initFormat($format, array $qp, array $aliases) { |
56 | 54 | global $wgAutoloadClasses, $smwgResultFormats, $smgIP; |
57 | 55 | |
58 | 56 | if (! array_key_exists($qp['class'], $wgAutoloadClasses)) { |
— | — | @@ -65,6 +63,10 @@ |
66 | 64 | else { |
67 | 65 | SMWQueryProcessor::$formats[$format] = $qp['class']; |
68 | 66 | } |
| 67 | + |
| 68 | + // TODO: set aliases |
| 69 | + // PHP 5.3 required |
| 70 | + //call_user_func_array(array($qp['class'], 'setAliases'), array($aliases)); |
69 | 71 | } |
70 | 72 | |
71 | 73 | } |
\ No newline at end of file |
Index: trunk/extensions/SemanticMaps/QueryPrinters/SM_Mapper.php |
— | — | @@ -28,6 +28,14 @@ |
29 | 29 | $this->queryPrinter = new $egMapsServices[$service]['qp']['class']($format, $inline); |
30 | 30 | } |
31 | 31 | |
| 32 | + public static function getAliases() { |
| 33 | + return $this->queryPrinter->getAliases(); |
| 34 | + } |
| 35 | + |
| 36 | + public static function setAliases() { |
| 37 | + return $this->queryPrinter->setAliases(); |
| 38 | + } |
| 39 | + |
32 | 40 | public function getName() { |
33 | 41 | return $this->queryPrinter->getName(); |
34 | 42 | } |
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMapsFunctions.js |
— | — | @@ -42,7 +42,6 @@ |
43 | 43 | |
44 | 44 | /** |
45 | 45 | * This function holds spesific functionallity for the Google Maps form input of Semantic Maps |
46 | | - * TODO: Refactor as much code as possible to non specific functions |
47 | 46 | */ |
48 | 47 | function showGAddress(address, mapName, outputElementName, notFoundFormat) { |
49 | 48 | var map = GMaps[mapName]; |
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMapsFormInput.php |
— | — | @@ -41,13 +41,13 @@ |
42 | 42 | */ |
43 | 43 | protected function addFormDependencies() { |
44 | 44 | global $wgJsMimeType; |
45 | | - global $smgIncludePath, $smgGoogleFormsOnThisPage; |
| 45 | + global $smgScriptPath, $smgGoogleFormsOnThisPage; |
46 | 46 | |
47 | 47 | MapsGoogleMapsUtils::addGMapDependencies($this->output); |
48 | 48 | |
49 | 49 | if (empty($smgGoogleFormsOnThisPage)) { |
50 | 50 | $smgGoogleFormsOnThisPage = 0; |
51 | | - $this->output .= "<script type='$wgJsMimeType' src='$smgIncludePath/GoogleMaps/SM_GoogleMapsFunctions.js'></script>"; |
| 51 | + $this->output .= "<script type='$wgJsMimeType' src='$smgScriptPath/GoogleMaps/SM_GoogleMapsFunctions.js'></script>"; |
52 | 52 | } |
53 | 53 | } |
54 | 54 | |