The actions module allows the configuration of Drupal actions. A Drupal action is a specially written PHP function whose parameters are configured through the web. For example, the Send Email action has parameters Recipient, Subject, and Message. You could fill in firstname.lastname@example.org for the recipient, Hi for the subject, and Hello, Joe for the message to create an instance of the Send Email action. This action instance could then be fired by a module at appropriate times when you want Joe to get an email. For example, every time Joe's underling edits a node.
The proper place for actions code is in the module that uses the action. In other words, modules "expose" actions. After the module that exposes the action is enabled, the actions will show up at Administer - Site configuration - Actions.
Two Types of Actions
There are "Drupal-6-compatible actions" and "old-style" actions. The two are not compatible.
Actions 5.x-2.x is a backport of Drupal 6 core actions and triggers and is recommended for use with Drupal 5, should you be unable for some reason to upgrade to Drupal 6 and use its core implementation. The workflow module version 5.x-2.x is an example of a module that uses Drupal-6-style actions.
See the handbook page on Drupal 6.x actions for more information about Drupal 6 actions.
The syntax for actions used by the Drupal 5.x-1.x and 4.7 actions module are different than Drupal 6 actions. The workflow module version 5.x-1.2 and before is an example of a module that uses old-style Drupal actions. These old-style actions, where everything is done in one function with case statements, are a relic of the past. Some old-style actions not associated with a module are available here.
It is easy to port old-style actions to Drupal-6-style actions. A simple example is here.
The actions 5.x-1.2 module with the old-style actions is deprecated. It is available for download below but all further development will take place in the 5.x-2.x branch (which corresponds to the code in core in Drupal 6 and higher).
Actions in Contexts
The 5.x-2.x version of actions introduces something from Drupal 6: context-specific actions. By default, actions are restricted to certain contexts. Savvy site administrators may find this too limiting. To be able to assign any action to any context (as you could in 5.x-1.x), use the triggerunlock module.
- Maintenance status: Unknown
- Development status: Unknown
- Reported installs: 190 sites currently report using this module. View usage statistics.
- Downloads: 11,230
- Last modified: December 2, 2014