function activity_handler_load in Activity 7
Load an Activity Handler from an aid.
Parameters
$aid: {actions}.aid that holds the configuration information.
6 calls to activity_handler_load()
- activity_handler_batchable_load in ./
activity.module - Load a batchable Activity Handler from an aid.
- activity_message_test_submit in ./
activity.admin.inc - Submit handler for the test button.
- activity_record in ./
activity.module - Action Callback.
- activity_recreate_messages in ./
activity.module - Creates new messages for a set of activity records.
- activity_update_status in ./
activity.module - Update {activity} records status based on a new event.
File
- ./
activity.module, line 156 - Records Activity across the site and surfaces that to Views.
Code
function activity_handler_load($aid) {
$hook = db_query("SELECT hook FROM {trigger_assignments} WHERE aid = :aid", array(
":aid" => $aid,
))
->fetchField();
if (!empty($hook)) {
$action_record = actions_load($aid);
$action_record = drupal_unpack($action_record, 'parameters');
$handler = activity_load_handler($hook);
$handler->templates = $action_record->templates;
$handler->options = $action_record->options;
$handler->actions_id = $action_record->aid;
$handler->label = $action_record->label;
return $handler;
}
return FALSE;
}