You are here

public function ViewRevisionsRequest::isViewAdminRoute in Config Entity Revisions 8.2

File

modules/view_revisions/src/ViewRevisionsRequest.php, line 122

Class

ViewRevisionsRequest
Handles view requests.

Namespace

Drupal\view_revisions

Code

public function isViewAdminRoute() {
  if (isset($this->isAdminRoute)) {
    return $this->isAdminRoute;
  }

  // Make sure the current route is an admin route.
  if (!$this->adminContext
    ->isAdminRoute()) {
    $this->isAdminRoute = FALSE;
    return $this->isAdminRoute;
  }
  $route_name = $this->routeMatch
    ->getRouteName();
  if (in_array($route_name, [
    'entity.view.canonical',
    'entity.view_submission.edit_form',
  ])) {
    $this->isAdminRoute = FALSE;
  }
  else {
    $this->isAdminRoute = preg_match('/^(view\\.|^entity\\.([^.]+\\.)?view)/', $route_name) ? TRUE : FALSE;
  }
  return $this->isAdminRoute;
}