function entityform_anonymous_form_entityform_edit_form_alter in Entityform 7.2
Implements hook_form_BASE_FORM_ID_alter().
Form id entityform_edit_form Allow access to draft button if form allows anonymous submissions @todo Should this "allow anonymous" drafts be a setting?
File
- entityform_anonymous/
entityform_anonymous.module, line 224 - Main functions and hook implementations
Code
function entityform_anonymous_form_entityform_edit_form_alter(&$form, &$form_state, $form_id) {
if (user_is_anonymous()) {
if (!isset($form['review'])) {
$entityform_type = entityform_type_load($form['#bundle']);
// Make sure for is draftable and not in Review mode
if (!empty($entityform_type->data['anonymous_links']) && $entityform_type->data['draftable']) {
$form['actions']['save']['#access'] = TRUE;
}
}
}
}