You are here

function _image_check_settings in Image 5

Same name and namespace in other branches
  1. 5.2 image.module \_image_check_settings()
  2. 6 image.module \_image_check_settings()

Verify the image module and toolkit settings.

6 calls to _image_check_settings()
image_admin_settings in ./image.module
Admin settings callback.
image_attach_form_alter in contrib/image_attach/image_attach.module
implementation of hook_form_alter()
image_form in ./image.module
Implementation of hook_form
image_gallery_admin in contrib/image_gallery/image_gallery.module
image_gallery_admin_settings in contrib/image_gallery/image_gallery.module

... See full list

File

./image.module, line 845

Code

function _image_check_settings() {

  // File paths
  $image_path = file_create_path(variable_get('image_default_path', 'images'));
  $temp_path = rtrim($image_path, '/') . '/temp';
  if (!file_check_directory($image_path, FILE_CREATE_DIRECTORY, 'image_default_path')) {
    return false;
  }
  if (!file_check_directory($temp_path, FILE_CREATE_DIRECTORY, '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;
}