You are here

function message_action_assign_message_instance_to_realm_form in Message 6

Action: Assign a message instance to realm configuration form.

File

includes/message.rules_forms.inc, line 114
Rules configuration forms for the taxonomy module.

Code

function message_action_assign_message_instance_to_realm_form($settings, &$form, $form_state) {

  // Get existing realms.
  $options = message_get_realm_types();

  // Initalize values.
  $settings += array(
    'realm' => '',
    'realm_id' => '',
  );

  // We ask the user to choose the realm, but we actually save the plugin name.
  $form['settings']['plugin_name'] = array(
    '#type' => 'select',
    '#title' => t('Realm'),
    '#default_value' => $settings['plugin_name'],
    '#options' => $options,
    '#disabled' => !$options,
    '#required' => TRUE,
  );
  $form['settings']['realm_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Realm ID'),
    '#default_value' => $settings['realm_id'],
    '#required' => TRUE,
  );
}