function is_adminpage in Back To Top 2.x
Same name and namespace in other branches
- 8 back_to_top.module \is_adminpage()
- 7 back_to_top.module \is_adminpage()
Check 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 - Implements hook_page_attachments().
File
- ./
back_to_top.module, line 212 - 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;
}