function system_add_module_assets

Adds CSS and JavaScript files declared in module .info files.

1 call to system_add_module_assets()
system_init in drupal/core/modules/system/system.module
Implements hook_init().

File

drupal/core/modules/system/system.module, line 2374
Configuration system that lets administrators modify the workings of the site.

Code

function system_add_module_assets() {
  foreach (system_get_module_info('stylesheets') as $module => $value) {
    foreach ($value as $media => $stylesheets) {
      foreach ($stylesheets as $stylesheet) {
        drupal_add_css($stylesheet, array(
          'every_page' => TRUE,
          'media' => $media,
        ));
      }
    }
  }
  foreach (system_get_module_info('scripts') as $module => $scripts) {
    foreach ($scripts as $script) {
      drupal_add_js($script, array(
        'every_page' => TRUE,
      ));
    }
  }
}