How can I recognize when the user is editing or inserting something? I have a form which adds some information. I used hook_form() for inserting and loading data. units/add calls the form to insert data and units/%unitid/edit calls the form to edit data. In hook_form_submit(), how can I recognize when the user is editing or inserting something? Should I use $delta, or is it no longer available in Drupal 7?
Field nid is unset if node is created. Optionally, you can check if arg(1) === 'add'