You are here

function gmap_location_block_configure in GMap Module 7

Same name and namespace in other branches
  1. 7.2 gmap_location.module \gmap_location_block_configure()

Implement hook_block_configure().

File

./gmap_location.module, line 575
GMap Location module is a module to add some gmap funcationality based on location.modules information.

Code

function gmap_location_block_configure($delta = '') {
  if ($delta == 0) {

    // Location map
    $form['gmap_location_block_macro'] = array(
      '#type' => 'textfield',
      '#title' => t('Map Macro'),
      '#size' => 60,
      '#maxlength' => 500,
      '#description' => t('A macro to be used as a base map for the location block.  This map will be recentered on the location, so the center is not that important. <p>Alternate base map macros can be entered for a specific node type below.'),
      '#default_value' => variable_get('gmap_location_block_macro', '[gmap |width=100% |height=200px |control=None |behavior=+autozoom +notype]'),
    );
    $ntypes = node_type_get_types();
    foreach ($ntypes as $key => $value) {
      $settings = variable_get("location_settings_node_{$key}", FALSE);
      if (isset($settings['multiple']['max']) && $settings['multiple']['max'] || variable_get("location_maxnum_{$key}", 0)) {
        $form["gmap_location_block_macro_{$key}"] = array(
          '#type' => 'textfield',
          '#title' => t('Map Macro for %type', array(
            '%type' => $value->name,
          )),
          '#size' => 60,
          '#maxlength' => 500,
          '#default_value' => variable_get("gmap_location_block_macro_{$key}", ''),
        );
      }
    }
  }
  elseif ($delta == 1) {

    // Author map
    $form['gmap_location_author_block_macro'] = array(
      '#type' => 'textfield',
      '#title' => t('Map Macro'),
      '#size' => 60,
      '#maxlength' => 500,
      '#description' => t('A macro to be used as a base map for the location block author.  This map will be recentered on the location, so the center is not that important.'),
      '#default_value' => variable_get('gmap_location_author_block_macro', '[gmap |width=100% |height=200px |control=None |behavior=+autozoom +notype]'),
    );
    $form['gmap_location_author_block_types'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Enable author block for the following content types'),
      '#options' => array_map('check_plain', node_type_get_names()),
      '#default_value' => variable_get('gmap_location_author_block_types', array()),
    );
    $form['gmap_location_author_block_marker'] = array(
      '#type' => 'gmap_markerchooser',
      '#title' => t('Marker to use for author map'),
      '#default_value' => variable_get('gmap_location_author_block_marker', 'drupal'),
    );
  }
  return $form;
}