You are here

function calendar_plugin_display_page::options_submit in Calendar 7

Same name and namespace in other branches
  1. 6.2 includes/calendar_plugin_display_page.inc \calendar_plugin_display_page::options_submit()
  2. 7.2 includes/calendar_plugin_display_page.inc \calendar_plugin_display_page::options_submit()

Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.

Overrides views_plugin_display_page::options_submit

File

includes/calendar_plugin_display_page.inc, line 278
Views page plugin for the Calendar module.

Class

calendar_plugin_display_page
The plugin that handles a full calendar page.

Code

function options_submit(&$form, &$form_state) {

  // It is very important to call the parent function here:
  parent::options_submit($form, $form_state);
  switch ($form_state['section']) {
    case 'calendar_popup':
      $this
        ->set_option($form_state['section'], $form_state['values'][$form_state['section']]['popup']);
      break;
    case 'calendar_colors':
    case 'calendar_colors_taxonomy':
    case 'calendar_colors_group':
      $this
        ->set_option($form_state['section'], $form_state['values'][$form_state['section']]['color']);
      break;
    case 'calendar_colors_vocabulary':
      $this
        ->set_option($form_state['section'], array_filter($form_state['values'][$form_state['section']]));
      break;
    case 'calendar_date_link':
      $this
        ->set_option($form_state['section'], $form_state['values'][$form_state['section']]);
      variable_set('calendar_date_link_' . $form_state['values']['calendar_date_link'], $this->display->handler
        ->get_option('path'));
      break;
  }
}