You are here

function simplenews_handle_messages in Simplenews 5

File

./simplenews.module, line 916

Code

function simplenews_handle_messages($one, $two_or_more, $type = 'status') {
  if (isset($_SESSION['messages'][$type])) {
    $msg = $_SESSION['messages'][$type];
  }
  else {
    $msg = array();
  }
  $key = array_search($one, $msg);
  if ($key || $key === 0) {
    $_SESSION['messages'][$type][$key] = $two_or_more;
  }
  elseif (!in_array($two_or_more, $msg)) {
    drupal_set_message($one, $type);
  }
}