You are here

share_everywhere.views.inc in Share Everywhere 8

Same filename and directory in other branches
  1. 2.x share_everywhere.views.inc

Provides views data for Share Everywhere module.

File

share_everywhere.views.inc
View source
<?php

/**
 * @file
 * Provides views data for Share Everywhere module.
 */

/**
 * Implements hook_views_data().
 */
function share_everywhere_views_data() {
  $module_handler = \Drupal::service('module_handler');
  $data = [];
  $data['node']['share_everywhere_field'] = [
    'title' => t('Share Everywhere'),
    'help' => t('Buttons provided by the Share Everywhere service.'),
    'field' => [
      'id' => 'share_everywhere_field',
      'help' => t('Show Share Everywhere module for a particular node.'),
    ],
  ];
  if ($module_handler
    ->moduleExists('commerce_product')) {
    $data['commerce_product']['share_everywhere_field'] = [
      'title' => t('Share Everywhere'),
      'help' => t('Buttons provided by the Share Everywhere service.'),
      'field' => [
        'id' => 'share_everywhere_field',
        'help' => t('Show Share Everywhere module for a particular product.'),
      ],
    ];
  }
  return $data;
}

Functions