You are here

function farm_asset_form_submit in farmOS 7

Asset submit handler.

Parameters

array $form: The form array.

array $form_state: The form state array.

1 string reference to 'farm_asset_form_submit'
farm_asset_form in modules/farm/farm_asset/farm_asset.pages.inc
Asset form.

File

modules/farm/farm_asset/farm_asset.pages.inc, line 205
Farm asset pages.

Code

function farm_asset_form_submit(array $form, array &$form_state) {
  $farm_asset = $form_state['values']['farm_asset'];
  entity_form_submit_build_entity('farm_asset', $farm_asset, $form, $form_state);
  farm_asset_save($farm_asset);
  $farm_asset_uri = entity_uri('farm_asset', $farm_asset);
  $form_state['redirect'] = $farm_asset_uri['path'];
  drupal_set_message(t('Asset saved: <a href="@uri">%title</a>', array(
    '@uri' => url($farm_asset_uri['path']),
    '%title' => entity_label('farm_asset', $farm_asset),
  )));
}