function fp_recalculate_alert_count_by_type

6.x misc.inc fp_recalculate_alert_count_by_type($account = NULL)

Invokes a hook to get numbers on the total, read, and unread values from our modules, to find out if we need to place a badge on the bell icon at the top of the screen.

3 calls to fp_recalculate_alert_count_by_type()
content_content_save in modules/content/content.module
Implements hook_content_save. We will save the content object to the database.
content_set_last_access in modules/content/content.module
Sets the content_last_access timestamp for this user and content. Should be called whenever a "content" node is viewed by the user.
fp_get_alert_count_by_type in includes/misc.inc
Returns back the total, read, and unread numbers previously calculated to see if we need to place a badge next to the bell icon at the top of the screen. If unset, we will call the recalculate function.

File

includes/misc.inc, line 2352
This file contains misc functions for FlightPath

Code

function fp_recalculate_alert_count_by_type($account = NULL) {
  global $user;
  if ($account === NULL) {
    $account = $user;
  }

  if ($account->id == 0) {
    return FALSE;
  }


  $res = invoke_hook("get_alert_count_by_type", array($account));
  $_SESSION ['fp_alert_count_by_type'] = $res;
  $_SESSION ['fp_alert_count_by_type_last_check'] = time();
}