You are here

function message_ui_message_arguments in Message UI 7

Get hard coded arguments.

Parameters

$type: The message type.

$count: Determine weather to the count the arguments or return a list of them.

Return value

int The number of the arguments.

1 call to message_ui_message_arguments()
message_ui_entity_update in ./message_ui.module
Implements hook_entity_update().

File

./message_ui.module, line 365
Main file for the message UI module.

Code

function message_ui_message_arguments($type, $count = FALSE) {
  $message_type = message_type_load($type);
  if (!($output = $message_type
    ->getText())) {
    return;
  }
  preg_match_all('/[@|%|\\!]\\{([a-z0-9:_\\-]+?)\\}/i', $output, $matches);
  return $count ? count($matches[0]) : $matches[0];
}