You are here

function fusion_apply_index_handler in Fusion Accelerator 7.2

Same name and namespace in other branches
  1. 7 fusion_apply/fusion_apply.handlers.inc \fusion_apply_index_handler()

Fusion Apply form index handler.

Parameters

$op: What kind of action is being performed. Possible values:

  • form: The form elements being inserted in a form.
  • submit: The form has been submitted.

&$form:

  • For 'form', passes in the $form parameter from hook_form_alter().
  • For 'submit', passes in the $form parameter from hook_form_submit().

$form_state:

  • For 'form', passes in the $form_state parameter from hook_form_alter().
  • For 'submit', passes in the $form_state parameter from hook_form_submit().

Return value

The index where we can find our values in Fusion Apply's data structure.

1 string reference to 'fusion_apply_index_handler'
fusion_apply_config_info_default in fusion_apply/fusion_apply.module
Prepare default configuration data for modules.

File

fusion_apply/fusion_apply.handlers.inc, line 49
Defines the various default handler functions to support Fusion Apply.

Code

function fusion_apply_index_handler($op, &$form, $form_state) {
  switch ($op) {
    case 'form':
      if (empty($form['fusion_apply']['element']['#value'])) {
        trigger_error(sprintf("The form with form_id '%' is not a valid Fusion form.", $form['form_id']['#value']), E_USER_ERROR);
        return FALSE;
      }
      return $form['fusion_apply']['element']['#value'];
    case 'submit':
      if (empty($form_state['values']['element'])) {
        trigger_error(sprintf("The form with form_id '%' is not a valid Fusion form.", $form['form_id']['#value']), E_USER_ERROR);
        return FALSE;
      }
      return $form_state['values']['element'];
  }
}