You are here

function activity_message_test_submit in Activity 7

Submit handler for the test button.

1 string reference to 'activity_message_test_submit'
activity_configure_handler_form in ./activity.admin.inc
Form builder for the Handler configuration.

File

./activity.admin.inc, line 169
activity.admin.inc Contains administrative forms for activity.module

Code

function activity_message_test_submit($form, &$form_state) {
  $form_state['messages'] = array(
    'en' => array(
      0 => 'Failed Validation',
    ),
  );
  $handler = activity_handler_load($form['#actions_id']);
  $handler->options = $form_state['values']['options'];
  $handler->templates = $form_state['values']['messages'];
  $objects = $handler
    ->loadObjects($form_state['values']['test']['eid']);
  drupal_alter('activity_objects', $objects, $handler->type);
  if ($handler
    ->valid($form_state['values']['test']['eid'], $handler
    ->determineActor($objects), REQUEST_TIME, $objects, $form_state['values']['test']['additional_arguments']['argument1'], $form_state['values']['test']['additional_arguments']['argument2'])) {
    $form_state['messages'] = $handler
      ->tokenize($objects);
  }
  $form_state['rebuild'] = TRUE;
}