You are here

function workbench_access_default_form_element in Workbench Access 7

Find and alter the native form element for node editing.

FieldAPI makes this much harder than it needs to be.

1 call to workbench_access_default_form_element()
workbench_access_form_alter in ./workbench_access.module
Implements hook_form_alter().

File

./workbench_access.module, line 1586
Workbench Access module file.

Code

function workbench_access_default_form_element(&$form, &$form_state) {

  // Try to find the form element(s) to target.
  workbench_access_find_form_elements($form);
  if (empty($form['workbench_access_fields']['#value'])) {
    drupal_set_message(workbench_access_configuration_needed_message(), 'warning');
  }
  else {

    // Generate options so we can check for access.
    $options = workbench_access_active_options();

    // Call the function.
    $func = $form['workbench_access_fields']['#access_type'] . '_workbench_access_default_form_alter';
    if (function_exists($func)) {
      $func($form, $form_state, $options);
    }
  }
}