123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443 |
- <?php
- function hook_libraries_info() {
-
-
-
-
- $libraries['example'] = array(
-
- 'name' => 'Example library',
- 'vendor url' => 'http://example.com',
- 'download url' => 'http://example.com/download',
-
-
- 'path' => 'lib',
-
- 'version callback' => 'mymodule_get_version',
-
-
- 'version arguments' => array(
- 'file' => 'docs/CHANGELOG.txt',
- 'pattern' => '@version\s+([0-9a-zA-Z\.-]+)@',
- 'lines' => 5,
- 'cols' => 20,
- ),
-
-
-
- 'files' => array(
-
-
- 'js' => array(
- 'exlib.js',
- 'gadgets/foo.js',
- ),
- 'css' => array(
- 'lib_style.css',
- 'skin/example.css',
- ),
-
-
- 'php' => array(
- 'exlib.php',
- 'exlib.inc',
- ),
- ),
-
- 'variants' => array(
-
- 'minified' => array(
- 'files' => array(
- 'js' => array(
- 'exlib.min.js',
- 'gadgets/foo.min.js',
- ),
- 'css' => array(
- 'lib_style.css',
- 'skin/example.css',
- ),
- ),
- 'variant callback' => 'mymodule_check_variant',
- 'variant arguments' => array(
- 'variant' => 'minified',
- ),
- ),
- ),
-
-
-
-
-
-
-
-
-
- 'versions' => array(
- '2' => array(
- 'files' => array(
- 'js' => array('exlib.js'),
- 'css' => array('exlib_style.css'),
- ),
- ),
- '3.0' => array(
- 'files' => array(
- 'js' => array('exlib.js'),
- 'css' => array('lib_style.css'),
- ),
- ),
- '3.2' => array(
- 'files' => array(
- 'js' => array(
- 'exlib.js',
- 'gadgets/foo.js',
- ),
- 'css' => array(
- 'lib_style.css',
- 'skin/example.css',
- ),
- ),
- ),
- ),
-
-
- 'integration files' => array(
- 'mymodule' => array(
- 'js' => array('ex_lib.inc'),
- ),
- ),
-
-
- 'callbacks' => array(
-
- 'info' => array(
- 'mymodule_example_libraries_info_callback',
- ),
-
- 'pre-detect' => array(
- 'mymodule_example_libraries_predetect_callback',
- ),
-
- 'post-detect' => array(
- 'mymodule_example_libraries_postdetect_callback',
- ),
-
- 'pre-load' => array(
- 'mymodule_example_libraries_preload_callback',
- ),
-
- 'post-load' => array(
- 'mymodule_example_libraries_postload_callback',
- ),
- ),
- );
-
-
- $libraries['simple'] = array(
- 'name' => 'Simple library',
- 'vendor url' => 'http://example.com/simple',
- 'download url' => 'http://example.com/simple',
- 'version arguments' => array(
- 'file' => 'readme.txt',
-
-
- 'pattern' => '/Version (\d+)/',
- 'lines' => 5,
- ),
- 'files' => array(
- 'js' => array('simple.js'),
- ),
- );
-
- $libraries['tinymce'] = array(
- 'name' => 'TinyMCE',
- 'vendor url' => 'http://tinymce.moxiecode.com',
- 'download url' => 'http://tinymce.moxiecode.com/download.php',
- 'path' => 'jscripts/tiny_mce',
-
-
- 'version callback' => 'tinymce_get_version',
- 'version arguments' => array(
-
-
-
- 'file' => 'jscripts/tiny_mce/tiny_mce.js',
-
-
-
- 'pattern' => '@majorVersion[=:]["\'](\d).+?minorVersion[=:]["\']([\d\.]+)@',
- 'lines' => 1,
- 'cols' => 100,
- ),
- 'versions' => array(
- '2.1' => array(
- 'files' => array(
- 'js' => array('tiny_mce.js'),
- ),
- 'variants' => array(
- 'source' => array(
- 'files' => array(
- 'js' => array('tiny_mce_src.js'),
- ),
- ),
- ),
- 'integration files' => array(
- 'wysiwyg' => array(
- 'js' => array('editors/js/tinymce-2.js'),
- 'css' => array('editors/js/tinymce-2.css'),
- ),
- ),
- ),
-
- '3.1' => array(
-
- 'files' => array(
- 'js' => array(
- 'tiny_mce.js' => array('preprocess' => FALSE),
- ),
- ),
- 'variants' => array(
-
-
- 'jquery' => array(
- 'files' => array(
- 'js' => array(
- 'tiny_mce_jquery.js' => array('preprocess' => FALSE),
- ),
- ),
- ),
- 'source' => array(
- 'files' => array(
- 'js' => array(
- 'tiny_mce_src.js' => array('preprocess' => FALSE),
- ),
- ),
- ),
- ),
- 'integration files' => array(
- 'wysiwyg' => array(
- 'js' => array('editors/js/tinymce-3.js'),
- 'css' => array('editors/js/tinymce-3.css'),
- ),
- ),
- ),
- ),
- );
- return $libraries;
- }
- function hook_libraries_info_alter(&$libraries) {
- $files = array(
- 'php' => array('example_module.php_spellchecker.inc'),
- );
- $libraries['php_spellchecker']['integration files']['example_module'] = $files;
- }
- function hook_libraries_paths() {
-
-
- return array(drupal_get_path('module', 'libraries_test') . '/example');
- }
|