You are here

function icon_block_form_submit in Icon API 7

Same name and namespace in other branches
  1. 8 modules/icon_block/icon_block.module \icon_block_form_submit()

Save supplied class.

1 string reference to 'icon_block_form_submit'
icon_block_form_alter in modules/icon_block/icon_block.module
Implements hook_form_alter().

File

modules/icon_block/icon_block.module, line 135
icon_block.module Provides icon integration with blocks.

Code

function icon_block_form_submit($form, &$form_state) {
  if ($form_state['values']['form_id'] == 'block_admin_configure' || $form_state['values']['form_id'] == 'block_add_block_form') {
    $module = $form_state['values']['module'];
    $delta = $form_state['values']['delta'];

    // Update block icon settings.
    if (isset($form_state['values']['icon_selector'])) {
      db_merge('block')
        ->key(array(
        'module' => $module,
        'delta' => $delta,
      ))
        ->fields(array(
        'icon' => serialize($form_state['values']['icon_selector']),
      ))
        ->execute();
    }
  }
}