| 1 |
<?php
|
| 2 |
// $Id: gmap.php,v 1.1.2.3 2008/06/13 17:38:20 bdragon Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* These functions are used to implement a plugin for gmap.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* @addtogroup hooks
|
| 11 |
* @{
|
| 12 |
*/
|
| 13 |
|
| 14 |
/**
|
| 15 |
* Change the way gmap works.
|
| 16 |
*
|
| 17 |
* @param $op
|
| 18 |
* The operation to be performed. Possible values:
|
| 19 |
* - "macro": Add macro behaviors (Not well documented yet...)
|
| 20 |
* - "pre_theme_map": A map is being themed. This is a good place to
|
| 21 |
* drupal_add_js() any additional files needed to run the map in question.
|
| 22 |
* - "macro_multiple": Add macro behaviors (Not well documented yet...)
|
| 23 |
* - "behaviors": Define behavior flags used in your code.
|
| 24 |
* @param $map
|
| 25 |
* For the "pre_theme_map" operation, the map being themed. Not used in
|
| 26 |
* other operations.
|
| 27 |
* @return
|
| 28 |
* This varies depending on the operation.
|
| 29 |
* - "macro": An associative array. The keys are the macro keys, the values
|
| 30 |
* are an array of flags for that macro key:
|
| 31 |
* "multiple": This key can appear multiple times in a macro.
|
| 32 |
* - "pre_theme_map": None.
|
| 33 |
* - "macro_multiple": An array of macro keys that can appear multiple times.
|
| 34 |
* (Oops, this appears to be redundant... Look into this. --Bdragon)
|
| 35 |
* - "behaviors": An associative array. The keys are the names of the behavior
|
| 36 |
* flags, and the values are associative arrays in the following format:
|
| 37 |
* - "title": The title to show on the settings page.
|
| 38 |
* - "default": The default state of the flag.
|
| 39 |
* - "help": A description of the flag to show on the settings page.
|
| 40 |
* - "internal": If TRUE, the flag will be marked as map specific, and
|
| 41 |
* will not be stored in the defaults.
|
| 42 |
*/
|
| 43 |
function hook_gmap($op, &$map) {
|
| 44 |
switch ($op) {
|
| 45 |
case 'macro':
|
| 46 |
return array(
|
| 47 |
'feed' => array(
|
| 48 |
'multiple' => TRUE,
|
| 49 |
),
|
| 50 |
);
|
| 51 |
case 'pre_theme_map':
|
| 52 |
$path = drupal_get_path('module', 'gmap') .'/js/';
|
| 53 |
if (is_array($map['feed'])) {
|
| 54 |
drupal_add_js($path .'markerloader_georss.js');
|
| 55 |
}
|
| 56 |
break;
|
| 57 |
case 'macro_multiple':
|
| 58 |
return array('feed');
|
| 59 |
case 'behaviors':
|
| 60 |
return array(
|
| 61 |
'nomousezoom' => array(
|
| 62 |
'title' => t('Disable mousezoom'),
|
| 63 |
'default' => FALSE,
|
| 64 |
'help' => t('Disable using the scroll wheel to zoom the map.'),
|
| 65 |
),
|
| 66 |
);
|
| 67 |
}
|
| 68 |
}
|
| 69 |
|
| 70 |
/**
|
| 71 |
* @} End of "addtogroup hooks".
|
| 72 |
*/
|