You are here

function subscriptions_ui_node_view in Subscriptions 2.0.x

Same name and namespace in other branches
  1. 7 subscriptions_ui.module \subscriptions_ui_node_view()

Implements hook_ENTITY_TYPE_view().

File

subscriptions_ui/subscriptions_ui.module, line 15
Provides a user interface for Subscriptions.

Code

function subscriptions_ui_node_view(array &$build, NodeInterface $node, EntityViewDisplayInterface $display, $view_mode) {
  if ($view_mode != 'full') {
    return;
  }
  if (!subscriptions_ui_can_subscribe($node)) {
    return;
  }
  $config = \Drupal::config('subscriptions_ui.settings');
  $form_in_block = $config
    ->get('form_in_block');
  $link_only = $config
    ->get('link_only');
  if (!$form_in_block) {
    return;
  }
  if (!$link_only) {
    return;
  }
}