You are here

function views_autorefresh_rules_action_info in Views Auto-Refresh 7

Same name and namespace in other branches
  1. 7.2 views_autorefresh.rules.inc \views_autorefresh_rules_action_info()

Implements hook_rules_action_info().

File

./views_autorefresh.rules.inc, line 11
Rules integration for the views_autorefresh module.

Code

function views_autorefresh_rules_action_info() {
  $items = array();
  if (module_exists('nodejs')) {
    $items['views_autorefresh'] = array(
      'label' => t('Autorefresh a View through Node.js'),
      'group' => t('Views Autorefresh'),
      'parameter' => array(
        'views' => array(
          'type' => 'list<integer>',
          'label' => t('Views'),
          'description' => t('Select one or more views that should refreshed.'),
          'options list' => 'views_autorefresh_get_nodejs_views',
        ),
        'context' => array(
          'type' => '*',
          'label' => t('Context'),
          'description' => t('Additional data that can be passed to the message hook (optional).'),
          'optional' => TRUE,
        ),
      ),
      'base' => 'views_autorefresh_rules_process',
    );
  }
  return $items;
}