You are here

twitter_actions.rules.inc in Twitter 6.4

Provide better intergration into the rules module

File

twitter_actions/twitter_actions.rules.inc
View source
<?php

/**
 * @file
 * Provide better intergration into the rules module
 */

/**
 * Implementation of hook_rules_action_info_alter().
 *
 * Actions of type system are not supported, so rules won't make use of it automatically. So
 * we have to provide some information about it to make it work.
 */
function twitter_actions_rules_action_info_alter(&$actions) {
  $actions['rules_core_twitter_actions_set_status_action'] = array(
    'label' => t('Post a message to Twitter'),
    // Make sure there is something passed for $object.
    'arguments' => array(
      'object' => array(
        'type' => 'node',
        'default value' => NULL,
      ),
    ),
    'module' => 'Twitter',
    'eval input' => array(
      'screen_name',
      'password',
      'message',
    ),
    // Let the rules system for executing core style actions execute it.
    'base' => 'rules_core_action_execute',
    'action_name' => 'twitter_actions_set_status_action',
    'configurable' => TRUE,
  );
}