You are here

function calendar_plugin_style_ical::options_form in Calendar 7

Same name and namespace in other branches
  1. 6.2 calendar_ical/calendar_plugin_style_ical.inc \calendar_plugin_style_ical::options_form()
  2. 7.2 calendar_ical/calendar_plugin_style_ical.inc \calendar_plugin_style_ical::options_form()

Provide a form to edit options for this plugin.

Overrides views_plugin_style_rss::options_form

File

calendar_ical/calendar_plugin_style_ical.inc, line 69
Views style plugin for the Calendar iCal module.

Class

calendar_plugin_style_ical
Default style plugin to render an iCal feed.

Code

function options_form(&$form, &$form_state) {
  $options = array(
    '' => '',
  );
  foreach ($this->options['fields'] as $field) {
    $handler = views_get_handler($field['table'], $field['field'], 'field');
    $options[$field['field']] = $handler
      ->ui_name();
  }
  $form['#prefix'] = '<div class="form-item">' . t("Map the View fields to the values they should represent in the iCal feed. Only fields that have been added to the view are available to use in this way. You can add additional fields to the view and mark them 'Exclude from display' if you only want them in the iCal feed.") . '</div>';
  $form['summary_field'] = array(
    '#type' => 'select',
    '#title' => t('Title'),
    '#default_value' => !empty($this->options['summary_field']) ? $this->options['summary_field'] : 'title',
    '#options' => $options,
    '#required' => TRUE,
  );
  $form['description_field'] = array(
    '#type' => 'select',
    '#title' => t('Description'),
    '#default_value' => $this->options['description_field'],
    '#options' => $options,
  );
  $form['location_field'] = array(
    '#type' => 'select',
    '#title' => t('Location'),
    '#default_value' => $this->options['location_field'],
    '#options' => $options,
  );
}