popsu-d7/sites/all/modules/openlayers_plus/openlayers_plus.module
Bachir Soussi Chiadmi 1bc61b12ad first import
2015-04-08 11:40:19 +02:00

176 lines
6.6 KiB
Plaintext

<?php
/**
* Implements hook_block_info().
*/
function openlayers_plus_block_info() {
$blocks = array(
'blockswitcher' => array('info' => t('OL+ Blockswitcher')),
'blocktoggle' => array('info' => t('OL+ BlockToggle'))
);
return $blocks;
}
/**
* Implements hook_block_view().
*/
function openlayers_plus_block_view($delta) {
switch ($delta) {
case 'blockswitcher':
return array(
'subject' => t('Map layers'),
'content' => Array('#theme' =>'openlayers_plus_blockswitcher'),
);
case 'blocktoggle':
// TODO Please change this theme call to use an associative array for the $variables parameter.
return array(
'subject' => t('Map layers'),
'content' => Array('#theme' =>'openlayers_plus_blocktoggle'),
);
}
}
/**
* Implements hook_theme().
*/
function openlayers_plus_theme() {
return array(
'openlayers_plus_blockswitcher' => array(
'variables' => array(),
'path' => drupal_get_path('module', 'openlayers_plus') . '/theme',
'template' => 'openlayers-plus-blockswitcher',
'file' => 'theme.inc',
),
'openlayers_plus_blocktoggle' => array(
'variables' => array(
'a_label' => '',
'b_label' => '',
),
'path' => drupal_get_path('module', 'openlayers_plus') . '/theme',
'template' => 'openlayers-plus-blocktoggle',
'file' => 'theme.inc',
),
'openlayers_plus_legend_raw' => array(
'variables' => array(
'raw' => '',
'layer' => array(),
'layer_id' => array(),
),
'path' => drupal_get_path('module', 'openlayers_plus') . '/theme',
'template' => 'openlayers-plus-legend-raw',
'file' => 'theme.inc',
),
'openlayers_plus_legend' => array(
'variables' => array(
'legend' => array(),
'layer' => array(),
'layer_id' => array(),
),
'path' => drupal_get_path('module', 'openlayers_plus') . '/theme',
'template' => 'openlayers-plus-legend',
'file' => 'theme.inc',
),
);
}
/**
* Implements hook_openlayers_behaviors().
*
* This is a ctools plugins hook.
*/
function openlayers_plus_openlayers_behaviors() {
return array(
'openlayers_plus_behavior_blockswitcher' => array(
'title' => t('OL+: Blockswitcher'),
'description' => t('A clone of LayerSwitcher, with better themability and positioning via the Drupal block system.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
'file' => 'openlayers_plus_behavior_blockswitcher.inc',
'class' => 'openlayers_plus_behavior_blockswitcher',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_blocktoggle' => array(
'title' => t('OL+: Blocktoggle'),
'description' => t('A version of BlockSwitcher that toggles between two different layers only. Useful for situations in which layers represent the same data in slightly different ways.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
'file' => 'openlayers_plus_behavior_blocktoggle.inc',
'class' => 'openlayers_plus_behavior_blocktoggle',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_themeregion' => array(
'title' => t('OL+: Theme Region'),
'description' => t('Inserts Drupal Theme Regions on top of the map.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
'file' => 'openlayers_plus_behavior_themeregion.inc',
'class' => 'openlayers_plus_behavior_themeregion',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_legend' => array(
'title' => t('OL+: Map legend'),
'description' => t('A block in a corner of a map that provides information on layers.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
'file' => 'openlayers_plus_behavior_legend.inc',
'class' => 'openlayers_plus_behavior_legend',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_permalink' => array(
'title' => t('OL+: Permalink'),
'description' => t('A version of Permalink optimized to persist layers between pages with different layer setups and without explicitly using the control.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
'file' => 'openlayers_plus_behavior_permalink.inc',
'class' => 'openlayers_plus_behavior_permalink',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_scalepoints' => array(
'title' => t('OL+: Scalepoints'),
'description' => t('Dynamic styling, changing point radii based on a certain value.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
'file' => 'openlayers_plus_behavior_scalepoints.inc',
'class' => 'openlayers_plus_behavior_scalepoints',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_tooltips' => array(
'title' => t('OL+: Tooltips'),
'description' => t('An interaction with point-based maps that results in following links on hover.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
'file' => 'openlayers_plus_behavior_tooltips.inc',
'class' => 'openlayers_plus_behavior_tooltips',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_tooltips_field' => array(
'title' => t('OL+: Tooltips Field'),
'description' => t('An interaction with point-based maps that results in following links on hover that you specify the field.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
'file' => 'openlayers_plus_behavior_tooltips_field.inc',
'class' => 'openlayers_plus_behavior_tooltips_field',
'parent' => 'openlayers_behavior',
),
),
'openlayers_plus_behavior_popup' => array(
'title' => t('OL+: Popups'),
'description' => t('An interaction with point-based, clustered maps that allows clicking on points that results in scanning between items.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
'file' => 'openlayers_plus_behavior_popup.inc',
'class' => 'openlayers_plus_behavior_popup',
'parent' => 'openlayers_behavior',
),
),
);
}