? LICENSE.txt ? clock.make Index: clock.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/clock/clock.module,v retrieving revision 1.9.2.2 diff -u -p -r1.9.2.2 clock.module --- clock.module 21 Mar 2010 20:57:19 -0000 1.9.2.2 +++ clock.module 22 Mar 2010 16:44:31 -0000 @@ -1,5 +1,5 @@ jQuery Timers library in a dedicated libraries directory in your sites directory. The file should then be located at e.g. sites/all/libraries/jquery.timers.js. Clock module will continue to function if you leave the jQuery Timers library in the clock module folder as of now, but the next version of Clock will not. Therefore you are strongly advised to make this change now to ensure seamless future upgrades.', 'warning'); + + } + else { + drupal_set_message('You have not obtained the jQuery Timers library that is required for Clock module to function properly. Please visit the jQuery Timers project page and download version 1.2.0 from there. Then place it as it is in a dedicated libraries directory in one of the sites folders and rename it to jquery.timers.js. The file should then be located at e.g. sites/all/libraries/jquery.timers.js.', 'error'); + } + } + if (!module_exists('libraries')) { + drupal_set_message('You currently have not installed the Libraries API module. Please download the latest version (if you haven\'t already) and install it. Currently, Clock module works fine without Libraries API, but the next version of Clock and all future releases will depend on it. Therefore you are strongly advised to make this change now to ensure seamless future upgrades.', 'warning'); + } + drupal_add_js(drupal_get_path('module', 'clock') . '/clock.js'); // In case of user-configurable timezones show it as an option. if (variable_get('configurable_timezones', 1) == 1) { @@ -247,8 +262,19 @@ function theme_clock($timezone = 'UTC', '5' => $clock_offset_name, '6' => $clock_date_format, ), 'setting'); + + + // Libraries API integration level 1 + if (file_exists(conf_path() . '/libraries/jquery.timers.js')) { + drupal_add_js(conf_path() . '/libraries/jquery.timers.js'); + } + elseif (file_exists('sites/all/libraries/jquery.timers.js')) { + drupal_add_js('sites/all/libraries/jquery.timers.js'); + } + elseif (file_exists(drupal_get_path('module', 'clock') . '/jquery.timers.js')) { + drupal_add_js(drupal_get_path('module', 'clock') . '/jquery.timers.js'); + } - drupal_add_js(drupal_get_path('module', 'clock') . '/jquery.timers.js'); drupal_add_js(drupal_get_path('module', 'clock') . '/clock.js'); }