You are here

function pollim_edit_form_submit in Poll Improved 7

Form API submit callback for the pollim form.

@todo remove hard-coded link

1 string reference to 'pollim_edit_form_submit'
pollim_edit_form in ./pollim.admin.inc
Form callback: create or edit a pollim.

File

./pollim.admin.inc, line 236
Pollim editing UI.

Code

function pollim_edit_form_submit(&$form, &$form_state) {
  $pollim = entity_ui_controller('pollim')
    ->entityFormSubmitBuildEntity($form, $form_state);

  // Save the pollim and go back to the list of pollims
  // Add in created and changed times.
  if ($pollim->is_new = isset($pollim->is_new) ? $pollim->is_new : 0) {
    $pollim->created = time();
  }
  $pollim->changed = time();
  $pollim
    ->save();
  $form_state['redirect'] = 'admin/content/pollims';
}