first import

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-08 11:40:19 +02:00
commit 1bc61b12ad
8435 changed files with 1582817 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<?php
/**
* @file
* Openlayers Blocks bean plugin.
*/
class OpenlayersBlocksBean extends BeanPlugin {
/**
* Declares default block settings.
*/
public function values() {
return array(
'openlayers_map' => array(),
);
}
/**
* Builds extra settings for the block edit form.
*/
public function form($bean, $form, &$form_state) {
$form['openlayers_map'] = array(
'#type' => 'select',
'#title' => t('Map'),
'#description' => t('This is the map that will be rendered in the block.'),
'#options' => openlayers_map_options(),
'#default_value' => $bean->openlayers_map
);
return $form;
}
/**
* Displays the bean.
*/
public function view($bean, $content, $view_mode = 'default', $langcode = NULL) {
$preset = openlayers_preset_load($bean->openlayers_map);
$content['openlayers_map']['#markup'] = openlayers_render_map($preset->data);
return $content;
}
}