--- imce.module 2006-08-18 18:34:17.000000000 -0700 +++ imce.module.new 2006-09-05 06:57:22.113554780 -0700 @@ -72,12 +72,15 @@ //file list $files = imce_scan_directory($dir); foreach ($files['list'] as $path=>$file) { + $url_path = variable_get('imce_avoid_site_specific_url', '') + ? preg_replace('!/sites/[^/]*/!', '/', $basepath . $path) + : ($basepath . $path); $rows[] = array( 'data' => array( array('data' => $file['f'], 'class' => 'filename'), format_size($file['s']), $file['w'].'x'.$file['h'], - ($delete ? l(t('delete'), 'imce/delete', array(), 'delpath='.$path).' - ' : ''). ''. t('add').'' + ($delete ? l(t('delete'), 'imce/delete', array(), 'delpath='.$path).' - ' : ''). ''. t('add').'' ), 'ipath' => $file['w'] ? $basepath. $path : '', 'iw' => $file['w'], @@ -288,5 +291,11 @@ '#default_value' => variable_get('imce_allowed_extensions', ''), '#description' => t('Although imce is mainly designed to browse images, it supports uploading and browsing of any file type. If you like to use this feature, define your allowed non-image file extensions here with a comma between them. Ex .doc, .pdf, .zip. Note that, image upload limits also apply for these files. For a pure image browser leave this field blank.'), ); + $form['imce_avoid_site_specific_url'] = array( + '#type' => 'checkbox', + '#title' => t('Avoid URLs specific to multi-site'), + '#default_value' => variable_get('imce_avoid_site_specific_url', ''), + '#description' => t('When using multi-site setup, instead of generating paths to /sites/www.example.com/files/, generate paths to /files/. This makes content from a multi-site database portable to different sites, such as a testing site, but it depends on a web server alias from /files/ to the correct directory. This module does not set up that alias.'), + ); return $form; }