You are here

function party_handler_relationship_party_from_attached_entity::options_form in Party 7

Extends the relationship's basic options.

Overrides views_handler_relationship::options_form

File

includes/views/party_handler_relationship_party_from_attached_entity.inc, line 22
Relationship from an attached entity to a party.

Class

party_handler_relationship_party_from_attached_entity
@file Relationship from an attached entity to a party.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);

  // Get all defined data sets.
  $sets = party_get_data_set_info();
  $options = array();
  foreach ($sets as $set_name => $set) {
    if ($set['entity type'] == $this->definition['entity_type']) {

      // @todo: sort these nicely in some way?
      $options[$set_name] = $set['label'];
    }
  }

  // Output the form element.
  $form['data_set'] = array(
    '#type' => 'select',
    '#title' => t('Data set'),
    '#options' => $options,
    '#default_value' => $this->options['data_set'],
    '#description' => t('Optionally filter by a specific data set.'),
    '#required' => FALSE,
  );
}