class location_views_handler_field_latitude in Location 6.3
Same name and namespace in other branches
- 7.5 handlers/location_views_handler_field_latitude.inc \location_views_handler_field_latitude
- 7.3 handlers/location_views_handler_field_latitude.inc \location_views_handler_field_latitude
- 7.4 handlers/location_views_handler_field_latitude.inc \location_views_handler_field_latitude
@file Latitude field handler.
Hierarchy
- class \location_views_handler_field_latitude extends \views_handler_field
Expanded class hierarchy of location_views_handler_field_latitude
2 string references to 'location_views_handler_field_latitude'
- location_views_data in ./
location.views.inc - Implementation of hook_views_data().
- location_views_handlers in ./
location.views.inc - Implementation of hook_views_handlers().
File
- handlers/
location_views_handler_field_latitude.inc, line 8 - Latitude field handler.
View source
class location_views_handler_field_latitude extends views_handler_field {
function option_definition() {
$options = parent::option_definition();
$options['style'] = array(
'default' => 'dms',
);
return $options;
}
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['style'] = array(
'#title' => t('Display style'),
'#type' => 'select',
'#options' => array(
'dd' => t('Decimal degrees'),
'dms' => t('Degrees, minutes, seconds'),
),
'#default_value' => $this->options['style'],
);
}
function render($values) {
if ($this->options['style'] == 'dd') {
return check_plain($values->{$this->field_alias});
}
else {
return theme('location_latitude_dms', $values->{$this->field_alias});
}
}
}