You are here

select2widget.install in Select2 Field Widget 7

Same filename and directory in other branches
  1. 7.2 select2widget.install

Install, uninstall, and requirements operations.

File

select2widget.install
View source
<?php

/**
 * @file
 * Install, uninstall, and requirements operations.
 */

/**
 * Implements hook_requirements().
 */
function select2widget_requirements($phase) {
  module_load_include('module', 'libraries');
  $available = libraries_get_path('select2');
  $t = get_t();
  return array(
    'select2widget_library' => array(
      'title' => $t('Select2'),
      'value' => $available ? $t('Library is available') : $t('Library is missing'),
      'description' => $available ? NULL : $t('Please download the Select2 library into "sites/all/libraries" or any alternative path that is supported by the libraries module.'),
      'severity' => $available ? REQUIREMENT_OK : REQUIREMENT_ERROR,
    ),
  );
}

Functions