You are here

function ds_search_ds_fields_info in Display Suite 7

Same name and namespace in other branches
  1. 7.2 modules/ds_search/ds_search.module \ds_search_ds_fields_info()

Implements hook_ds_fields_info().

File

modules/ds_search/ds_search.module, line 75
Display Suite search.

Code

function ds_search_ds_fields_info($entity_type) {
  $fields = array();
  if ($entity_type == 'node') {
    $fields['node']['search_snippet'] = array(
      'title' => t('Search snippet'),
      'field_type' => DS_FIELD_TYPE_FUNCTION,
      'function' => 'ds_search_snippet',
      'ui_limit' => array(
        '*|' . variable_get('ds_search_view_mode', 'search_result'),
      ),
    );
    $fields['node']['search_info'] = array(
      'title' => t('Search info'),
      'field_type' => DS_FIELD_TYPE_FUNCTION,
      'function' => 'ds_search_extra_info',
      'ui_limit' => array(
        '*|' . variable_get('ds_search_view_mode', 'search_result'),
      ),
    );
  }
  if (isset($fields[$entity_type])) {
    return array(
      $entity_type => $fields[$entity_type],
    );
  }
  return;
}