You are here

function dragndrop_upload_modules_enabled in Drag & Drop Upload 7

Implements hook_modules_installed().

Enable dragndrop_upload_element, dragndrop_upload_file, dragndrop_upload_image, dragndrop_upload_multi modules automatically.

File

./dragndrop_upload.module, line 30
Provides API for drag & drop upload features.

Code

function dragndrop_upload_modules_enabled($modules) {
  if (in_array('dragndrop_upload', $modules)) {
    $enable = array(
      'dragndrop_upload_element',
    );

    // Add dragndrop_upload_file module only if module 'file' is enabled.
    if (module_exists('file')) {
      $enable[] = 'dragndrop_upload_file';
    }

    // Add dragndrop_upload_image module only if module 'image' is enabled.
    if (module_exists('image')) {
      $enable[] = 'dragndrop_upload_image';
    }

    // Add dragndrop_upload_multi module only if module
    // 'multiupload_filefield_widget' is enabled.
    if (module_exists('multiupload_filefield_widget')) {
      $enable[] = 'dragndrop_upload_multi';
    }
    module_enable($enable);
  }
}