You are here

function fe_block_machine_name_submit in Features Extra 6

Same name and namespace in other branches
  1. 7 fe_block/fe_block.module \fe_block_machine_name_submit()

Save machine name.

1 string reference to 'fe_block_machine_name_submit'
fe_block_form_alter in ./fe_block.module
Implementation of hook_form_alter().

File

./fe_block.module, line 386

Code

function fe_block_machine_name_submit($form, &$form_state) {

  // Insert
  if (empty($form_state['values']['bid'])) {
    $form_state['values']['bid'] = db_result(db_query("SELECT bid FROM {boxes} WHERE info = '%s'", $form_state['values']['info']));
  }
  if (empty($form_state['values']['bid'])) {
    return;
  }
  $table = 'fe_block_boxes';
  db_query("DELETE FROM {{$table}} WHERE bid = %d", $form_state['values']['bid']);
  if (!empty($form_state['values']['machine_name'])) {
    drupal_write_record($table, $form_state['values']);
  }
}