You are here

class location_handler_field_location_address in Location 6.3

Same name and namespace in other branches
  1. 7.5 handlers/location_handler_field_location_address.inc \location_handler_field_location_address
  2. 7.3 handlers/location_handler_field_location_address.inc \location_handler_field_location_address
  3. 7.4 handlers/location_handler_field_location_address.inc \location_handler_field_location_address

@file Field handler to display a complete address.

Hierarchy

Expanded class hierarchy of location_handler_field_location_address

1 string reference to 'location_handler_field_location_address'
location_views_data in ./location.views.inc
Implementation of hook_views_data().

File

handlers/location_handler_field_location_address.inc, line 8
Field handler to display a complete address.

View source
class location_handler_field_location_address extends views_handler_field {
  function option_definition() {
    $options = parent::option_definition();
    $options['hide'] = array(
      'default' => array(),
    );
    return $options;
  }
  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    $form['hide'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Hide fields from display'),
      '#options' => location_field_names(TRUE),
      '#default_value' => $this->options['hide'],
    );
  }
  function render($values) {
    if ($values->{$this->field_alias}) {
      $location = location_load_location($values->{$this->field_alias});
      if ($location['lid']) {
        return theme('location', $location, $this->options['hide']);
      }
    }
  }

}

Members