diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-04-14 19:20:46 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-04-14 19:20:46 +0000 |
commit | fb580ade439a1903f1355f447e5e3d167cfb1a65 (patch) | |
tree | 9738fd60cca5c1b19b79c824055f150a25a00f51 /modules | |
parent | 13a888c0f8510653932390808cd345471c5a1d2b (diff) | |
download | brdo-fb580ade439a1903f1355f447e5e3d167cfb1a65.tar.gz brdo-fb580ade439a1903f1355f447e5e3d167cfb1a65.tar.bz2 |
Fixing indentation.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/upload.module | 36 | ||||
-rw-r--r-- | modules/upload/upload.module | 36 |
2 files changed, 44 insertions, 28 deletions
diff --git a/modules/upload.module b/modules/upload.module index 5c7c36edf..81c447bd7 100644 --- a/modules/upload.module +++ b/modules/upload.module @@ -80,11 +80,11 @@ function upload_menu($may_cache) { foreach ($_SESSION['file_previews'] as $fid => $file) { $filename = file_create_filename($file->filename, file_create_path()); if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) { - // strip file_directory_path() from filename. @see file_create_url - if (strpos($filename, file_directory_path()) !== false) { - $filename = trim(substr($filename, strlen(file_directory_path())), '\\/'); - } - $filename = 'system/files/' . $filename; + // strip file_directory_path() from filename. @see file_create_url + if (strpos($filename, file_directory_path()) !== false) { + $filename = trim(substr($filename, strlen(file_directory_path())), '\\/'); + } + $filename = 'system/files/' . $filename; } $items[] = array( @@ -154,9 +154,11 @@ function upload_file_download($file) { $type = mime_header_encode($file->filemime); // Serve images and text inline for the browser to display rather than download. $disposition = ereg('^(text/|image/)', $file->filemime) ? 'inline' : 'attachment'; - return array('Content-Type: '. $type .'; name='. $name, - 'Content-Length: '. $file->filesize, - 'Content-Disposition: '. $disposition .'; filename='. $name); + return array( + 'Content-Type: '. $type .'; name='. $name, + 'Content-Length: '. $file->filesize, + 'Content-Disposition: '. $disposition .'; filename='. $name + ); } else { return -1; @@ -179,7 +181,7 @@ function _upload_prepare(&$node) { if(count($_POST) == 0) { if (is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) { foreach($_SESSION['file_previews'] as $fid => $file) { - file_delete($file->filepath); + file_delete($file->filepath); } unset($_SESSION['file_previews']); } @@ -410,10 +412,16 @@ function upload_nodeapi(&$node, $op, $arg) { if (count($files) > 0) { // RSS only allows one enclosure per item $file = array_shift($files); - return array(array('key' => 'enclosure', - 'attributes' => array('url' => file_create_url($file->filepath), - 'length' => $file->filesize, - 'type' => $file->filemime))); + return array( + array( + 'key' => 'enclosure', + 'attributes' => array( + 'url' => file_create_url($file->filepath), + 'length' => $file->filesize, + 'type' => $file->filemime + ) + ) + ); } } return array(); @@ -457,7 +465,7 @@ function upload_save($node) { if ($file->remove) { // Remove file previews... if (strpos($file->fid, 'upload') !== false) { - file_delete($file->filepath); + file_delete($file->filepath); } // Remove managed files. diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 5c7c36edf..81c447bd7 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -80,11 +80,11 @@ function upload_menu($may_cache) { foreach ($_SESSION['file_previews'] as $fid => $file) { $filename = file_create_filename($file->filename, file_create_path()); if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) { - // strip file_directory_path() from filename. @see file_create_url - if (strpos($filename, file_directory_path()) !== false) { - $filename = trim(substr($filename, strlen(file_directory_path())), '\\/'); - } - $filename = 'system/files/' . $filename; + // strip file_directory_path() from filename. @see file_create_url + if (strpos($filename, file_directory_path()) !== false) { + $filename = trim(substr($filename, strlen(file_directory_path())), '\\/'); + } + $filename = 'system/files/' . $filename; } $items[] = array( @@ -154,9 +154,11 @@ function upload_file_download($file) { $type = mime_header_encode($file->filemime); // Serve images and text inline for the browser to display rather than download. $disposition = ereg('^(text/|image/)', $file->filemime) ? 'inline' : 'attachment'; - return array('Content-Type: '. $type .'; name='. $name, - 'Content-Length: '. $file->filesize, - 'Content-Disposition: '. $disposition .'; filename='. $name); + return array( + 'Content-Type: '. $type .'; name='. $name, + 'Content-Length: '. $file->filesize, + 'Content-Disposition: '. $disposition .'; filename='. $name + ); } else { return -1; @@ -179,7 +181,7 @@ function _upload_prepare(&$node) { if(count($_POST) == 0) { if (is_array($_SESSION['file_previews']) && count($_SESSION['file_previews'])) { foreach($_SESSION['file_previews'] as $fid => $file) { - file_delete($file->filepath); + file_delete($file->filepath); } unset($_SESSION['file_previews']); } @@ -410,10 +412,16 @@ function upload_nodeapi(&$node, $op, $arg) { if (count($files) > 0) { // RSS only allows one enclosure per item $file = array_shift($files); - return array(array('key' => 'enclosure', - 'attributes' => array('url' => file_create_url($file->filepath), - 'length' => $file->filesize, - 'type' => $file->filemime))); + return array( + array( + 'key' => 'enclosure', + 'attributes' => array( + 'url' => file_create_url($file->filepath), + 'length' => $file->filesize, + 'type' => $file->filemime + ) + ) + ); } } return array(); @@ -457,7 +465,7 @@ function upload_save($node) { if ($file->remove) { // Remove file previews... if (strpos($file->fid, 'upload') !== false) { - file_delete($file->filepath); + file_delete($file->filepath); } // Remove managed files. |