You are here

public function NodeHierarchyEventSubscriber::onRequest in Entity Reference Hierarchy 8

Initializes Entity Hierarchy module requirements.

File

src/EventSubscriber/NodeHierarchyEventSubscriber.php, line 42
Contains \Drupal\entity_hierarchy\EventSubscriber\NodeHierarchyEventSubscriber.

Class

NodeHierarchyEventSubscriber

Namespace

Drupal\entity_hierarchy\EventSubscriber

Code

public function onRequest(GetResponseEvent $event) {

  // Ensure we are not serving a cached page.
  if (function_exists('drupalSetContent')) {
    if ($this->moduleHandler
      ->moduleExists('token')) {
      include_once DRUPAL_ROOT . '/' . libraries_get_path('module', 'entity_hierarchy') . '/includes/entity_hierarchy_token.inc';
    }
    if ($this->moduleHandler
      ->moduleExists('workflow_ng')) {
      include_once DRUPAL_ROOT . '/' . libraries_get_path('module', 'entity_hierarchy') . '/includes/entity_hierarchy_workflow_ng.inc';
    }
  }
}