function highcharttable_libraries_info_alter in HighchartTable 7
Implements hook_libraries_info_alter().
This is a dynamic appendix to the .libraries.info files. Through the configuration page, the user may opt for a variant, used here.
File
- ./
highcharttable.module, line 366 - highcharttable.module
Code
function highcharttable_libraries_info_alter(&$libraries) {
if (!isset($libraries['highcharttable'])) {
return;
}
// The d.o. packaging script unfortunately adds to the .libraries.info file
// the version number of the module in the same way as it does for
// highcharttables.info. This is bad news for us, as once set, the Libraries
// module will not attempt to read it from the specified files. So unset.
unset($libraries['highcharts']['version']);
unset($libraries['highcharttable']['version']);
$global_settings = variable_get('highcharttable_global_settings', array());
$variant = empty($global_settings['use-patched-library']) ? NULL : 'patched';
// Based on the variant, the version number is found in a different file.
// Not only is the file where we obtain the version different, so is its path.
// The default path is sites/all/libraries/highcharttable, the variant path
// is the module path.
if ($variant == 'patched') {
$libraries['highcharttable']['library path'] = drupal_get_path('module', 'highcharttable');
}
$libraries['highcharttable']['version arguments']['file'] = $variant == 'patched' ? 'libraries/variants/highchartTable-patched.jquery.json' : 'highchartTable.jquery.json';
}