
In Drupal Themes its very easy to extend existing libraries using the themes .info (and .libraries) file. This ain’t possible in a Mobule .info file. So we need a hook to do this:
/**
* Implements hook_library_info_alter()
* - Extend some module libraries we support or require for MY_MODULE
*/
function MY_MODULE_library_info_alter(&$libraries, $extension) {
if ($extension == 'views_bulk_operations' && isset($libraries['frontUi'])) {
// Extend existing library views_bulk_operations/adminUi
// Important! That a library is listed by this hook, doesn't mean the library is attached, it just means its registered.
$libraries['frontUi']['dependencies'][] = 'MY_MODULE/MY_LIBRARY_NAME';
}
}
Schreibe einen Kommentar