function imagepicker_make_alphadirs in Image Picker 5.2
Same name and namespace in other branches
- 6.2 imagepicker.admin.inc \imagepicker_make_alphadirs()
1 call to imagepicker_make_alphadirs()
File
- ./
imagepicker.module, line 3625 - Enables permitted roles to upload images for insertion into configured nodes.
Code
function imagepicker_make_alphadirs($dir) {
if (file_check_directory($dir, TRUE)) {
$dirlist = range('a', 'z');
array_push($dirlist, 'others');
foreach ($dirlist as $v) {
$newdir = $dir . DIRECTORY_SEPARATOR . $v;
if (!file_check_directory($newdir, TRUE)) {
drupal_set_message(t('Directory creation for the Imagepicker module was unsuccessful.'), 'error');
}
}
$errors = drupal_get_messages('error');
if (!count($errors)) {
// clear
drupal_get_messages();
drupal_set_message(t('Directory creation for the Imagepicker module was successful.'));
return $dir;
}
else {
foreach ($errors['error'] as $error) {
drupal_set_message($error, 'error');
}
}
}
else {
drupal_set_message(t('Directory creation for the Imagepicker module was unsuccessful.'), 'error');
}
return FALSE;
}