You are here

function activity_invoke_activityapi in Activity 5.3

Same name and namespace in other branches
  1. 5.4 activity.module \activity_invoke_activityapi()
  2. 6 activity.module \activity_invoke_activityapi()

Invoke a hook_activityapi() operation in all modules.

Parameters

&$activity: An activity array.

$op: A string containing the name of the nodeapi operation. 'insert' is called when a new activity is created 'load' is called when an activity is loaded 'render' is called before token replacement begins

Return value

The returned value of the invoked hooks.

3 calls to activity_invoke_activityapi()
activity_get_activity in ./activity.module
The API supports:
activity_insert in ./activity.module
API function Insert an activity record. This gets called by modules wishing to record their activities.
activity_token_replace in ./activity.module
determine what the message should say

File

./activity.module, line 361
Activity module: Allow users to see their friends' activity on the site.

Code

function activity_invoke_activityapi(&$activity, $op) {
  $return = array();
  foreach (module_implements('activityapi') as $name) {
    $function = $name . '_activityapi';
    $result = $function($activity, $op);
    if (isset($result) && is_array($result)) {
      $return = array_merge($return, $result);
    }
    else {
      if (isset($result)) {
        $return[] = $result;
      }
    }
  }
  return $return;
}