You are here

function imce_add_file in IMCE 6

Same name and namespace in other branches
  1. 6.2 inc/imce.page.inc \imce_add_file()
  2. 7 inc/imce.page.inc \imce_add_file()

Add a new file to the file list.

2 calls to imce_add_file()
imce_resize_image in inc/page.inc
Resize an image in the file list. Also used for thumbnail creation.
imce_upload_submit in inc/page.inc
Submit upload form.

File

inc/page.inc, line 523

Code

function imce_add_file($file, &$imce) {
  $imce['dirsize'] += $file->filesize;
  if (isset($imce['files'][$file->filename])) {
    $imce['dirsize'] -= $imce['files'][$file->filename]['size'];
  }
  $imce['files'][$file->filename] = array(
    'name' => $file->filename,
    'size' => $file->filesize,
    'width' => $file->width,
    'height' => $file->height,
    'date' => $file->timestamp,
  );
  if (isset($_GET['jsop'])) {
    $add = $imce['files'][$file->filename];
    $add['name'] = rawurlencode($file->filename);
    $add['fsize'] = format_size($file->filesize);
    $add['fdate'] = format_date($file->timestamp, 'small');
    $add['id'] = $file->fid;
    $imce['added'][] = $add;
  }
}