| 1 |
<?php |
<?php |
| 2 |
//$Id$ |
//$Id: topichubs_calais_geo.module,v 1.1 2009/03/03 23:51:06 febbraro Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_topichubs_plugins(). |
* Implementation of hook_topichubs_plugins(). |
| 6 |
*/ |
*/ |
| 7 |
function topichubs_calais_geo_topichubs_plugins() { |
function topichubs_calais_geo_topichubs_plugins() { |
| 8 |
return array( |
return array( |
| 9 |
'calais_geo' => array( |
'calais_geo' => array( |
| 10 |
'title' => 'Locations', |
'title' => 'Locations', |
| 11 |
'description' => 'List Nodes referenced by Location.', |
'description' => 'List Nodes referenced by Location.', |
| 12 |
'handler' => 'topichubs_plugin_calais_geo', |
'handler' => 'topichubs_plugin_calais_geo', |
| 13 |
), |
), |
| 14 |
); |
); |
| 15 |
} |
} |
| 16 |
|
|
| 17 |
/** |
/** |
| 18 |
* Implementation of hook_theme(). |
* Implementation of hook_theme(). |
| 19 |
*/ |
*/ |
| 20 |
function topichubs_calais_geo_theme() { |
function topichubs_calais_geo_theme() { |
| 21 |
return array( |
return array( |
| 22 |
'topichubs_calais_geo_marker' => array( |
'topichubs_calais_geo_marker' => array( |
| 23 |
'arguments' => array('term' => NULL, 'nodes' => NULL), |
'arguments' => array('term' => NULL, 'nodes' => NULL), |
| 24 |
'path' => drupal_get_path('module', 'topichubs_calais_geo'), |
'path' => drupal_get_path('module', 'topichubs_calais_geo'), |
| 25 |
'template' => "topichubs-calais-geo-marker", |
'template' => "topichubs-calais-geo-marker", |
| 26 |
), |
), |
| 27 |
); |
); |
| 28 |
} |
} |
| 29 |
|
|
| 30 |
/** |
/** |
| 31 |
* Default theme function to rendering the text that goes in the Google Map marker bubble. |
* Default theme function to rendering the text that goes in the Google Map marker bubble. |
| 32 |
*/ |
*/ |
| 33 |
function template_preprocess_topichubs_calais_geo_marker(&$vars) { |
function template_preprocess_topichubs_calais_geo_marker(&$vars) { |
| 34 |
$term = $vars['term']; |
$term = $vars['term']; |
| 35 |
$nodes = $vars['nodes']; |
$nodes = $vars['nodes']; |
| 36 |
$vars['title'] = check_plain($term->name); |
$vars['title'] = check_plain($term->name); |
| 37 |
$vars['node_list'] = theme('item_list', $nodes); |
$vars['node_list'] = theme('item_list', $nodes); |
| 38 |
} |
} |