You are here

function command_buttons_entity_edit_form_submit in Command Buttons 7

Submit callback for the button entity.

File

./command_buttons.module, line 573

Code

function command_buttons_entity_edit_form_submit($form, &$form_state) {
  $entity = $form_state['entity'];

  // Copy hardcoded fields.
  $entity->title = $form_state['values']['title'];
  $entity->name = $form_state['values']['name'];
  field_attach_submit('command_button', $entity, $form, $form_state);
  command_buttons_save($entity);
  $form_state['redirect'] = 'admin/structure/command-buttons/view/' . $entity->bid;
  if (!empty($form_state['add submit'])) {
    drupal_set_message(t('The entity has been saved.'));
  }
}