You are here

function quickedit_field_node_author_edit_form_submit in Quick Edit 7

Form submission handler for quickedit_field_node_author_edit_form().

See also

node_submit()

quickedit_field_node_author_edit_form()

quickedit_field_node_author_edit_form_validate()

1 string reference to 'quickedit_field_node_author_edit_form_submit'
quickedit_field_node_author_edit_form in includes/node.inc
Form constructor; in-place editing form for node's 'author' "extra field".

File

includes/node.inc, line 95
Implements Quick Edit module hooks on behalf of node.module.

Code

function quickedit_field_node_author_edit_form_submit($form, &$form_state) {
  $entity = $form_state['entity'];
  if ($account = user_load_by_name($form_state['values']['name'])) {
    $entity->uid = $account->uid;
    $entity->name = $account->name;
  }
  else {
    $entity->uid = 0;
  }

  // We must load fape.inc to use _quickedit_entity_set_log().
  module_load_include('inc', 'quickedit', 'includes/fape');
  _quickedit_entity_set_log($entity, t('Author'));
  _quickedit_entity_save_to_tempstore($form_state['entity_type'], $form_state['entity_id'], $entity);
}