You are here

function ffc_can_use_condition in Field formatter conditions 7

Check whether this condition has field types and if the current field type can use it.

Parameters

$condition: The condition definition.

$current_field_type: The current field type.

Return value

TRUE if the field type can use the condition, FALSE otherwise.

1 call to ffc_can_use_condition()
_ffc_field_formatter_settings_form_alter in ./ffc.ffc_conditions_info.inc
Implements hook_field_formatter_settings_form_alter().

File

./ffc.ffc_conditions_info.inc, line 208
Hook implementations and API functions for Field formatter settings.

Code

function ffc_can_use_condition($condition, $current_field_type) {
  if (!empty($condition['field types'])) {
    foreach ($condition['field types'] as $field_type) {
      if ($field_type === $current_field_type) {
        return TRUE;
      }
    }
    return FALSE;
  }
  return TRUE;
}