You are here

function process_gmap_style in GMap Module 6.2

Same name and namespace in other branches
  1. 5 gmap.module \process_gmap_style()
  2. 6 gmap.module \process_gmap_style()
  3. 7.2 gmap.module \process_gmap_style()
  4. 7 gmap.module \process_gmap_style()

Style fieldset #process function.

1 string reference to 'process_gmap_style'
gmap_elements in ./gmap.module
Implementation of hook_elements().

File

./gmap.module, line 643
GMap -- Routines to use the Google Maps API in Drupal.

Code

function process_gmap_style($element) {
  $isline = $element['#gmap_style_type'] == 'line';

  // Stroke color
  $element[0] = array(
    '#type' => 'textfield',
    '#size' => 6,
    '#maxlength' => 6,
    '#field_prefix' => '#',
    '#title' => t('Stroke color'),
    '#value' => $element['#value'][0],
    '#attributes' => array(
      'class' => 'gmap_style',
    ),
  );

  // Stroke weight
  $element[1] = array(
    '#type' => 'textfield',
    '#title' => t('Stroke weight'),
    '#description' => t('Thickness of line, in pixels.'),
    '#size' => 3,
    '#maxlength' => 3,
    '#field_suffix' => t('px'),
    '#value' => $element['#value'][1],
    '#attributes' => array(
      'class' => 'gmap_style',
    ),
  );

  // Stroke opacity
  $element[2] = array(
    '#type' => 'textfield',
    '#title' => t('Stroke opacity'),
    '#size' => 3,
    '#maxlength' => 3,
    '#field_suffix' => '%',
    '#value' => $element['#value'][2],
    '#attributes' => array(
      'class' => 'gmap_style',
    ),
  );

  // Fill color
  $element[3] = array(
    '#type' => 'textfield',
    '#title' => t('Fill color'),
    '#description' => t('Hex color value for fill color. Example: #<em>00AA33</em>'),
    '#size' => 6,
    '#maxlength' => 6,
    '#field_prefix' => '#',
    '#value' => $isline ? '' : $element['#value'][3],
    '#disabled' => $isline,
    '#attributes' => array(
      'class' => 'gmap_style',
    ),
  );
  $element[4] = array(
    '#type' => 'textfield',
    '#title' => t('Fill opacity'),
    '#description' => t('Opacity of fill, from 0 to 100%.'),
    '#size' => 3,
    '#maxlength' => 3,
    '#field_suffix' => '%',
    '#value' => $isline ? '' : $element['#value'][4],
    '#disabled' => $isline,
    '#attributes' => array(
      'class' => 'gmap_style',
    ),
  );
  unset($element['#input']);
  $element += _element_info('fieldset');
  return $element;
}