You are here

function closeblock_submit in Close Block 7

Same name and namespace in other branches
  1. 6 includes/closeblock.form.inc \closeblock_submit()

Form submission handler for block_admin_configure().

See also

block_admin_configure()

closeblock_form_alter()

1 string reference to 'closeblock_submit'
closeblock_block_admin_configure in includes/closeblock.form.inc
Add Closeblock settings to block settings form.

File

includes/closeblock.form.inc, line 172
Closeblock settings form functions.

Code

function closeblock_submit($form, &$form_state) {
  $settings = variable_get('closeblock_settings', array());
  $params = array(
    'module' => $form_state['values']['module'],
    'delta' => $form_state['values']['delta'],
  );
  $block_id = theme('closeblock_block_id', $params);
  $default_settings = closeblock_default_settings();
  foreach ($default_settings as $key => &$value) {
    if (isset($form_state['values'][$key])) {
      $value = $form_state['values'][$key];
    }
  }
  $settings[$block_id] = $default_settings;
  $settings[$block_id]['module'] = $form_state['values']['module'];
  $settings[$block_id]['delta'] = $form_state['values']['delta'];
  variable_set('closeblock_settings', $settings);
}