You are here

function getlocations_highlight_form in Get Locations 7.2

Same name and namespace in other branches
  1. 7 getlocations.module \getlocations_highlight_form()
1 call to getlocations_highlight_form()
getlocations_map_display_options_form in ./getlocations.module
Function

File

./getlocations.module, line 4607
getlocations.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_highlight_form($defaults) {

  // marker highlighting
  $form = array();
  $form['highlight_enable'] = getlocations_element_map_checkbox(t('Enable Marker highlighting'), $defaults['highlight_enable'], t('Highlight a marker with a circle on mouseover'));
  $form['highlight_enable']['#suffix'] = '<div id="wrap-getlocations-highlight">';
  if (module_exists('jquery_colorpicker') && $defaults['jquery_colorpicker_enabled']) {
    $form['highlight_strokecolor'] = array(
      '#type' => 'jquery_colorpicker',
      '#title' => t('Highlight Circle line color'),
      '#default_value' => preg_replace("/^#/", '', $defaults['highlight_strokecolor']),
      '#description' => t('Click on the Colorpicker icon to select a color'),
    );
  }
  else {
    $form['highlight_strokecolor'] = getlocations_element_map_tf(t('Highlight Circle line color'), $defaults['highlight_strokecolor'], t('HTML hex, eg #FF0000.'), 10, 10, TRUE);
  }
  $form['highlight_strokeopacity'] = getlocations_element_map_tf(t('Highlight Circle line opacity'), $defaults['highlight_strokeopacity'], t('Must be between 0 and 1.'), 10, 10, TRUE);
  $form['highlight_strokeweight'] = getlocations_element_map_tf(t('Highlight Circle line thickness'), $defaults['highlight_strokeweight'], t('Must be an integer.'), 10, 10, TRUE);

  // jquery_colorpicker
  if (module_exists('jquery_colorpicker') && $defaults['jquery_colorpicker_enabled']) {
    $form['highlight_fillcolor'] = array(
      '#type' => 'jquery_colorpicker',
      '#title' => t('Highlight Circle fill color'),
      '#default_value' => preg_replace("/^#/", '', $defaults['highlight_fillcolor']),
      '#description' => t('Click on the Colorpicker icon to select a color'),
    );
  }
  else {
    $form['highlight_fillcolor'] = getlocations_element_map_tf(t('Highlight Circle fill color'), $defaults['highlight_fillcolor'], t('HTML hex, eg #FF0000.'), 10, 10, TRUE);
  }
  $form['highlight_fillopacity'] = getlocations_element_map_tf(t('Highlight Circle fill opacity'), $defaults['highlight_fillopacity'], t('Must be between 0 and 1.'), 10, 10, TRUE);
  $form['highlight_radius'] = getlocations_element_map_tf(t('Highlight Circle size'), $defaults['highlight_radius'], t("The size of the highlight circle, 10 or 20 recommended."), 5, 5, TRUE);
  $form['highlight_radius']['#suffix'] = '</div>';
  return $form;
}