function nice_imagefield_widget_requirements in Nice ImageField Widget 7
Same name and namespace in other branches
- 7.2 nice_imagefield_widget.module \nice_imagefield_widget_requirements()
Implements hook_requirements().
Parameters
$phase:
Return value
array
File
- ./
nice_imagefield_widget.module, line 16
Code
function nice_imagefield_widget_requirements($phase) {
// Create an array to hold Nice ImageField Widget requirements.
$requirements = array();
// Check requirements during the runtime phase.
if ($phase == 'runtime') {
// Check if the jQuery Flip plugin library is installed.
if (($library = libraries_detect('flip')) && !empty($library['installed'])) {
$requirements['nice_imagefield_widget_library'] = array(
'title' => t('jQuery Flip plugin'),
'value' => t('Installed'),
'severity' => REQUIREMENT_OK,
);
}
else {
$requirements['nice_imagefield_widget_library'] = array(
'title' => t('jQuery Flip plugin'),
'value' => t('Not installed'),
'description' => t('<em>Nice ImageField Widget</em> module requires <a href="@jquery_flip">jQuery Flip</a> plugin.', array(
'@jquery_flip' => $library['vendor url'],
)),
'severity' => REQUIREMENT_ERROR,
);
}
}
return $requirements;
}