? modules/path/path.css ? sites/default/files ? sites/default/settings.php Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.1208 diff -u -p -r1.1208 common.inc --- includes/common.inc 18 Aug 2010 00:44:52 -0000 1.1208 +++ includes/common.inc 19 Aug 2010 01:37:04 -0000 @@ -4599,6 +4599,7 @@ function _drupal_bootstrap_full() { // Let all modules take action before menu system handles the request // We do not want this while running update.php. if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update') { + module_init_all(); module_invoke_all('init'); } } Index: includes/module.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/module.inc,v retrieving revision 1.197 diff -u -p -r1.197 module.inc --- includes/module.inc 28 Jul 2010 01:46:59 -0000 1.197 +++ includes/module.inc 19 Aug 2010 01:37:04 -0000 @@ -766,6 +766,24 @@ function module_invoke_all() { */ /** + * Include stylesheets and scripts as defined in enabled modules .info files. + */ +function module_init_all() { + $module_list = module_list(); + $module_data = system_get_info('module'); + + foreach ($module_list as $module) { + if (!empty($module_data[$module]['stylesheets'])) { + foreach ($module_data[$module]['stylesheets'] as $media=>$stylesheets) { + foreach ($stylesheets as $stylesheet) { + drupal_add_css($stylesheet, array('media' => $media, 'preprocess' => TRUE)); + } + } + } + } +} + +/** * Array of modules required by core. */ function drupal_required_modules() { Index: modules/path/path.info =================================================================== RCS file: /cvs/drupal/drupal/modules/path/path.info,v retrieving revision 1.9 diff -u -p -r1.9 path.info --- modules/path/path.info 17 Nov 2009 21:24:18 -0000 1.9 +++ modules/path/path.info 19 Aug 2010 01:37:05 -0000 @@ -7,4 +7,5 @@ core = 7.x files[] = path.module files[] = path.admin.inc files[] = path.test + configure = admin/config/search/path Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.954 diff -u -p -r1.954 system.module --- modules/system/system.module 18 Aug 2010 18:41:30 -0000 1.954 +++ modules/system/system.module 19 Aug 2010 01:37:05 -0000 @@ -2289,6 +2289,10 @@ function _system_rebuild_module_data() { // Merge in defaults and save. $modules[$key]->info = $module->info + $defaults; + // Set the stylesheets & scripts variables with the correct paths. + $modules[$key]->info['stylesheets'] = _system_rebuild_info_stylesheets($modules[$key]->info, $modules[$key]->uri); + $modules[$key]->info['scripts'] = _system_rebuild_info_scripts($modules[$key]->info, $modules[$key]->uri); + // Install profiles are hidden by default, unless explicitly specified // otherwise in the .info file. if ($key == $profile && !isset($modules[$key]->info['hidden'])) { @@ -2412,25 +2416,10 @@ function _system_rebuild_theme_data() { } } - // Give the stylesheets proper path information. - $pathed_stylesheets = array(); - if (isset($themes[$key]->info['stylesheets'])) { - foreach ($themes[$key]->info['stylesheets'] as $media => $stylesheets) { - foreach ($stylesheets as $stylesheet) { - $pathed_stylesheets[$media][$stylesheet] = dirname($themes[$key]->uri) . '/' . $stylesheet; - } - } - } - $themes[$key]->info['stylesheets'] = $pathed_stylesheets; + // Set the stylesheets & scripts variables with the correct paths. + $themes[$key]->info['stylesheets'] = _system_rebuild_info_stylesheets($themes[$key]->info, $themes[$key]->uri); + $themes[$key]->info['scripts'] = _system_rebuild_info_scripts($themes[$key]->info, $themes[$key]->uri); - // Give the scripts proper path information. - $scripts = array(); - if (isset($themes[$key]->info['scripts'])) { - foreach ($themes[$key]->info['scripts'] as $script) { - $scripts[$script] = dirname($themes[$key]->uri) . '/' . $script; - } - } - $themes[$key]->info['scripts'] = $scripts; // Give the screenshot proper path information. if (!empty($themes[$key]->info['screenshot'])) { $themes[$key]->info['screenshot'] = dirname($themes[$key]->uri) . '/' . $themes[$key]->info['screenshot']; @@ -2481,6 +2470,42 @@ function system_rebuild_theme_data() { } /** + * Helper function to give the stylesheets listed in the .info file the proper + * path information. + * + * @return + * An associative array of stylesheet paths. + */ +function _system_rebuild_info_stylesheets($info, $uri) { + $pathed_stylesheets = array(); + if (isset($info['stylesheets'])) { + foreach ($info['stylesheets'] as $media => $stylesheets) { + foreach ($stylesheets as $stylesheet) { + $pathed_stylesheets[$media][$stylesheet] = dirname($uri) . '/' . $stylesheet; + } + } + } + return $pathed_stylesheets; +} + +/** + * Helper function to give the stylesheets listed in the .info file the proper + * path information. + * + * @return + * An associative array of stylesheet paths. + */ +function _system_rebuild_info_scripts($info, $uri) { + $scripts = array(); + if (isset($info['scripts'])) { + foreach ($info['scripts'] as $script) { + $scripts[$script] = dirname($uri) . '/' . $script; + } + } + return $scripts; +} + +/** * Returns an array of default theme features. */ function _system_default_theme_features() {