You are here

function required_by_role_is_required in Required by role 7

Central method to figure out if the fields should be required or not based on the current callback.

4 calls to required_by_role_is_required()
required_by_role_date_popup_process_alter in ./required_by_role.date.inc
Implements hook_date_date_popup_process_alter().
required_by_role_date_select_process_alter in ./required_by_role.date.inc
Implements hook_date_select_process_alter().
required_by_role_date_text_process_alter in ./required_by_role.date.inc
Implements hook_date_text_process_alter().
required_by_role_field_widget_form_alter in ./required_by_role.module
Implements hook_field_widget_form_alter().

File

./required_by_role.module, line 109

Code

function required_by_role_is_required($account, $settings, $context, $form_state) {
  $is_required = NULL;
  $roles = $settings['required_by_role'] ? $settings['required_by_role'] : array();
  $required_callback = _required_by_role_get_callback();
  if (is_callable($required_callback)) {
    $is_required = $required_callback($account, $roles, $context, $form_state);
  }
  return $is_required;
}