actions_get_all_actions

Definition

actions_get_all_actions()
includes/actions.inc, line 177

Description

Retrieve all action instances from the database.

Compare with actions_list() which gathers actions by invoking hook_action_info(). The two are synchronized by visiting /admin/build/actions (when actions.module is enabled) which runs actions_synchronize().

Return value

Associative array keyed by action ID. Each value is an associative array with keys 'callback', 'description', 'type' and 'configurable'.

Code

<?php
function actions_get_all_actions() {
  $actions = array();
  $result = db_query("SELECT * FROM {actions}");
  while ($action = db_fetch_object($result)) {
    $actions[$action->aid] = array(
      'callback' => $action->callback,
      'description' => $action->description,
      'type' => $action->type,
      'configurable' => (bool) $action->parameters,
    );
  }
  return $actions;
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.