system_message_action

Versions
mediamosa-21
system_message_action(&$entity, $context = array())

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

Code

modules/system/system.module, line 2999

<?php
function system_message_action(&$entity, $context = array()) {
  if (empty($context['node'])) {
    $context['node'] = $entity;
  }

  $context['message'] = token_replace($context['message'], $context);
  drupal_set_message($context['message']);
}
?>