You are here

function jquery_colorpicker_requirements in Jquery Colorpicker 8.2

Same name and namespace in other branches
  1. 8 jquery_colorpicker.install \jquery_colorpicker_requirements()
  2. 6.2 jquery_colorpicker.install \jquery_colorpicker_requirements()
  3. 7 jquery_colorpicker.install \jquery_colorpicker_requirements()

Implements hook_requirements().

File

./jquery_colorpicker.install, line 16
Holds install hooks for the jQuery Colorpicker module.

Code

function jquery_colorpicker_requirements($phase) {
  $requirements = [];
  if ($phase == 'runtime') {
    if (file_exists(DRUPAL_ROOT . '/libraries/jquery_colorpicker/js/colorpicker.js')) {
      $requirements['jquery_colorpicker'] = [
        'title' => t('Jquery Colorpicker'),
        'description' => t('The Jquery Colorpicker module no longer requires the jQuery Colorpicker Library located at %path. This library should now be removed as it could be a security risk.', [
          '%path' => DRUPAL_ROOT . '/libraries/jquery_colorpicker',
        ]),
        'severity' => REQUIREMENT_WARNING,
      ];
    }
  }
  return $requirements;
}