You are here

function cpf_library_info_alter in CPF 8

Implements hook_library_info_alter().

File

./cpf.module, line 33
Provides a CPF Field Type and a CPF Form Element for storing CPF number data.

Code

function cpf_library_info_alter(&$libraries, $extension) {
  if ($extension == 'cpf' and isset($libraries['mask_plugin'])) {
    $library_path = libraries_get_path('mask_plugin');
    if (strpos($library_path, '/') !== 0) {
      $library_path = '/' . $library_path;
    }

    // Set the correct path to where the library was downloaded.
    $libraries['mask_plugin']['js'][$library_path . '/jquery.mask.min.js'] = $libraries['mask_plugin']['js']['jquery.mask.min.js'];
    unset($libraries['mask_plugin']['js']['jquery.mask.min.js']);
  }
}