You are here

protected function Messaging_Template::element_replace in Messaging 7

Perform token replace within an element

File

messaging_template/messaging_template.inc, line 261
Drupal Messaging Framework - Text filtering functions

Class

Messaging_Template
Base template class

Code

protected function element_replace($element, $options = array()) {
  foreach (array(
    '#markup',
    '#title',
    '#children',
    '#plaintext',
  ) as $key) {
    if (!empty($element[$key])) {
      $element[$key] = $this
        ->token_replace($element[$key]);
    }
  }
  foreach (element_children($element) as $key) {
    $element[$key] = $this
      ->element_replace($element[$key], $options);
  }
  return $element;
}