function getlocations_fields_plugin_style_streetview::options_form in Get Locations 7.2
Same name and namespace in other branches
- 7 modules/getlocations_fields/views/getlocations_fields_plugin_style_streetview.inc \getlocations_fields_plugin_style_streetview::options_form()
Provide a form to edit options for this plugin.
Overrides views_plugin_style::options_form
File
- modules/
getlocations_fields/ views/ getlocations_fields_plugin_style_streetview.inc, line 65 - getlocations_fields_plugin_style_streetview.inc @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL
Class
- getlocations_fields_plugin_style_streetview
- Getlocations style plugin to render a row as a google streetview.
Code
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
if (!module_exists('getlocations_fields')) {
return;
}
$form['#theme'] = 'getlocations_plugin_style_streetview_options_form';
$getlocations_fields_paths = getlocations_fields_paths_get();
$form['#attached']['js'] = array(
$getlocations_fields_paths['getlocations_fields_views_path'],
);
$handlers = $this->display->handler
->get_handlers('field');
$source_options = array(
'' => t('None'),
);
foreach ($handlers as $handle) {
$source_options[$handle->options['id']] = !empty($handle->options['label']) ? $handle->options['label'] : $handle->options['id'];
}
// streetview killswitch
if (!getlocations_fields_streetview_settings_allow()) {
$form['message'] = array(
'#markup' => '<p><b>' . t('Streetview has been disabled globally, this plugin is inactive.') . '</b></p>',
);
}
$form['width'] = getlocations_element_map_tf(t('Width'), $this->options['width'], t('The default width of a Google streetview, as a CSS length or percentage. Examples: <em>50px</em>, <em>5em</em>, <em>2.5in</em>, <em>95%</em>'), 10, 10, TRUE);
$form['height'] = getlocations_element_map_tf(t('Height'), $this->options['height'], t('The default height of a Google streetview, as a CSS length or percentage. Examples: <em>50px</em>, <em>5em</em>, <em>2.5in</em>, <em>95%</em>'), 10, 10, TRUE);
$form += getlocations_fields_sv_control_form($this->options);
$form['sv_fullscreen'] = getlocations_element_map_checkbox(t('Show Fullscreen button'), $this->options['sv_fullscreen']);
}