You are here

function entityform_confirm_page in Entityform 7.2

Same name and namespace in other branches
  1. 7 entityform.module \entityform_confirm_page()

Page callback

1 string reference to 'entityform_confirm_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 750
Module for the Entityform Entity - a starting point to create your own Entity and associated administration interface

Code

function entityform_confirm_page($entityform_type) {
  $entityform_id = isset($_GET['entityform_id']) ? $_GET['entityform_id'] : NULL;
  if (empty($entityform_id)) {
    return array();
  }
  $entityform = entityform_load($entityform_id);
  $render_array = array(
    'submit_text' => array(
      '#type' => 'markup',
      '#prefix' => '<div class="submission-text">',
      '#markup' => $entityform_type
        ->get_prop('submission_text', $entityform),
      '#suffix' => '</div>',
    ),
  );
  if ($entityform_type->data['submission_show_submitted']) {
    if (empty($entityform)) {

      //entityform_id in url was alter return page not found
      return MENU_NOT_FOUND;
    }
    $controller = entity_get_controller('entityform');
    $content = $controller
      ->view(array(
      $entityform->entityform_id => $entityform,
    ), 'confirmation', NULL, TRUE);
    $render_array['submission_data'] = $content;
  }
  drupal_alter(array(
    'entityform_confirm_page',
    "entityform_{$entityform_type->type}_confirm_page",
  ), $render_array, $entityform_type, $entityform_id);
  return $render_array;
}