You are here

function service_links_displays_ds_fields in Service links 6.2

Implementation of hook_ds_fields().

File

plugins/service_links_displays.module, line 47
Custom Service Links field for Displays.

Code

function service_links_displays_ds_fields($type_name, $build_mode, $extra) {
  $fields = array(
    'service_links_displays_group' => array(
      'title' => t('Service Links Group'),
      'type' => DS_FIELD_TYPE_THEME,
      'status' => DS_FIELD_STATUS_STATIC,
      'properties' => array(
        'formatters' => array(
          'sld_group_text' => t('Text'),
          'sld_group_image' => t('Image'),
          'sld_group_image_and_text' => t('Image and text'),
          'sld_group_fisheye' => t('FishEye'),
        ),
      ),
    ),
  );
  $services = array_filter(variable_get('service_links_displays', array()));
  if (!empty($services)) {
    $services = service_links_get_links($services);
    foreach ($services as $service_id => $service) {
      $fields['service_links_displays_' . $service_id] = array(
        'title' => t('Service Links Field %name', array(
          '%name' => $service['name'],
        )),
        'type' => DS_FIELD_TYPE_THEME,
        'status' => DS_FIELD_STATUS_STATIC,
        'properties' => array(
          'formatters' => array(
            'sld_single_text' => t('Text'),
            'sld_single_image' => t('Image'),
            'sld_single_image_and_text' => t('Image and text'),
          ),
        ),
      );
    }
  }
  return array(
    'nd' => $fields,
  );
}