function gmap_filter in GMap Module 5
Same name and namespace in other branches
- 6.2 gmap.module \gmap_filter()
- 6 gmap.module \gmap_filter()
Implementation of hook_filter().
File
- ./
gmap.module, line 434 - GMap -- Routines to use the Google Maps API in Drupal.
Code
function gmap_filter($op, $delta = 0, $format = -1, $text = '') {
switch ($op) {
case 'list':
return array(
0 => t('GMap macro expander'),
);
case 'name':
return t('Google map filter');
case 'description':
return t('Converts a Google Map macro into the HTML required for inserting a Google Map.');
case 'process':
$gmaps = _gmap_prepare($text);
//returns an array of $tables[0] = table macro $table[1]= table html
if ($gmaps) {
// there are table macros in this node
return str_replace($gmaps[0], $gmaps[1], $text);
}
else {
return $text;
}
case 'prepare':
return $text;
case 'no cache':
return TRUE;
}
}