function views_gantt_requirements in Views Gantt 7.2
Same name and namespace in other branches
- 7 views_gantt.install \views_gantt_requirements()
Implements hook_requirements().
File
- ./
views_gantt.install, line 11 - Install, update and uninstall functions for the views_gantt module.
Code
function views_gantt_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
$t = get_t();
$library = libraries_detect('dhtmlxgantt');
if (empty($library['installed'])) {
$requirements['dhtmlxgantt'] = array(
'title' => $t('dhtmlxGantt'),
'severity' => REQUIREMENT_ERROR,
'description' => $t('You need to download the !dhtmlxgantt, extract the archive
and place files from the dhtmlxGantt folder in the %path directory on your server.', array(
'!dhtmlxgantt' => l($t('dhtmlxGantt'), $library['download url']),
'%path' => 'sites/all/libraries/dhtmlxgantt',
)),
'value' => $t('dhtmlxgantt %lib', array(
'%lib' => $library['version'],
)),
);
}
else {
$requirements['dhtmlxgantt'] = array(
'title' => $t('dhtmlxGantt'),
'severity' => REQUIREMENT_OK,
'value' => $t('dhtmlxgantt %lib', array(
'%lib' => $library['version'],
)),
);
}
}
return $requirements;
}