Same name and namespace in other branches
  1. 6.x modules/system/system.module \system_message_action()

Sends a message to the current user's screen.

Parameters

object $entity: An optional node object, which will be added as $context['node'] if provided.

array $context: Array with the following elements:

  • 'message': The message to send. This will be passed through token_replace().
  • Other elements will be used as the data for token replacement in the message.

Related topics

3 string references to 'system_message_action'
system_action_info in modules/system/system.module
Implements hook_action_info().
TriggerActionTestCase::assignSystemMessageAction in modules/trigger/trigger.test
Assigns a system message action to the passed-in trigger.
TriggerOtherTestCase::testActionsUser in modules/trigger/trigger.test
Tests triggering on user create and user login.

File

modules/system/system.module, line 3346
Configuration system that lets administrators modify the workings of the site.

Code

function system_message_action(&$entity, $context = array()) {
  if (empty($context['node'])) {
    $context['node'] = $entity;
  }
  $context['message'] = token_replace(filter_xss_admin($context['message']), $context);
  drupal_set_message($context['message']);
}