You are here

function references_dialog_plugin_display::options_form in References dialog 7

Provide the default form for setting options.

Overrides views_plugin_display::options_form

File

views/references_dialog_plugin_display.inc, line 57
Contains the default display plugin.

Class

references_dialog_plugin_display
A plugin to handle defaults on a view.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  if ($form_state['section'] == 'attach') {

    // Find the entity that matches our base table.
    $entities = entity_get_info();
    foreach ($entities as $entity_type => $entity_info) {
      if ($entity_info['base table'] == $this->view->base_table) {
        break;
      }
    }
    $attachables = references_dialog_get_search_view_attachables($entity_type);
    $options = array();
    foreach ($attachables as $name => $attachable) {
      $options[$name] = $attachable['label'];
    }
    $form['attach'] = array(
      '#type' => 'checkboxes',
      '#options' => $options,
      '#default_value' => $this
        ->get_option('attach'),
      '#title' => t('Attach to'),
      '#description' => t('Choose what to attach this view to.'),
    );
  }
}