| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file: This files includes some test conditions and actions.
|
| 6 |
*/
|
| 7 |
|
| 8 |
// Display a message to the user.
|
| 9 |
function ca_action_drupal_set_message($settings) {
|
| 10 |
// Get the specified input format or use the default.
|
| 11 |
/*if (!empty($settings['message_format'])) {
|
| 12 |
$format = $settings['message_format'];
|
| 13 |
}
|
| 14 |
else {
|
| 15 |
$format = FILTER_FORMAT_DEFAULT;
|
| 16 |
}*/
|
| 17 |
|
| 18 |
// Filter the text using the format.
|
| 19 |
// $message = check_markup($settings['message_text'], $format, FALSE);
|
| 20 |
$message = check_plain($settings['message_text']);
|
| 21 |
|
| 22 |
// Return if there's nothing to display.
|
| 23 |
if (empty($message)) {
|
| 24 |
return;
|
| 25 |
}
|
| 26 |
|
| 27 |
// Make sure we have a valid message type.
|
| 28 |
if ($settings['message_type'] == 'error') {
|
| 29 |
$type = $settings['message_type'];
|
| 30 |
}
|
| 31 |
else {
|
| 32 |
$type = 'status';
|
| 33 |
}
|
| 34 |
|
| 35 |
// Output the message using the Drupal message API.
|
| 36 |
drupal_set_message($message, $type);
|
| 37 |
}
|
| 38 |
|