You are here

function user_activity_rules_default_action_form in Heartbeat 6.2

Action drupal message configuration form.

1 call to user_activity_rules_default_action_form()
friendlist_activity_rules_action_form in user_activity/modules/friendlist_activity/friendlist_activity.rules.inc
Action drupal message configuration form.

File

user_activity/user_activity.rules.inc, line 56

Code

function user_activity_rules_default_action_form($settings, &$form) {

  //dsm($settings);
  $settings += array(
    'event_param' => '',
    'uid_param' => '',
    'uid_target_param' => '',
    'nid_target_param' => '',
    'message_param' => '',
    'message_concat_param' => '',
    'variables_param' => '',
  );
  $result = db_query("SELECT event FROM {heartbeat_messages}");
  $options = array();
  while ($row = db_fetch_object($result)) {
    $options[$row->event] = $row->event;
  }
  $form['settings']['event_param'] = array(
    '#type' => 'select',
    '#title' => t('The event'),
    '#options' => $options,
    '#default_value' => $settings['event_param'],
    '#description' => t('The event'),
  );
  $form['settings']['uid_param'] = array(
    '#type' => 'textfield',
    '#size' => '15',
    '#maxsize' => '25',
    '#title' => t('User'),
    '#default_value' => $settings['uid_param'],
    '#description' => t('The user doing the activity'),
  );
  $form['settings']['uid_target_param'] = array(
    '#type' => 'textfield',
    '#size' => '15',
    '#maxsize' => '25',
    '#title' => t('User target'),
    '#default_value' => $settings['uid_target_param'],
    '#description' => t('The user target of the activity'),
  );
  $form['settings']['nid_target_param'] = array(
    '#type' => 'textfield',
    '#size' => '15',
    '#maxsize' => '25',
    '#title' => t('Node target'),
    '#default_value' => $settings['nid_target_param'],
    '#description' => t('The node target of the activity'),
  );
  $form['settings']['message_param'] = array(
    '#type' => 'textarea',
    '#rows' => 1,
    '#title' => t('The message'),
    '#default_value' => $settings['message_param'],
    '#description' => t('The message'),
  );
  $form['settings']['message_concat_param'] = array(
    '#type' => 'textarea',
    '#rows' => 1,
    '#title' => t('The message if it needs to be concatenated in general heartbeat views.'),
    '#default_value' => $settings['message_concat_param'],
    '#description' => t('The message concatenation string'),
  );
  $form['settings']['variables_param'] = array(
    '#type' => 'textarea',
    '#title' => t('The variables area.'),
    '#default_value' => $settings['variables_param'],
    '#description' => t('The variables, leave empty or use with care! <br /> Extra modular stuff goes here with the synthax:<br /><b>var1:value1;var2:value2;va</b> ...'),
  );
}