diff options
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.css | 7 | ||||
-rw-r--r-- | modules/system/system.info | 1 | ||||
-rw-r--r-- | modules/system/system.module | 24 |
3 files changed, 29 insertions, 3 deletions
diff --git a/modules/system/system.css b/modules/system/system.css index ef20fb1fe..67f92d89d 100644 --- a/modules/system/system.css +++ b/modules/system/system.css @@ -445,3 +445,10 @@ thead div.sticky-header { html.js .js-hide { display: none; } + +/* +** Styles for the system modules page (admin/build/modules) +*/ +#system-modules div.incompatible { + font-weight: bold; +} diff --git a/modules/system/system.info b/modules/system/system.info index a894f9bc3..28c8a686b 100644 --- a/modules/system/system.info +++ b/modules/system/system.info @@ -3,3 +3,4 @@ name = System description = Handles general site configuration for administrators. package = Core - required version = VERSION +core = 6.x diff --git a/modules/system/system.module b/modules/system/system.module index d2ad76018..bf1e7b93b 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -7,6 +7,7 @@ */ define('VERSION', '6.0-dev'); +define('DRUPAL_CORE_COMPATIBILITY', '6.x'); define('DRUPAL_MINIMUM_PHP', '4.3.3'); define('DRUPAL_MINIMUM_MYSQL', '4.1.0'); // If using MySQL @@ -1471,12 +1472,20 @@ function system_modules($form_state = array()) { // Array for disabling checkboxes in callback system_module_disable. $disabled = array(); $throttle = array(); + $incompatible = array(); // Traverse the files retrieved and build the form. foreach ($files as $filename => $file) { $form['name'][$filename] = array('#value' => $file->info['name']); $form['version'][$filename] = array('#value' => $file->info['version']); $form['description'][$filename] = array('#value' => t($file->info['description'])); $options[$filename] = ''; + // Ensure this module is compatible with this version of core. + if (!isset($file->info['core']) || $file->info['core'] != DRUPAL_CORE_COMPATIBILITY) { + $incompatible[] = $file->name; + $disabled[] = $file->name; + // Nothing else in this loop matters, so move to the next module. + continue; + } if ($file->status) { $status[] = $file->name; } @@ -1554,6 +1563,7 @@ function system_modules($form_state = array()) { 'system_modules_disable', ), '#disabled_modules' => $disabled, + '#incompatible_modules' => drupal_map_assoc($incompatible), ); // Handle throttle checkboxes, including overriding the @@ -1797,14 +1807,22 @@ function theme_system_modules($form) { $rows = array(); foreach ($modules as $key => $module) { $row = array(); - $row[] = array('data' => drupal_render($form['status'][$key]), 'align' => 'center'); - + $description = drupal_render($form['description'][$key]); + if (isset($form['status']['#incompatible_modules'][$key])) { + unset($form['status'][$key]); + $status = theme('image', 'misc/watchdog-error.png', t('incompatible'), t('Incompatible with this version of Drupal core')); + $description .= '<div class="incompatible">'. t('This version is incompatible with the !core_version version of Drupal core.', array('!core_version' => VERSION)) .'</div>'; + } + else { + $status = drupal_render($form['status'][$key]); + } + $row[] = array('data' => $status, 'align' => 'center'); if (module_exists('throttle')) { $row[] = array('data' => drupal_render($form['throttle'][$key]), 'align' => 'center'); } $row[] = '<strong>'. drupal_render($form['name'][$key]) .'</strong>'; $row[] = drupal_render($form['version'][$key]); - $row[] = array('data' => drupal_render($form['description'][$key]), 'class' => 'description'); + $row[] = array('data' => $description, 'class' => 'description'); $rows[] = $row; } $fieldset = array( |