You are here

function commerce_license_checkout_competion_message in Commerce License 7

Returns the license checkout completion message.

Parameters

$license: The license entity.

$refresh: Whether the checkout completion message should be refreshed via AJAX in set intervals.

Return value

A string containing the success text.

2 calls to commerce_license_checkout_competion_message()
commerce_license_complete_checkout_ajax_callback in includes/commerce_license.checkout_pane.inc
Ajax callback for the license completion message checkout pane.
commerce_license_complete_checkout_form in includes/commerce_license.checkout_pane.inc
Checkout pane callback: License completion message.

File

includes/commerce_license.checkout_pane.inc, line 172
Checkout pane callbacks.

Code

function commerce_license_checkout_competion_message($license, $refresh = FALSE) {
  $element = array(
    '#type' => 'container',
    '#attributes' => array(
      'id' => 'commerce-license-checkout-pane-' . $license->license_id,
      'class' => array(
        'commerce-license-checkout',
      ),
    ),
    'output' => array(
      '#markup' => $license
        ->checkoutCompletionMessage(),
    ),
  );

  // Add data attributes for the refresh process.
  if ($refresh) {
    $element['#attributes'] += array(
      'data-refresh-url' => url('ajax/commerce_license/' . $license->license_id, array(
        'absolute' => TRUE,
      )),
      'data-refresh-rate' => variable_get('commerce_license_refresh_rate', 2),
    );
  }
  return drupal_render($element);
}