function gmap_plugin_style_gmap::options_form in GMap Module 7
Same name and namespace in other branches
- 6.2 gmap_plugin_style_gmap.inc \gmap_plugin_style_gmap::options_form()
- 6 gmap_plugin_style_gmap.inc \gmap_plugin_style_gmap::options_form()
- 7.2 gmap_plugin_style_gmap.inc \gmap_plugin_style_gmap::options_form()
Render the given style.
Overrides views_plugin_style::options_form
File
- ./
gmap_plugin_style_gmap.inc, line 316 - GMap style plugin.
Class
- gmap_plugin_style_gmap
- Style plugin to render a map.
Code
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$field_options = array();
$fields = $this->display->handler
->get_handlers('field');
foreach ($fields as $id => $handler) {
$field_options[$id] = $handler
->ui_name(FALSE);
}
$argument_options = array();
$arguments = $this->display->handler
->get_handlers('argument');
foreach ($arguments as $id => $handler) {
$argument_options[$id] = $handler
->ui_name(FALSE);
}
$form['macro'] = array(
'#type' => 'textarea',
'#title' => t('Macro'),
'#rows' => 3,
'#default_value' => $this->options['macro'],
);
$form['datasource'] = array(
'#type' => 'select',
'#title' => t('Data Source'),
'#options' => array(
'location' => t('Location.module'),
'geofield' => t('Geofield.module'),
'fields' => t('Choose latitude and longitude fields'),
),
'#default_value' => $this->options['datasource'],
'#multiple' => FALSE,
);
$form['latfield'] = array(
'#title' => t('Latitude field'),
'#description' => t('Format must be degrees decimal.'),
'#type' => 'select',
'#options' => $field_options,
'#default_value' => $this->options['latfield'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-datasource' => array(
'fields',
),
),
);
$form['lonfield'] = array(
'#title' => t('Longitude field'),
'#description' => t('Format must be degrees decimal.'),
'#type' => 'select',
'#options' => $field_options,
'#default_value' => $this->options['lonfield'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-datasource' => array(
'fields',
),
),
);
$form['geofield'] = array(
'#title' => t('Geofield field'),
'#description' => t('Select the Geofield source field.'),
'#type' => 'select',
'#options' => $field_options,
'#default_value' => $this->options['geofield'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-datasource' => array(
'geofield',
),
),
);
$form['markers'] = array(
'#type' => 'select',
'#title' => t('Marker handling'),
// @@@ Detect view type automatically?
'#options' => array(
'nodetype' => t('By content type (for node views)'),
'taxonomy' => t('By term (for node views)'),
'userrole' => t('By user role (for user views)'),
'field' => t('Use marker field'),
'static' => t('Use single marker type'),
),
'#default_value' => $this->options['markers'],
);
$form['markerfield'] = array(
'#type' => 'select',
'#title' => t('Marker field'),
'#description' => t('You can use a views field to set the <em>markername</em> property of the markers.'),
'#options' => $field_options,
'#default_value' => $this->options['markerfield'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-markers' => array(
'field',
),
),
);
$form['enablermt'] = array(
'#type' => 'checkbox',
'#title' => t('Enable GMap RMT for markers'),
'#description' => t('You can pull the bodies of the markers from a callback instead of defining them inline. This is a performance feature for advanced users. <strong>NOTE:</strong> This feature is <strong>not compatible</strong> with the popup bubble feature below. Enable only one of them.'),
'#default_value' => $this->options['enablermt'],
);
$form['rmtfield'] = array(
'#type' => 'select',
'#title' => t('RMT field'),
'#description' => t('You can use a views field to define the "tail" of the path called back.'),
'#options' => $field_options,
'#default_value' => $this->options['rmtfield'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-enablermt' => array(
TRUE,
),
),
);
$form['rmtcallback'] = array(
'#type' => 'textfield',
'#title' => t('RMT callback path'),
'#description' => t('Define the base path to the callback here. The value of the rmt field will be appended.'),
'#default_value' => $this->options['rmtcallback'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-enablermt' => array(
TRUE,
),
),
);
// Hide the taxonomy handling if gmap_taxonomy.module isn't installed.
if (!module_exists('gmap_taxonomy')) {
unset($form['markers']['#options']['taxonomy']);
}
$form['markertype'] = array(
'#type' => 'gmap_markerchooser',
'#title' => t('Marker / fallback marker to use'),
'#default_value' => $this->options['markertype'],
);
$form['center_on_nodearg'] = array(
'#type' => 'checkbox',
'#title' => t('Center on node argument'),
'#default_value' => $this->options['center_on_nodearg'],
'#description' => $this->view->base_table == 'node' ? t('Note: The view must contain an argument whose value is a node ID.') : t('Note: The view must contain an argument whose value is a node ID.') . '<br />' . t("The view must contain 'Node: nid' as one of its fields because the view type is not 'Node'."),
);
$form['center_on_nodearg_arg'] = array(
'#title' => t('Argument'),
'#description' => empty($argument_options) ? t("The value of the selected argument must be a number that matches a node ID. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID. You must have added arguments to the view to use this option.") : t("The selected argument must be a number that matches a node ID. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID."),
'#type' => 'select',
'#options' => $argument_options,
'#default_value' => $this->options['center_on_nodearg_arg'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-center-on-nodearg' => array(
TRUE,
),
),
);
if (module_exists('location')) {
$form['center_on_proximityarg'] = array(
'#type' => 'checkbox',
'#title' => t('Center on proximity contextual filter'),
'#default_value' => $this->options['center_on_proximityarg'],
'#description' => t('Note: The view must contain a "Location: Distance / Proximity" contextual filter'),
);
}
$form['highlight_nodearg'] = array(
'#type' => 'checkbox',
'#title' => t('Highlight marker for node argument'),
'#default_value' => $this->options['highlight_nodearg'],
'#description' => $this->view->base_table == 'node' ? t('Note: The view must contain an argument whose value is a node ID.') : t('Note: The view must contain an argument whose value is a node ID.') . '<br />' . t("The view must contain 'Node: nid' as one of its fields because the view type is not 'Node'."),
);
$form['highlight_nodearg_arg'] = array(
'#title' => t('Argument'),
'#description' => empty($argument_options) ? t("The value of the selected argument must be a number that matches a node ID. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID. You must have added arguments to the view to use this option.") : t("The value of the selected argument must be a number that matches a node ID. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID."),
'#type' => 'select',
'#options' => $argument_options,
'#default_value' => $this->options['highlight_nodearg_arg'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-highlight-nodearg' => array(
TRUE,
),
),
);
$form['highlight_nodearg_color'] = array(
'#title' => t('Highlight color'),
'#description' => t("A 6 digit hex color value to use for the highlight. Include preceding hash. Example #FF0000"),
'#type' => 'textfield',
'#size' => 7,
'#maxlength' => 7,
'#default_value' => $this->options['highlight_nodearg_color'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-highlight-nodearg' => array(
TRUE,
),
),
);
$form['autoclick_on_nodearg'] = array(
'#type' => 'checkbox',
'#title' => t('Autoclick on node argument'),
'#default_value' => $this->options['autoclick_on_nodearg'],
'#description' => $this->view->base_table == 'node' ? t('Note: The view must contain an argument whose value is a node ID.') : t('Note: The view must contain an argument whose value is a node ID.') . '<br />' . t("The view must contain 'Node: nid' as one of its fields because the view type is not 'Node'."),
);
$form['autoclick_on_nodearg_arg'] = array(
'#title' => t('Argument'),
'#description' => empty($argument_options) ? t("The value of the selected argument must be a number that matches a node ID. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID. You must have added arguments to the view to use this option.") : t("The selected argument must be a number that matches a node ID. Use the 'Global: Null' argument if you don't want to also restrict results to that node ID."),
'#type' => 'select',
'#options' => $argument_options,
'#default_value' => $this->options['autoclick_on_nodearg_arg'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-autoclick-on-nodearg' => array(
TRUE,
),
),
);
$form['tooltipenabled'] = array(
'#type' => 'checkbox',
'#title' => t('Display a tooltip when hovering over markers'),
'#default_value' => $this->options['tooltipenabled'],
);
$form['tooltipfield'] = array(
'#title' => t('Tooltip field'),
'#description' => empty($field_options) ? t("The field's format must be text. You must be using the fields row style and have added fields to the view to use this option.") : t("The field's format must be text."),
'#type' => 'select',
'#options' => $field_options,
'#default_value' => $this->options['tooltipfield'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-tooltipenabled' => array(
TRUE,
),
),
);
$form['bubbletextenabled'] = array(
'#type' => 'checkbox',
'#title' => t('Display a popup bubble with additional information when a marker is clicked.'),
'#default_value' => $this->options['bubbletextenabled'],
'#description' => t('<strong>NOTE:</strong> This feauture is <strong>not compatible</strong> with the RMT option offered above. Do not use them together.'),
);
$form['bubbletextfield'] = array(
'#title' => t('Bubble pop-up field'),
'#description' => empty($field_options) ? t("The field's format must be HTML or text. You must be using the fields row style and have added fields to the view to use this option.") : t("The field's format must be HTML or text."),
'#type' => 'select',
'#options' => $field_options,
'#default_value' => $this->options['bubbletextfield'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-style-options-bubbletextenabled' => array(
TRUE,
),
),
);
}