You are here

function rules_page_attachments in Rules 8.3

Implements hook_page_attachments().

File

./rules.module, line 58
Hook implementations for the Rules module.

Code

function rules_page_attachments(array &$attachments) {

  // We need JavaScript and CSS to render the debug log properly
  // and to provide the expand/collapse functionality.
  if (\Drupal::currentUser()
    ->hasPermission('access rules debug')) {
    if (\Drupal::config('rules.settings')
      ->get('debug_log.enabled')) {
      $attachments['#attached']['library'][] = 'rules/rules.debug';
    }
  }
}