diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-07-04 18:26:42 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-07-04 18:26:42 +0000 |
commit | 4a4a6570d8b84f7b58e1f6e27ffc16ee9f9f1789 (patch) | |
tree | 2e70b7d5c5ee90e3c732939e5f99e18466b9637d /modules/simpletest/tests/common_test.module | |
parent | a0d19b08104768d09274e644d8e0f439316714b0 (diff) | |
download | brdo-4a4a6570d8b84f7b58e1f6e27ffc16ee9f9f1789.tar.gz brdo-4a4a6570d8b84f7b58e1f6e27ffc16ee9f9f1789.tar.bz2 |
#315100 by Rob Loach, quicksketch, sun, skilip, aaron, et al: Add ability for modules to register JS/CSS libraries.
Diffstat (limited to 'modules/simpletest/tests/common_test.module')
-rw-r--r-- | modules/simpletest/tests/common_test.module | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/modules/simpletest/tests/common_test.module b/modules/simpletest/tests/common_test.module index 71d384d10..c1a8b7917 100644 --- a/modules/simpletest/tests/common_test.module +++ b/modules/simpletest/tests/common_test.module @@ -23,3 +23,35 @@ function common_test_theme() { function theme_common_test_foo($foo, $bar) { return $foo . $bar; } + +/** + * Implementation of hook_library_alter(). + */ +function common_test_library_alter(&$libraries, $module) { + if ($module == 'system' && isset($libraries['farbtastic'])) { + // Change the title of Farbtastic to "Farbtastic: Altered Library". + $libraries['farbtastic']['title'] = 'Farbtastic: Altered Library'; + // Make Farbtastic depend on jQuery Form to test library dependencies. + $libraries['farbtastic']['dependencies'][] = array('system', 'form'); + } +} + +/** + * Implementation of hook_library(). + * + * Adds Farbtastic in a different version. + */ +function common_test_library() { + $libraries['farbtastic'] = array( + 'title' => 'Custom Farbtastic Library', + 'website' => 'http://code.google.com/p/farbtastic/', + 'version' => '5.3', + 'js' => array( + 'misc/farbtastic/farbtastic.js' => array(), + ), + 'css' => array( + 'misc/farbtastic/farbtastic.css' => array(), + ), + ); + return $libraries; +} |