Advertisement
Itangalo

How to make your actions known to Rules

Sep 17th, 2011
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. /**
  2.  * Implements hook_rules_action_info(). See http://drupal.org/node/878928 for more info.
  3.  */
  4. function my_rules_action_info() {
  5.   return array(
  6.     'my_callback' => array(
  7.       'label' => t('My custom function'),
  8.       'group' => t('My action collection'),
  9.  
  10.       'parameter' => array(
  11.         'account' => array(
  12.           'type' => 'user',
  13.           'label' => t('Recipient'),
  14.         ),
  15.         'message' => array(
  16.           'type' => 'text',
  17.           'label' => t('Message'),
  18.         ),
  19.       ),
  20.  
  21.     ),
  22.   );
  23. }
  24.  
  25. /**
  26.  * My action function
  27.  */
  28. function my_callback($account, $message) {
  29.   // Stuff goes here
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement