You are here

openlayers_plus.module in OpenLayers Plus 7

Same filename and directory in other branches
  1. 7.3 openlayers_plus.module
  2. 7.2 openlayers_plus.module

File

openlayers_plus.module
View source
<?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(
      'type' => 'layer',
      '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(
      'type' => 'layer',
      '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(
      'type' => 'layer',
      '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'),
      'type' => 'layer',
      '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(
      'type' => 'layer',
      '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(
      'type' => 'layer',
      '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(
      'type' => 'layer',
      '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(
      'type' => 'layer',
      '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_maptext' => array(
      'type' => 'layer',
      'title' => t('OL+: MapText'),
      'description' => t('Display Controls and text on the map.'),
      'behavior' => array(
        'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
        'file' => 'openlayers_plus_behavior_maptext.inc',
        'class' => 'openlayers_plus_behavior_maptext',
        'parent' => 'openlayers_behavior',
      ),
    ),
    'openlayers_plus_behavior_popup' => array(
      'type' => 'layer',
      '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',
      ),
    ),
  );
}