You are here

public function EntityformUIController::confirm_path in Entityform 7.2

Same name and namespace in other branches
  1. 7 entityform.admin.inc \EntityformUIController::confirm_path()

File

./entityform.admin.inc, line 152
Entityform editing UI.

Class

EntityformUIController
UI controller.

Code

public function confirm_path($bundle, $entityform_id = NULL) {
  module_load_include('inc', 'entityform', 'entityform_type.admin');
  $entityform_type = entityform_type_load($bundle);
  if (!empty($entityform_id)) {
    $redirect_path = $entityform_type
      ->get_path_property('redirect_path', entityform_load($entityform_id));
  }
  else {
    $redirect_path = $entityform_type
      ->get_path_property('redirect_path');
  }
  if (!empty($redirect_path)) {
    return $redirect_path;
  }
  $path = _entityform_type_get_confirm_url($bundle);
  $path = drupal_get_path_alias($path);
  if ($entityform_id) {
    return array(
      $path,
      array(
        'query' => array(
          'entityform_id' => $entityform_id,
        ),
      ),
    );
  }
  return array(
    $path,
  );
}