function _image_check_settings in Image 6
Same name and namespace in other branches
- 5.2 image.module \_image_check_settings()
- 5 image.module \_image_check_settings()
Verify the image module and toolkit settings.
5 calls to _image_check_settings()
- image_attach_form_alter in contrib/
image_attach/ image_attach.module - Implementation of hook_form_alter().
- image_attach_form_node_type_form_alter in contrib/
image_attach/ image_attach.module - Implementation of hook_form_FORM_ID_alter().
- image_form in ./
image.module - Implementation of hook_form().
- image_gallery_admin in contrib/
image_gallery/ image_gallery.admin.inc - Menu callback for gallery admin.
- image_gallery_admin_settings in contrib/
image_gallery/ image_gallery.admin.inc - Menu callback for settings page.
File
- ./
image.module, line 770
Code
function _image_check_settings() {
// File paths
$image_path = file_create_path(file_directory_path() . '/' . variable_get('image_default_path', 'images'));
$temp_path = $image_path . '/temp';
if (!file_check_directory($image_path, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS, 'image_default_path')) {
return FALSE;
}
if (!file_check_directory($temp_path, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS, 'image_default_path')) {
return FALSE;
}
// Sanity check : make sure we've got a working toolkit
if (!image_get_toolkit()) {
drupal_set_message(t('No image toolkit is currently enabled. Without one the image module will not be able to resize your images. You can select one from the <a href="@link">image toolkit settings page</a>.', array(
'@link' => url('admin/settings/image-toolkit'),
)), 'error');
return FALSE;
}
return TRUE;
}