You are here

public function Block::submitOptionsForm in Views (for Drupal 7) 8.3

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

Overrides DisplayPluginBase::submitOptionsForm

File

lib/Views/block/Plugin/views/display/Block.php, line 191
Definition of Drupal\views\Plugin\views\display\Block. Definition of Views\block\Plugin\views\display\Block.

Class

Block
The plugin that handles a block.

Namespace

Views\block\Plugin\views\display

Code

public function submitOptionsForm(&$form, &$form_state) {

  // It is very important to call the parent function here:
  parent::submitOptionsForm($form, $form_state);
  switch ($form_state['section']) {
    case 'display_id':
      $this
        ->updateBlockBid($form_state['view']->storage->name, $this->display['id'], $this->display['new_id']);
      break;
    case 'block_description':
      $this
        ->setOption('block_description', $form_state['values']['block_description']);
      break;
    case 'block_caching':
      $this
        ->setOption('block_caching', $form_state['values']['block_caching']);
      $this
        ->saveBlockCache($form_state['view']->storage->name . '-' . $form_state['display_id'], $form_state['values']['block_caching']);
      break;
  }
}