You are here

function environment_indicator_needs_js in Environment Indicator 7.2

Same name and namespace in other branches
  1. 8.2 environment_indicator.module \environment_indicator_needs_js()

Helper function to check if the JS needs to be included.

Return value

bool TRUE if the extra JavaScript is needed.

1 call to environment_indicator_needs_js()
environment_indicator_page_build in ./environment_indicator.module
Implements hook_page_build().

File

./environment_indicator.module, line 523
Module implementation file.

Code

function environment_indicator_needs_js() {
  $integrations = variable_get('environment_indicator_integration', array(
    'toolbar' => 'toolbar',
    'admin_menu' => 'admin_menu',
    'navbar' => 'navbar',
  ));
  return module_exists('toolbar') && user_access('access toolbar') && !empty($integrations['toolbar']) || module_exists('admin_menu') && user_access('access administration menu') && !empty($integrations['admin_menu']) || module_exists('navbar') && user_access('access navbar') && !empty($integrations['navbar']);
}