You are here

function entityform_draft_page in Entityform 7

Same name and namespace in other branches
  1. 7.2 entityform.module \entityform_draft_page()
1 string reference to 'entityform_draft_page'
EntityformUIController::hook_menu in ./entityform.admin.inc
Overrides hook_menu() defaults. Main reason for doing this is that parent class hook_menu() is optimized for entity type administration.

File

./entityform.module, line 714
Module for the Entityform Entity - a starting point to create your own Entity and associated administration interface

Code

function entityform_draft_page($entityform_type) {
  $args = func_get_args();
  array_shift($args);
  if (empty($entityform_type->data['draft_save_text'])) {
    $draft_text = t('Your submission for the form, @form_name, has been saved.', array(
      '@form_name' => $entityform_type->label,
    ));
  }
  else {
    $draft_text = $entityform_type->data['draft_save_text'];
  }
  $render_array = array(
    'submit_text' => array(
      '#type' => 'markup',
      '#prefix' => '<div class="draft-text">',
      '#markup' => _entityform_format_text($draft_text, array(
        'entityform_type' => $entityform_type,
      )),
      '#suffix' => '</div>',
    ),
  );
  drupal_alter(array(
    'entityform_draft_page',
    "entityform_{$entityform_type->type}_draft_page",
  ), $render_array, $entityform_type, $args);
  return $render_array;
}