Index: jquery_update.install
===================================================================
RCS file: /cvs/drupal/contributions/modules/jquery_update/jquery_update.install,v
retrieving revision 1.1.2.3
diff -u -F^f -r1.1.2.3 jquery_update.install
--- jquery_update.install 15 Jul 2008 23:13:55 -0000 1.1.2.3
+++ jquery_update.install 3 Aug 2009 07:32:11 -0000
@@ -15,21 +15,37 @@ function jquery_update_requirements($pha
switch ($phase) {
case 'install':
case 'runtime':
- $path = drupal_get_path('module', 'jquery_update') . '/misc/jquery.js';
- if (file_exists($path) && file_exists('misc/jquery.js') && md5_file($path) != md5_file('misc/jquery.js')) {
+ $moduleDir = drupal_get_path('module', 'jquery_update');
+ $jsFiles = array('jquery.js', 'collapse.js', 'farbtastic/farbtastic.js', 'tableselect.js', 'upload.js');
+ $filesUncopied = array();
+ $filesMissing = array();
+ foreach ($jsFiles as $filename) {
+ $filePathInCore = 'misc/' . $filename;
+ $filePathInMod = $moduleDir . '/misc/' . $filename;
+ if (file_exists($filePathInMod)) {
+ if (file_exists($filePathInCore) && (md5_file($filePathInCore) != md5_file($filePathInMod))) {
+ $filesUncopied[] = $filePathInMod;
+ }
+ } else {
+ $filesMissing[] = $filePathInMod;
+ }
+ }
+ if (!empty($filesUncopied)) {
+ $filesUncopiedStr = '\'' . implode('\', \'', $filesUncopied) . '\'';
$requirements['jquery'] = array(
- 'title' => $t('Please copy jQuery'),
- 'description' => $t('In order for the jQuery Update module to work correctly, please copy the file at %mod and use it to replace %core.', array('%core' => 'misc/jquery.js', '%mod' => $path)),
+ 'title' => $t('Please copy Javascript files'),
+ 'description' => $t('In order for the jQuery Update module to work correctly, please copy the following file(s) to %core, replace the file(s) of the same name: %filelist', array('%core' => '/misc/', '%filelist' => $filesUncopiedStr)),
'severity' => $phase == 'install' ? REQUIREMENT_WARNING : REQUIREMENT_ERROR,
- 'value' => $t('Copy jquery.js'),
+ 'value' => $t('Copy js files'),
);
}
- elseif (!file_exists($path)) {
+ elseif (!empty($filesMissing)) {
+ $filesMissingStr = '\'' . implode('\', \'', $filesMissing) . '\'';
$requirements['jquery'] = array(
- 'title' => $t('jquery.js no longer exists in the jQuery Update directory'),
- 'description' => $t('You probably moved rather than copied the jquery.js file from %mod to %core. You should leave a copy of this file in the module directory so that will not lose this file when you upgrade to another revision of Drupal.', array('%core' => 'misc/jquery.js', '%mod' => $path)),
+ 'title' => $t('Javascript files missing from the jQuery Update directory'),
+ 'description' => $t('You probably moved rather than copied the following javascript files from %mod to %core. You should leave a copy of these file in the module directory for use when upgrading Drupal: %filelist.', array('%mod' => $moduleDir . '/misc/', '%core' => '/misc/', '%filelist' => $filesMissingStr)),
'severity' => $phase == 'install' ? REQUIREMENT_WARNING : REQUIREMENT_ERROR,
- 'value' => $t('Copy jquery.js'),
+ 'value' => $t('Copy js files'),
);
}
elseif ($phase == 'runtime') {