function _gmap_prepare in GMap Module 7.2
Same name and namespace in other branches
- 5 gmap.module \_gmap_prepare()
- 6.2 gmap.module \_gmap_prepare()
- 6 gmap.module \_gmap_prepare()
- 7 gmap.module \_gmap_prepare()
Handle filter preparation.
@todo move this to GmapFilterToolbox
1 call to _gmap_prepare()
- _gmap_filter_process in ./
gmap.module - Filter process callback for gmap_macro.
File
- ./
gmap.module, line 360 - GMap -- Routines to use the Google Maps API in Drupal.
Code
function _gmap_prepare($intext) {
$out = FALSE;
$matches = array();
preg_match_all('/\\[gmap([^\\[\\]]+ )* \\] /x', $intext, $matches);
$i = 0;
while (isset($matches[1][$i])) {
$out[0][$i] = $matches[0][$i];
if ($matches[1][$i][0] == '1') {
$ver = 1;
$matches[1][$i] = substr($matches[0][$i], 1);
}
else {
$ver = 2;
}
$map = array(
'#type' => 'gmap',
'#gmap_settings' => gmap_parse_macro($matches[1][$i], $ver),
);
$out[1][$i] = drupal_render($map);
$i++;
}
// Endwhile process macro.
return $out;
}