? .svn
? help
? js
? markers
? tests
? thirdparty
? translations
Index: gmap.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/gmap.module,v
retrieving revision 1.99
diff -u -p -r1.99 gmap.module
--- gmap.module	12 Feb 2009 23:45:23 -0000	1.99
+++ gmap.module	24 Dec 2009 13:15:41 -0000
@@ -501,7 +501,7 @@ function gmap_regenerate_markers() {
   file_check_directory($jspath, FILE_CREATE_DIRECTORY);
 
   $contents .= "// GMap marker image data.\n";
-  $contents .= "Drupal.gmap.iconpath = ". drupal_to_js(base_path() . variable_get('gmap_markerfiles', drupal_get_path('module', 'gmap') .'/markers')) .";\n";
+  $contents .= "Drupal.gmap.iconpath = ". drupal_to_js(base_path()) .";\n";
   $contents .= "Drupal.gmap.icondata = ". drupal_to_js(gmap_get_icondata(TRUE)) .";\n";
 
   file_save_data($contents, "$jspath/gmap_markers.js", FILE_EXISTS_REPLACE);
Index: gmap_markerinfo.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/gmap/gmap_markerinfo.inc,v
retrieving revision 1.3
diff -u -p -r1.3 gmap_markerinfo.inc
--- gmap_markerinfo.inc	15 Jul 2008 20:09:17 -0000	1.3
+++ gmap_markerinfo.inc	24 Dec 2009 13:18:41 -0000
@@ -10,6 +10,16 @@
  */
 
 /**
+ * Implementation of hook_gmap_markerfiles_info().
+ *
+ * We just scan the directory set in the the 'gmap_markerfiles' variable.
+ */
+function gmap_gmap_markerfiles_info() {
+  $markerdir = variable_get('gmap_markerfiles', drupal_get_path('module', 'gmap') .'/markers');
+  return file_scan_directory($markerdir, '.*\.ini$');
+}
+
+/**
  * Get marker icon data for constructing json object.
  */
 function _gmap_get_icondata() {
@@ -23,13 +33,17 @@ function _gmap_get_icondata() {
     'transparent',
   );
 
-  $markerdir = variable_get('gmap_markerfiles', drupal_get_path('module', 'gmap') .'/markers');
+  // Markers are now stored relative to the drupal root:
+  $markerdir = '';
 
   // The following routines are designed to be easy to comprehend, not fast.
   // This whole process gets cached.
 
-  // Get the ini files.
-  $inifiles = file_scan_directory($markerdir, '.*\.ini$');
+  // Get the ini files from an info hook.
+  $inifiles = module_invoke_all('gmap_markerfiles_info');
+  drupal_alter('gmap_markerfiles_info', $inifiles);
+
+
   // Parse the ini files and store by path
   $inis = array();
   foreach ($inifiles as $file) {
@@ -216,13 +230,13 @@ function _gmap_compress_array(&$arr) {
 }
 
 function _gmap_get_marker_titles() {
-  $markerdir = variable_get('gmap_markerfiles', drupal_get_path('module', 'gmap') .'/markers');
 
   // The following routines are designed to be easy to comprehend, not fast.
   // This whole process gets cached.
 
   // Get the ini files.
-  $inifiles = file_scan_directory($markerdir, '.*\.ini$');
+  $inifiles = module_invoke_all('gmap_markerfiles_info');
+  drupal_alter('gmap_markerfiles_info', $inifiles);
   // Parse the ini files and store by path
   $inis = array();
   foreach ($inifiles as $file) {
