You are here

function ca_action_drupal_set_message in Ubercart 6.2

Display a message to the user.

See also

ca_action_drupal_set_message_form()

1 string reference to 'ca_action_drupal_set_message'
ca_ca_action in ca/ca.ca.inc
Implements hook_ca_action().

File

ca/ca.ca.inc, line 321
This file includes some generic conditions and actions.

Code

function ca_action_drupal_set_message($settings) {

  // Filter the text using the default format.
  $message = check_markup($settings['message_text'], FILTER_FORMAT_DEFAULT, FALSE);

  // Return if there's nothing to display.
  if (empty($message) || empty($settings['message_text'])) {
    return;
  }

  // Make sure we have a valid message type.
  if ($settings['message_type'] == 'error') {
    $type = $settings['message_type'];
  }
  else {
    $type = 'status';
  }

  // Output the message using the Drupal message API.
  drupal_set_message($message, $type);
}