You are here

function sms_actions_action_info_alter in SMS Framework 6

Same name and namespace in other branches
  1. 6.2 modules/sms_actions/sms_actions.module \sms_actions_action_info_alter()
  2. 7 modules/sms_actions/sms_actions.module \sms_actions_action_info_alter()

File

modules/sms_actions/sms_actions.module, line 243
Provides a "Send SMS" action and the ability to define custom triggers for incoming messages.

Code

function sms_actions_action_info_alter(&$actions) {

  // Actions to alter
  $hooks = array(
    'node_publish_action',
    'node_unpublish_action',
    'node_make_sticky_action',
    'node_make_unsticky_action',
    'node_promote_action',
    'node_unpromote_action',
    'node_assign_owner_action',
    'node_save_action',
    'node_unpublish_by_keyword_action',
    'system_send_email_action',
  );
  $commands = sms_actions_get_commands();
  $command_triggers[] = 'sms_actions';
  foreach ($commands as $command) {
    $command_triggers[] = 'sms_actions_' . $command->discriminator;
  }
  foreach ($actions as $hook => $action) {
    if (in_array($hook, $hooks)) {
      $actions[$hook]['hooks']['sms_actions'] = $command_triggers;
    }
  }
}