function engagements_menu_handle_replacement_pattern

7.x engagements.module engagements_menu_handle_replacement_pattern($str)
6.x engagements.module engagements_menu_handle_replacement_pattern($str)

implements hook_menu_handle_replacement_pattern

File

modules/engagements/engagements.module, line 143
This is the primary module file for the engagements module.

Code

function engagements_menu_handle_replacement_pattern($str) {

  if (strstr($str, "%ENGAGEMENTS_ADVISEE_ALERTS_COUNT%")) {
    // Get our count.
    $alert_counts = fp_get_alert_count_by_type();

    $c = intval($alert_counts ['engagements']['engagement']['unread']);

    $x = "";
    if ($c > 0) {
      $x .= " ($c)";
    }

    $str = str_replace("%ENGAGEMENTS_ADVISEE_ALERTS_COUNT%", $x, $str);
  }

  return $str;
}