function image_fupload_requirements in Image FUpload 6.3
Same name and namespace in other branches
- 6 image_fupload.install \image_fupload_requirements()
- 6.2 image_fupload.install \image_fupload_requirements()
Implementation of hook_requirements().
File
- ./
image_fupload.install, line 50
Code
function image_fupload_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
// Make sure that swfUpload Files which aren't bundled with this module, are located in swfupload directory
$path = drupal_get_path('module', 'image_fupload') . '/swfupload/';
if (!file_exists($path . 'swfupload.js') || !file_exists($path . 'swfupload.queue.js') || !file_exists($path . 'swfupload.swf')) {
// One or more needed files are missing; give an error
$requirements['image_fupload'] = array(
'title' => t('Image FUpload'),
'value' => t('Missing or wrong files in subdirectory "swfupload"'),
'description' => t('Some needed files which are not bundled with this module, are missing or out-of-date! This can be either "swfupload.swf", "swfupload.js" or "swfupload.queue.js" which should be located in "%path". These files can be downloaded from !page. <em>Note:</em> Version 2.2.0 or higher is needed.', array(
'%path' => $path,
'!page' => l(t('SWFUploads project page'), 'http://code.google.com/p/swfupload/'),
)),
'severity' => REQUIREMENT_ERROR,
);
}
}
return $requirements;
}