1 block.text.inc BlockText::formSubmit($form, &$form_state)

Submit handler to save the form settings.

Overrides Block::formSubmit

File

core/modules/layout/includes/block.text.inc, line 148

Class

BlockText
BlockText extends Block

Code

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

  if (module_exists('block') && $form_state['values']['reusable']) {
    $delta = $form_state['values']['delta'];
    $this->settings = array_diff_key($this->settings, array('title' => '', 'content' => '', 'format' => ''));
    $this->plugin = 'block:' . $delta;

    $edit = array(
      'info' => $form_state['values']['label'],
      'title' => $form_state['values']['title'],
      'description' => $form_state['values']['description'],
      'body' => $form_state['values']['content'],
    );
    block_custom_block_save($edit, $delta);
  }
  else {
    $this->settings['title'] = $form_state['values']['title'];
    $this->settings['content'] = $form_state['values']['content']['value'];
    $this->settings['format'] = $form_state['values']['content']['format'];
  }
}