function plupload_library_info_alter in Plupload integration 8
Same name and namespace in other branches
- 2.0.x plupload.module \plupload_library_info_alter()
Implements hook_library_info_alter().
Adds dynamic parts of library definition.
File
- ./
plupload.module, line 16 - Implementation of plupload.module.
Code
function plupload_library_info_alter(&$library_definition, $extension) {
if ($extension == 'plupload') {
$library_definition['plupload']['settings']['plupload']['_default']['max_file_size'] = Environment::getUploadMaxSize() . 'b';
$library_definition['plupload']['settings']['plupload']['_default']['chunk_size'] = Bytes::toInt(ini_get('post_max_size')) . 'b';
if (\Drupal::service('module_handler')
->moduleExists('locale')) {
$library_definition['plupload']['js']['js/i18n.js'] = [
'scope' => 'footer',
];
}
}
}