You are here

function is_adminpage in Back To Top 8

Same name and namespace in other branches
  1. 7 back_to_top.module \is_adminpage()
  2. 2.x back_to_top.module \is_adminpage()

Check if page viewed is in admin section or a node/edit for possible option to not include javascript and css in that case.

1 call to is_adminpage()
back_to_top_page_attachments in ./back_to_top.module

File

./back_to_top.module, line 207
Adds the back to top button.

Code

function is_adminpage() {
  $route = \Drupal::routeMatch()
    ->getRouteObject();
  $is_admin = \Drupal::service('router.admin_context')
    ->isAdminRoute($route);

  // Alter for admin prevent check.
  \Drupal::moduleHandler()
    ->alter('back_to_top_admin_prevent', $is_admin);
  return $is_admin;
}