You are here

function ds_test_ds_fields_info in Display Suite 7.2

Same name and namespace in other branches
  1. 7 tests/ds_test.module \ds_test_ds_fields_info()

Implements hook_ds_fields_info().

File

tests/ds_test.module, line 140
Display Suite test module.

Code

function ds_test_ds_fields_info($entity_type) {
  if ($entity_type == 'node') {
    $fields['node']['ds_test_field'] = array(
      'title' => t('Test code field from hook'),
      'field_type' => DS_FIELD_TYPE_FUNCTION,
      'function' => 'dstest_render_test_field',
    );
    $fields['node']['ds_test_field_2'] = array(
      'title' => t('Test code field from hook 2'),
      'field_type' => DS_FIELD_TYPE_FUNCTION,
      'function' => 'dstest_render_test_field',
    );
    $fields['node']['ds_test_field_empty_string'] = array(
      'title' => t('Test code field that returns an empty string'),
      'field_type' => DS_FIELD_TYPE_FUNCTION,
      'function' => 'dstest_render_empty_string',
    );
    $fields['node']['ds_test_field_false'] = array(
      'title' => t('Test code field that returns FALSE'),
      'field_type' => DS_FIELD_TYPE_FUNCTION,
      'function' => 'dstest_render_false',
    );
    $fields['node']['ds_test_field_null'] = array(
      'title' => t('Test code field that returns NULL'),
      'field_type' => DS_FIELD_TYPE_FUNCTION,
      'function' => 'dstest_render_null',
    );
    $fields['node']['ds_test_field_nothing'] = array(
      'title' => t('Test code field that returns nothing'),
      'field_type' => DS_FIELD_TYPE_FUNCTION,
      'function' => 'dstest_render_nothing',
    );
    $fields['node']['ds_test_field_zero_int'] = array(
      'title' => t('Test code field that returns zero as an integer'),
      'field_type' => DS_FIELD_TYPE_FUNCTION,
      'function' => 'dstest_render_zero_int',
    );
    $fields['node']['ds_test_field_zero_string'] = array(
      'title' => t('Test code field that returns zero as a string'),
      'field_type' => DS_FIELD_TYPE_FUNCTION,
      'function' => 'dstest_render_zero_string',
    );
    $fields['node']['ds_test_field_zero_float'] = array(
      'title' => t('Test code field that returns zero as a floating point number'),
      'field_type' => DS_FIELD_TYPE_FUNCTION,
      'function' => 'dstest_render_zero_float',
    );
    return $fields;
  }
}