select2widget.install in Select2 Field Widget 7
Same filename and directory in other branches
Install, uninstall, and requirements operations.
File
select2widget.installView 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
Name | Description |
---|---|
select2widget_requirements | Implements hook_requirements(). |