You are here

function clientside_validation_library_alter in Clientside Validation 7.2

Same name and namespace in other branches
  1. 7 clientside_validation.module \clientside_validation_library_alter()

Implementation of hook_library_alter().

File

./clientside_validation.module, line 788
Add client side validation to forms.

Code

function clientside_validation_library_alter(&$libraries, $module) {
  if (variable_get('clientside_validation_override_jquery_form', 0)) {

    // We are updating just the system module. For all other cases we return.
    if ($module != 'system') {
      return;
    }
    $lib = libraries_detect('jquery.validate');

    // Replace jQuery Form plugin.
    $libraries['jquery.form']['js']['misc/jquery.form.js']['data'] = $lib['library path'] . '/lib/jquery.form.js';
    $libraries['jquery.form']['version'] = libraries_get_version($lib, array(
      'file' => 'lib/jquery.form.js',
      'pattern' => '/([0-9\\.-]+)/',
      'lines' => 4,
    ));
  }
}