You are here

function heartbeat_messages in Heartbeat 6.3

Same name and namespace in other branches
  1. 6.4 heartbeat.module \heartbeat_messages()
  2. 6.2 heartbeat.module \heartbeat_messages()

get all messages with static cache variable and reset possibility

Parameters

string $module:

boolean $reset:

boolean $objects:

Return value

array messages

7 calls to heartbeat_messages()
heartbeat_gather_messages in ./heartbeat.module
Function that gathers all messages from all modules New ones and existing ones
heartbeat_get_messages in ./heartbeat.module
Get heartbeat messages of the the given
heartbeat_messages_export in ./heartbeat.admin.inc
Function to export messages to use as default
heartbeat_messages_export_messages in ./heartbeat.admin.inc
Function to export messages to use as default
heartbeat_messages_overview in ./heartbeat.admin.inc
Overview list of heartbeat messages This page must be viewed to make the messages appear in the database after a module is installed as well as make them translatable

... See full list

2 string references to 'heartbeat_messages'
heartbeat_views_data in views/heartbeat_views.views.inc
Implementation of views hook hook_views_data()
views_plugin_row_heartbeat_view::init in views/plugins/views_plugin_row_heartbeat_view.inc

File

./heartbeat.module, line 762

Code

function heartbeat_messages($module = 'all', $reset = false, $objects = true) {
  static $messages;
  if (empty($messages) || $reset == true) {
    $messages = array();
    if ($module == 'all') {
      $result = db_query("SELECT * FROM {heartbeat_messages} ORDER BY module, description ");
    }
    else {
      $result = db_query("SELECT * FROM {heartbeat_messages} WHERE module = '%s' ", $module);
    }
    while ($row = db_fetch_array($result)) {
      if ($objects) {
        $messages[] = new HeartbeatActivity($row);
      }
      else {
        $messages[] = $row;
      }
    }
  }
  return $messages;
}