1 node.block.inc NodeBlock::formSubmit($form, &$form_state)

Submit handler to save the form settings.

Overrides Block::formSubmit

File

core/modules/node/node.block.inc, line 218
A class that displays a particular node in a block.

Class

NodeBlock
@file A class that displays a particular node in a block.

Code

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

  // Clean up after form states.
  if ($form_state['values']['title_display'] == LAYOUT_TITLE_DEFAULT) {
    $form_state['values']['leave_node_title'] = FALSE;
  }
  elseif ($form_state['values']['title_display'] == LAYOUT_TITLE_NONE) {
    $form_state['values']['link_node_title'] = FALSE;
  }

  $this->settings['nid'] = (int) $form_state['values']['nid'];
  $this->settings['links'] = (bool) $form_state['values']['links'];
  $this->settings['leave_node_title'] = (bool) $form_state['values']['leave_node_title'];
  $this->settings['link_node_title'] = (bool) $form_state['values']['link_node_title'];
  $this->settings['display_submitted'] = (bool) $form_state['values']['display_submitted'];
  $this->settings['view_mode'] = (string) $form_state['values']['view_mode'];
  if (module_exists('translation')) {
    $this->settings['translate'] = (bool) $form_state['values']['translate'];
  }
}