function shariff_requirements in Shariff Social Media Buttons 7
Same name and namespace in other branches
- 8 shariff.install \shariff_requirements()
Implements hook_requirements().
File
- ./
shariff.install, line 29 - Install, update and uninstall functions for the shariff module.
Code
function shariff_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
$t = get_t();
$library_shariff = libraries_detect('shariff');
$jquery_version = variable_get('jquery_update_jquery_version', '1.10');
if ($library_shariff['installed'] != TRUE) {
$requirements['shariff_lib'] = array(
'title' => $t('Shariff Libray'),
'value' => $t('Please download at least v1.4.6 of the !link library and place it in libraries under <code>shariff</code>. So that the js file is available under .../libraries/shariff/build/shariff.min.js.', array(
'!link' => l($t('Shariff'), $library_shariff['download url']),
)),
'severity' => REQUIREMENT_ERROR,
);
}
if (version_compare($jquery_version, 1.7, '<')) {
$requirements['shariff_jquery'] = array(
'title' => $t('Shariff jQuery'),
'value' => $t('Shariff requires jQuery 1.7 or higher. Please configure jQuery Update accordingly.'),
'severity' => REQUIREMENT_ERROR,
);
drupal_set_message($t('Shariff requires jQuery 1.7 or higher. Please configure jQuery Update accordingly.'), 'error');
}
if (count($requirements) == 0) {
$requirements['shariff'] = array(
'title' => $t('Shariff Library'),
'value' => $library_shariff['version'],
'severity' => REQUIREMENT_OK,
);
}
}
return $requirements;
}