1 block.overview_content.inc DashboardOverviewContentBlock::formSubmit($form, &$form_state)

Submit handler to save the form settings.

Overrides Block::formSubmit

File

core/modules/dashboard/includes/block.overview_content.inc, line 179
Dashboard block displaying information about content, including:

Class

DashboardOverviewContentBlock
@file Dashboard block displaying information about content, including:

Code

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

  $this->settings['types'] = array_keys(array_filter($form_state['values']['types']));
  $this->settings['comment_enabled'] = (bool) $form_state['values']['comment_enabled'];
  $this->settings['comment_include_unapproved'] = (bool) $form_state['values']['comment_include_unapproved'];
  $this->settings['comment_types'] = array_keys(array_filter($form_state['values']['comment_types']));

  // If all options are selected, save an empty array.
  $type_count = count($form['types']['#options']);
  if ($type_count == count($this->settings['types'])) {
    $this->settings['types'] = array();
  }
  if ($type_count == count($this->settings['comment_types'])) {
    $this->settings['comment_types'] = array();
  }
}